Open pyc compiled under normal conditions and pyc files extracted from pyinstaller respectively for comparison: Use a text editor that supports hexadecimal editing to find out. The following error will be reported: ImportError: Unknown magic number 227 in auto_organize_gui.exe_extracted\auto_organize_gui.pyc ![]() If you decompile directly, for example, run uncompyle6 auto_organize_gui.exe_extracted/auto_organize_gui.pyc The 16 byte magic and timestamp of the entry running class are removed. The pyc file extracted from pyinstaller cannot be decompiled directly. ? Run the decompilation of the entry pyc file Therefore, we need to manually modify the suffix of the extracted content: Pyo) will be reported when decompiled with uncompyle6. pyc file into a python script:įrom the compilation results, the comments are also retained:įor files that do not end with the pyc suffix, an error of must point to a python source that can be compiled, or Python bytecode (. Uncompyle6 auto_>auto_organize.pyĪfter execution, directly decompile the. Take the cache generated in the previous encoding process as an example: Uncompyle6 can decompile files ending in. However, we can directly use the uncompyle6 library for decoding, and use pip to directly install: There are many websites that decrypt pyc files, such as: So I only use the pyinstxtracker.py script to extract the pyc file later. In case of sub modules, it needs to perform an open operation. Obviously, using PyInstaller's PYI Archive_ The viewer tool is cumbersome to operate. To extract other imported pyc files, you need to open PYZ-00.pyz first: You can then extract the files specified to be extracted: It can directly extract the pyc file in the package result exe.įor details, please refer to the official documents:Įxecute PYI Archive_ Viewer to view the file structure inside exe: Pyi-archive_viewer is a tool provided by PyInstaller. ? pyi-archive_ The viewer tool extracts pyc files The file structure extracted from the exe generated by the two packaging methods is slightly different: Python pyinstxtractor.py auto_organize_gui.exeĪfter execution, you get the exe file name plus_ Folder with extracted suffix: Then enter cmd in the directory where exe is located to execute: The pyinstxtracker.py script can be found in the github project python-exe-unpacker Download from, address:Īfter downloading the project, copy the pyinstxtracker.py script file to a directory at the same level as exe. ? The pyinstxtracker.py script extracts the pyc file
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |