简体   繁体   中英

Decompiling .pyc files extracted from exe file created with PyInstall

My question is how decompile .pyc file to python code. In first place I had exe file, i extracted .pyz file from it. From .pyz file i extracted .pyc files with this http://www.pyinstaller.org/browser/project/PyInstaller/cliutils/archive_viewer.py

However when i try to decompile .pyc files I receive erro that magic number is invalid. I looked it up, and its 63 (hex) and 99 in decimal. I guess Pyinstaller makes some changes to pyc files, my question is how to decompile this .pyc file.

I have created some tools which will help in dealing with pyinstaller. There are many ways you can go.

If you just want to extract the exe to get all the embedded files, including the ones inside the pyz use this script. Afterwards use Easy Python Decompiler to decompile the pyc files.

If you want to dig deeper and recompile the exe then use Pyinstaller exe rebuilder tool.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM