Skip to content

Commit

Permalink
Do not abort after the first extraction error; continue with the next…
Browse files Browse the repository at this point in the history
… file instead
  • Loading branch information
maximevince committed Jun 30, 2023
1 parent 128cb96 commit c19cdbb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyinstxtractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ def extractFiles(self):
data = self.fPtr.read(entry.cmprsdDataSize)

if entry.cmprsFlag == 1:
data = zlib.decompress(data)
try:
data = zlib.decompress(data)
except zlib.error:
print('[!] Error : Failed to decompress {0}'.format(entry.name))
continue
# Malware may tamper with the uncompressed size
# Comment out the assertion in such a case
assert len(data) == entry.uncmprsdDataSize # Sanity Check
Expand Down

0 comments on commit c19cdbb

Please sign in to comment.