File tree Expand file tree Collapse file tree 2 files changed +40
-2
lines changed
Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 1+ import zlib
2+ import bz2
3+
4+
5+ def main ():
6+ first_step ()
7+
8+
9+ def first_step ():
10+ file = open ("game/package.pack" , "rb" )
11+ bs = file .read ()
12+ result = ""
13+ while True :
14+ if bs .startswith (b"x\x9c " ):
15+ bs = zlib .decompress (bs )
16+ result += " "
17+ elif bs .startswith (b"BZ" ):
18+ bs = bz2 .decompress (bs )
19+ result += "#"
20+ elif bs .endswith (b"\x9c x" ):
21+ bs = bs [::- 1 ]
22+ result += "\n "
23+ else :
24+ break
25+ print (result )
26+
27+
28+ if __name__ == "__main__" :
29+ main ()
Original file line number Diff line number Diff line change 11# pythonchallenge
22Solve Problems in http://www.pythonchallenge.com
33
4+ #### 21
5+ result: http://www.pythonchallenge.com/pc/hex/copper.html
6+ ``` python
7+ import zlib
8+ import bz2
9+ ```
10+ - Here is a [ List of file signatures] ( https://en.wikipedia.org/wiki/List_of_file_signatures )
11+
12+
413#### 20
514result: password is redavni
615``` python
@@ -23,9 +32,9 @@ import base64
2332import wave
2433```
2534- use base64 to decode these codes
26- - use wave to reand and write frame
35+ - use wave to read and write frame
2736- the sea is yellow the land is blue,which is out of order
28- - if you email to leopold with “sorry”, you will find a surprise
37+ - if you email to leopold with “sorry” as subject , you will get a surprise
2938
3039
3140#### 18
You can’t perform that action at this time.
0 commit comments