Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to decompile an exe file compiled by py2exe?

Tags:

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?

like image 669
toontong Avatar asked Jun 09 '11 03:06

toontong


People also ask

Can you decompile an exe?

The decompiler supports multiple formats including libraries (. dll), executables (.exe), and Windows metadata files (. winmd).

Can we extract Python code from EXE file?

This .exe file contains the Python bytecode of the program, a Python interpreter and all the necessary modules. The bytecode is stored as a resource inside the .exe file. unpy2exe will extract the Python bytecode as a pyc file from the .exe file, which can then be decompiled with uncompyle6.


1 Answers

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\

like image 87
guggenn Avatar answered Sep 21 '22 10:09

guggenn