PDA

View Full Version : Decompiling a python 2.4 file ?



Sacre
February 6th, 2006, 02:54 PM
Hello everyone,

Yesterday, I deleted by error a .py file instead of the associated .pyc file.

I've been looking for a decompiler to regenerate a .py file from the .pyc file, and I found "Decompyle" in Synaptic.

Anyway, this package is intended to work with python 2.3, but I coded my application in python 2.4

I tried to send a mail to "python.decompiler at gmail.com" after reading a message on the python's mailing list archive (http://news.hping.org/comp.lang.python.archive/14703.html), but I didn't receive any answer.

Finaly, the "dis" module give me an "assembly code" that I can analyze if I take time.

But, I'm really limited in time, I have to give my python work back Wednesday.

Does anyone know a solution to decompile my python file in comprehensive python code in fast time ?

Thank you for any answer.

Greg2
February 6th, 2006, 03:56 PM
But, I'm really limited in time, I have to give my python work back Wednesday.

Does anyone know a solution to decompile my python file in comprehensive python code in fast time ?
I’ve only been using (or rather trying to use) Python for about 1 month, so I won’t be of much assistance here. It would appear that the latest decompyle version only supports Python 2.3.3... but I suppose you already know that. If you have to have it by Wednesday and you have not found a solution... you could use this service:
http://www.crazy-compilers.com/decompyle/service.html
It’s not a free solution, but it is a solution. :neutral:

Sacre
February 6th, 2006, 05:52 PM
Finaly, I was able recreate my code from the pseudo-assembly generated by "dis" module in about 1h30

The application is small (about 200 lines of code including blank line to make it more readable), it is just an algorithm implementation exercice for school.

So it took less time that I expected, but I think it will be a really good idea for someone to create a new module that give back code from python 2.4 byte-code (by parsing "dis" output), just in case someone lost something bigger than my exercice.



you could use this service:
http://www.crazy-compilers.com/decompyle/service.html
It’s not a free solution, but it is a solution.

They use the decompyle package, and if I trust their website, they do it for Python 2.3 only

Thank you for answer anyway.