Merge pull request #70 from maximevince/master

Do not abort after the first extraction error
This commit is contained in:
extremecoders-re
2023-06-30 13:14:10 +05:30
committed by GitHub

View File

@@ -279,7 +279,11 @@ class PyInstArchive:
data = self.fPtr.read(entry.cmprsdDataSize) data = self.fPtr.read(entry.cmprsdDataSize)
if entry.cmprsFlag == 1: if entry.cmprsFlag == 1:
try:
data = zlib.decompress(data) data = zlib.decompress(data)
except zlib.error:
print('[!] Error : Failed to decompress {0}'.format(entry.name))
continue
# Malware may tamper with the uncompressed size # Malware may tamper with the uncompressed size
# Comment out the assertion in such a case # Comment out the assertion in such a case
assert len(data) == entry.uncmprsdDataSize # Sanity Check assert len(data) == entry.uncmprsdDataSize # Sanity Check