pyinstxtractor icon indicating copy to clipboard operation
pyinstxtractor copied to clipboard

PyInstaller versions prior to 3.2 do not pre-compile ARCHIVE_ITEM_PYSOURCE

Open ncaklovic opened this issue 3 years ago • 1 comments

Under the same typeCmprsData ('s') PyInstaller versions prior to 3.2 store Python source files (see issue 1847). They shouldn't be prefixed with pyc header.

I didn't (yet) find any way to detect if 's' file is compiled or not (PyInstaller version is unknown from file) - other than reading the first byte to check if it is marshalled code object ('c').

ncaklovic avatar May 11 '22 09:05 ncaklovic

That's correct. Old versions of pyinstaller store the code as-is. As there doesn't seem to have a definite way to find the exact version of PyInstaller, one workaround can be to use some heuristics to differentiate between text vs binary data and save as a .pyc or .py accordingly.

Also pyinstaller 3.2 was released back in 2016. Maybe we can keep the current code and save as .pyc with a warning when finding files of type ARCHIVE_ITEM_PYSOURCE.

extremecoders-re avatar May 11 '22 10:05 extremecoders-re