extremecoders-re / pyinstxtractor

PyInstaller Extractor
GNU General Public License v3.0
2.93k stars 612 forks source link

Length of package more than 2147483647 bytes #61

Closed kitcheng closed 1 year ago

kitcheng commented 1 year ago

Change:

struct.unpack('!8siiii64s', self.fPtr.read(self.PYINST21_COOKIE_SIZE))

To:

struct.unpack('!8sIIII64s', self.fPtr.read(self.PYINST21_COOKIE_SIZE))

Will solve this error:

[+] Pyinstaller version: 2.1+ [+] Python version: 3.7 -2089571957 [+] Length of package: -2089571957 bytes [+] Found 4480 files in CArchive [+] Beginning extraction...please standby Traceback (most recent call last): File "pyinstxtractor.py", line 456, in main() File "pyinstxtractor.py", line 445, in main arch.extractFiles() File "pyinstxtractor.py", line 279, in extractFiles data = zlib.decompress(data) zlib.error: Error -5 while decompressing data: incomplete or truncated stream

And these place, change to unsign int

nameLen = struct.calcsize('!IIIIBc')

(entryPos, cmprsdDataSize, uncmprsdDataSize, cmprsFlag, typeCmprsData, name) = \ struct.unpack( \ '!IIIBc{0}s'.format(entrySize - nameLen), \ self.fPtr.read(entrySize - 4))

extremecoders-re commented 1 year ago

Might be built with a modified pyinstaller.

kitcheng commented 1 year ago

nameLen = struct.calcsize('!IIIIBc')

(entryPos, cmprsdDataSize, uncmprsdDataSize, cmprsFlag, typeCmprsData, name) = struct.unpack( '!IIIBc{0}s'.format(entrySize - nameLen), self.fPtr.read(entrySize - 4))

As I wrote, change signed integer in the code to unsigned integer will solve this bug. Search: struct.unpack('!8siiii64s', self.fPtr.read(self.PYINST21_COOKIE_SIZE))Replace: struct.unpack('!8sIIII64s', self.fPtr.read(self.PYINST21_COOKIE_SIZE)) iiii to IIII , signed integer to unsigned integer.

search and replace these code also:  nameLen = struct.calcsize('!IIIIBc')(entryPos, cmprsdDataSize, uncmprsdDataSize, cmprsFlag, typeCmprsData, name) = struct.unpack( '!IIIBc{0}s'.format(entrySize - nameLen), self.fPtr.read(entrySize - 4)) lmcjrrg notifications@github.com 于2022年11月28日周一 17:29写道: I also encountered this problem, local pyinstaller=5.6[+] Processing start_program.exe [+] Pyinstaller version: 2.1+ [+] Python version: 3.10 [+] Length of package: -1928081237 bytes [+] Found 10364 files in CArchive [+] Beginning extraction...please standby Traceback (most recent call last): File "E:\workFile\windows_final_file\dist\pyinstxtractor.py", line 454, in main() File "E:\workFile\windows_final_file\dist\pyinstxtractor.py", line 443, in main arch.extractFiles() File "E:\workFile\windows_final_file\dist\pyinstxtractor.py", line 277, in extractFiles data = zlib.decompress(data) zlib.error: Error -5 while decompressing data: incomplete or truncated stream— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

kitcheng commented 1 year ago

As I wrote, change signed integer in the code to unsigned integer will solve this bug.

Search: struct.unpack('!8siiii64s', self.fPtr.read(self.PYINST21_COOKIE_SIZE)) Replace: struct.unpack('!8sIIII64s', self.fPtr.read(self.PYINST21_COOKIE_SIZE))

iiii to IIII , signed integer to unsigned integer.

search and replace these code also:

nameLen = struct.calcsize('!IIIIBc')

(entryPos, cmprsdDataSize, uncmprsdDataSize, cmprsFlag, typeCmprsData, name) = struct.unpack( '!IIIBc{0}s'.format(entrySize - nameLen), self.fPtr.read(entrySize - 4))

lmcjrrg @.***> 于2022年11月28日周一 17:29写道:

I also encountered this problem, local pyinstaller=5.6

[+] Processing start_program.exe [+] Pyinstaller version: 2.1+ [+] Python version: 3.10 [+] Length of package: -1928081237 bytes [+] Found 10364 files in CArchive [+] Beginning extraction...please standby Traceback (most recent call last): File "E:\workFile\windows_final_file\dist\pyinstxtractor.py", line 454, in main() File "E:\workFile\windows_final_file\dist\pyinstxtractor.py", line 443, in main arch.extractFiles() File "E:\workFile\windows_final_file\dist\pyinstxtractor.py", line 277, in extractFiles data = zlib.decompress(data) zlib.error: Error -5 while decompressing data: incomplete or truncated stream

— Reply to this email directly, view it on GitHub https://github.com/extremecoders-re/pyinstxtractor/issues/61#issuecomment-1328778620, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACPUJIRKVL3C75IOFMS4E3WKR3QPANCNFSM6AAAAAASKEIXLQ . You are receiving this because you authored the thread.Message ID: @.***>

lmcjrrg commented 1 year ago

As I wrote, change signed integer in the code to unsigned integer will solve this bug. Search: struct.unpack('!8siiii64s', self.fPtr.read(self.PYINST21_COOKIE_SIZE)) Replace: struct.unpack('!8sIIII64s', self.fPtr.read(self.PYINST21_COOKIE_SIZE)) iiii to IIII , signed integer to unsigned integer. search and replace these code also: nameLen = struct.calcsize('!IIIIBc') (entryPos, cmprsdDataSize, uncmprsdDataSize, cmprsFlag, typeCmprsData, name) = struct.unpack( '!IIIBc{0}s'.format(entrySize - nameLen), self.fPtr.read(entrySize - 4)) lmcjrrg @.> 于2022年11月28日周一 17:29写道: I also encountered this problem, local pyinstaller=5.6 [+] Processing start_program.exe [+] Pyinstaller version: 2.1+ [+] Python version: 3.10 [+] Length of package: -1928081237 bytes [+] Found 10364 files in CArchive [+] Beginning extraction...please standby Traceback (most recent call last): File "E:\workFile\windows_final_file\dist\pyinstxtractor.py", line 454, in main() File "E:\workFile\windows_final_file\dist\pyinstxtractor.py", line 443, in main arch.extractFiles() File "E:\workFile\windows_final_file\dist\pyinstxtractor.py", line 277, in extractFiles data = zlib.decompress(data) zlib.error: Error -5 while decompressing data: incomplete or truncated stream — Reply to this email directly, view it on GitHub <#61 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACPUJIRKVL3C75IOFMS4E3WKR3QPANCNFSM6AAAAAASKEIXLQ . You are receiving this because you authored the thread.Message ID: @.>

Thank you. I have solved the problem according to your method. It's great