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

Invalid argument exception extracting package generated with Python 2.2 #12

Open
LukeUsher opened this issue May 21, 2024 · 3 comments
Open

Comments

@LukeUsher
Copy link

I have been tasked with making changes to a legacy product that we no longer have source code for; the application was developed with Python2.2 and packaged with pyinstaller.

pyinstxtractor-ng identifies the package as being built with Pyinstaller 2.0/Python2.2, but the extraction of the archive fails with an exception when attempting to locate the TOC; could it be an unsupported format?

[+] Processing app.exe
[+] Pyinstaller version: 2.0
[+] Python version: 2.2
[+] Length of package: 978984 bytes
[+] Found 6 files in CArchive
[+] Beginning extraction...please standby
Traceback (most recent call last):
  File "pyinstxtractor-ng.py", line 527, in <module>
  File "pyinstxtractor-ng.py", line 509, in main
  File "pyinstxtractor-ng.py", line 328, in extractFiles
  File "pyinstxtractor-ng.py", line 421, in _extractPyz
OSError: [Errno 22] Invalid argument

image

@LukeUsher
Copy link
Author

update: it looks like this version of pyinstall is using native byte order for the toc location; simply removing the ! operator resolved it for me; I'll keep the issue open because this ideally could be fixed upstream, but I was able to continue my work with this hack.

@extremecoders-re
Copy link
Member

extremecoders-re commented May 22, 2024

Thanks for the report.

Going through PyInstaller sources, v1.3 released in 2006 or maybe 2005 was the last version to use native byte order before switching to network byte order aka big endian.

This is from v1.3:
https://github.com/pyinstaller/pyinstaller/blob/92c9ab155ac51ca6607a1ddf2cd2d068da2ba4a5/archive.py#L122

Going to keep this issue open for now.

@FaxHack
Copy link

FaxHack commented Sep 4, 2024

How do i fix this?

[+] Processing ULTAK.exe
[!] Error: Missing cookie, unsupported pyinstaller version or not a pyinstaller archive

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

No branches or pull requests

3 participants