2

Possible Duplicate:
Can EXE generated by cx_freeze be completely decompiled back to readable Python code?

I've used cx-freeze to convert a python script to an executable. Is it possible to reverse that? Can I get my python script from the binary cx-freeze has generated?

EDIT. This is a practical question. I really need to recover one cx-freezed executable to a more-less readable form. Does anyone have a recipie of doing it?

Community
  • 1
  • 1
facha
  • 11,862
  • 14
  • 59
  • 82

1 Answers1

2

Any 'frozen' PY application can be disassembled but not really decompiled. With enough time and patience someone would be able to reverse-engineer nearly any program (including yours).

Edit Correction as per comments below.

PenguinCoder
  • 4,335
  • 1
  • 26
  • 37
  • 1
    "can not be really decompiled" -- `[citation needed]` –  Feb 21 '12 at 15:56
  • 1
    Can one recover the python bytecode from the cx-freezed binary? If so, then I'd try to use this tool: https://github.com/gstarnberger/uncompyle, which claims to be able to restore code by reading the bytecode. – facha Feb 21 '12 at 15:58
  • 2
    Yes, python bytecode can be recovered from the frozen exe. This is disassembling NOT decompiling. Can you then return that bytecode to a readable format? Yes. Will it be the original source code? No. – PenguinCoder Feb 21 '12 at 16:01
  • Does anyone know how to do that? – facha Feb 21 '12 at 16:21
  • @facha Does anyone know how to do what? Turn python bytecode to human readable format? Yes. If you're looking to 'secure' Python code, cx_freeze will not help you from a user who knows how to work around it. – PenguinCoder Feb 21 '12 at 16:24
  • 1
    @facha: The Python bytecode is stored in a zip file. Depending on how you've frozen it, that might be a separate file with the executable, or it might be appended to the executable. If you can't see a zip file, try unzipping the executable itself. – Thomas K Feb 22 '12 at 12:46