Last active
August 24, 2020 11:33
-
-
Save vale981/ba8f193ce739c59bf47cf5f1852b2b45 to your computer and use it in GitHub Desktop.
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 sys | |
import re | |
import chardet | |
if len(sys.argv) < 2: | |
sys.exit(f"Usage: {sys.argv[0]} [file]") | |
with open(sys.argv[1], "rb") as f: | |
input_str = f.read() | |
encoding = chardet.detect(input_str) | |
matches = re.findall( | |
r"1 OBJE\n2 FORM jpg\n2 FILE (.*?)\n(?:2 _.*\n)+2 _PERSONALPHOTO Y", | |
input_str.decode(encoding["encoding"]), | |
) | |
print("\n".join(matches)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment