Last active
January 21, 2019 18:28
-
-
Save joswr1ght/a400f2648569003f555f6b3a467acb7c to your computer and use it in GitHub Desktop.
Zlib decompress file, producing file.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import zlib, sys | |
if len(sys.argv) != 2: | |
print "Usage: %s <zlib-compressed-file>"%sys.argv[0] | |
print "Produces decompressed file with \".out\" filename suffix." | |
sys.exit(0) | |
indata=open(sys.argv[1], "rb").read() | |
outdata=zlib.decompress(indata) | |
with open(sys.argv[1] + ".out", "wb") as f: | |
f.write(outdata) | |
f.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Traceback (most recent call last):
File "./zunzip.py", line 10, in
outdata=zlib.decompress(indata)
zlib.error: Error -3 while decompressing data: incorrect data check