473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to decompile an exe file compiled by py2exe?

Dear All,

I lost my source code because of my incaution.
so anyone can tell me how to decompile the exe file compiled by py2exe?

Thanks.

--
Best Regards,
Leo Jay
Sep 24 '05 #1
4 9083
Leo Jay wrote:
Dear All,

I lost my source code because of my incaution.
so anyone can tell me how to decompile the exe file compiled by py2exe?

Thanks.

--
Best Regards,
Leo Jay


If you find a program that de-compiles exe to python, it will most
likely use very ugly, c-like python because a microchip is no python
interpreter. This is based on the assumption that py2exe really
generates a pure exe and not an exe that interprets bytecode python.
be that the case, it may yield decent results, but ugly nontheless.

It might better to re-write it...

Sep 24 '05 #2
Thomas Jollans wrote:
interpreter. This is based on the assumption that py2exe really
generates a pure exe and not an exe that interprets bytecode python.
be that the case, it may yield decent results, but ugly nontheless.


It is - py2exe embeds python bytecodes. It seems it does it in the
"library.zip" file (if I'm reading
http://starship.python.net/crew/theller/moin.cgi/Py2Exe correctly).
Bytecode files extracted should be decompilable to something resembling
original python code by a python decompiler (quick Googling finds
"decompyle": http://www.crazy-compilers.com/).
Sep 24 '05 #3
Leo Jay wrote:
Dear All,

I lost my source code because of my incaution.
so anyone can tell me how to decompile the exe file compiled by py2exe?

Thanks.

--
Best Regards,
Leo Jay

In older versions of py2exe (haven't tried it for new ones) I only had
to drag the py2exe created file to my zip archiever program window.
That somehow got the program to treat the py2exe application as a zip
archieve effectively decompressing it right there in the window of the
program. This enabled me to extract the files if I wish to do so to any
place I want.

This is also valid, I noted, for the binary distributions created for
windows by the distutils.

Sep 24 '05 #4
Last I looked, py2exe only kept the byte-compiiled versions of your
files, and not the raw source.

py2exe is just an archive, you can open it up in WinZip for example
and see your .pyc/pyo files.

That gets you part of the way there ... Then you would need to find a
way to "disassemble" the byte-code.

There's this:

http://docs.python.org/lib/module-dis.html

and

http://users.cs.cf.ac.uk/J.P.Giddy/p...ecompiler.html

for inspiration ...

Doesn't look easy though.

J.F.

Leo Jay wrote:
Dear All,

I lost my source code because of my incaution.
so anyone can tell me how to decompile the exe file compiled by py2exe?

Thanks.

--
Best Regards,
Leo Jay

Sep 24 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Indigo Moon Man | last post by:
The .dll file that py2exe creates to go with the program is huge even for a small program. Is there any way to possibly optomize the .dll file to make it smaller? -- Audio Bible Online:...
0
by: John Taylor | last post by:
I have a jython program which uses both .py and .class (also 2 other standalone .jar files). Is it possible to create a .exe file with py2exe? When I try I get this error message: warning:...
1
by: Ishwor | last post by:
Having coded 1.72kb python test file, i decided to convert it to .exe file using py2exe. Having succeded doing it, i found the need to distribute the whole directory including these files ?!!!???...
26
by: billiejoex | last post by:
Hi all. I'm sorry for a noob question like this but I'll try to ask it anyway. One of the greatest problem that may discourage a new user to choose Python language is it's interpreted nature....
3
by: SPE - Stani's Python Editor | last post by:
Hi, I'm creating a GUI program with wxPython which will be distributed for Mac and Windows. The audience of the program is not technical at all (eg they've never heard about Python yet ;-), so...
6
by: zdp | last post by:
Dear all: I made a window program by wxPython. Split windows, treectrl, listctrl and textctrl are used. When I program in python, the look & feel of the window controls are like the windos XP...
0
by: Karlo Lozovina | last post by:
I've just upgraded to Python 2.5, SQLAlchemy 0.3.3, and py2exe 0.6.5 (the py2.5 version, yes). Simple: --- import sqlalchemy print 'Test' ---
2
by: samar | last post by:
I have a C++ programme in MPI-environment which reads its Input from a file previously made by another C++ programme , but now I face a problem , the new programme can't read that data from the...
0
by: oyster | last post by:
you can try jungle ( http://www.suda-chen.biz/?page_id=21 ) also
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.