Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Length of package more than 2147483647 bytes #61

Closed
kitcheng opened this issue Nov 24, 2022 · 4 comments
Closed

Length of package more than 2147483647 bytes #61

kitcheng opened this issue Nov 24, 2022 · 4 comments

Comments

@kitcheng
Copy link

kitcheng commented Nov 24, 2022

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
Copy link
Owner

Might be built with a modified pyinstaller.

@kitcheng
Copy link
Author

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
Copy link
Author

kitcheng commented Nov 30, 2022 via email

@lmcjrrg
Copy link

lmcjrrg commented Nov 30, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants