Last active
June 2, 2017 17:46
-
-
Save primiano/7556d7df5dd9ace60dbe1164f2ed24b2 to your computer and use it in GitHub Desktop.
Dumps offsets of files within a zip file
This file contains 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
import zipfile, sys | |
zip = zipfile.ZipFile(sys.argv[1]) | |
for f in zip.infolist(): | |
# I have no idea about the +2 but observed experimentally that it gets us | |
# to the right place. | |
print('%-16x %-10d %s' % (f.header_offset + len(f.FileHeader()) + 2, f.compress_size, f.filename)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment