-
-
Save 0xWDG/3cc7a6b597df2617544cf9af8c055768 to your computer and use it in GitHub Desktop.
Decompress FlateDecode Objects in PDF
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
#!/bin/bash | |
import re | |
import zlib | |
pdf = open("some_doc.pdf", "rb").read() | |
stream = re.compile(r'.*?FlateDecode.*?stream(.*?)endstream', re.S) | |
for s in stream.findall(pdf): | |
s = s.strip('\r\n') | |
try: | |
print(zlib.decompress(s)) | |
print("") | |
except: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment