How to decompile an exe file compiled by py2exe?

toontong picture toontong · Jun 9, 2011 · Viewed 70.4k times · Source

How to decompile an exe file compiled by py2exe?

just one exe file, didn'n have any zip file.

how to decompile to pyc or pyo file?

Answer

guggenn picture guggenn · Nov 16, 2013

You can use unpy2exe to extract the .pyc and then use pyREtic to get the source code. I guess you can read the HOWTO and understand how to use these programs, but basically you go to the location of unpy2exe.py and run:

unpy2exe.py [-h] [-o OUTPUT_DIR] [-p PYTHON_VERSION] filename

thene go to the location of REpdb.py and run:

REpdb.py

set_project [new project name]

Select the python version

fs_um_decompile [location of pyc file]

The source should be in ...\Projects[new project name]\sourcecode\fs_um\