Skip to content

Commit 044812c

Browse files
Merge pull request #70 from maximevince/master
Do not abort after the first extraction error
2 parents 128cb96 + c19cdbb commit 044812c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pyinstxtractor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,11 @@ def extractFiles(self):
279279
data = self.fPtr.read(entry.cmprsdDataSize)
280280

281281
if entry.cmprsFlag == 1:
282-
data = zlib.decompress(data)
282+
try:
283+
data = zlib.decompress(data)
284+
except zlib.error:
285+
print('[!] Error : Failed to decompress {0}'.format(entry.name))
286+
continue
283287
# Malware may tamper with the uncompressed size
284288
# Comment out the assertion in such a case
285289
assert len(data) == entry.uncmprsdDataSize # Sanity Check

0 commit comments

Comments
 (0)