Do not abort after the first extraction error; continue with the next file instead

This commit is contained in:
Maxime Vincent 2023-06-30 08:51:02 +02:00
commit c19cdbb30f
No known key found for this signature in database
GPG key ID: B5A70D71BAF4CC04

View file

@ -279,7 +279,11 @@ class PyInstArchive:
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