1

need help with something...

I had this python program which i made. The thing is, i need the source of it, but the thing is, the hdd i had with it is dead , and when i tried to lookup any backups, it wasn't there.

The only thing i have the binary, which i think, was compiled in cx_Freeze. I'm really desperate about it, and i tried any avialble ways to do it, and there was none or almost little.

Is there a way to ''unfreeze'' the executable or at least get the pyc out of it?

  • 1
    The .pyc files should be inside a `library.zip` file. If that's not there, look for other zip files, and if there are none, try opening the exe with an unzip tool. Once you've got them, the [meta](https://pypi.python.org/pypi/meta) package includes a `depyc` script to convert pyc files back to py. – Thomas K Jun 30 '14 at 17:00

1 Answers1

0

No, it is not possible to recover the original source code.

If the application used CPython, though, it is always possible to recover the CPython bytecode, which you can use a disassembler on to make a reconstruction of the Python code, but a lot of information will be lost; the resulting code will look rather unreadable and obfuscated, depending on the degree to which the bytecode was optimised.

If you want to go down that path, though, I advise looking into CPython's "dis" module. There are also numerous other utilities available that can reconstruct Python code from CPython bytecode.

rdb
  • 1,488
  • 1
  • 14
  • 24