0

New to Python. Don't know where to start on how to extract the code from a .exe file. Can't find the original source code.

I've tried piecing together some of the source code but don't have all of the files needed. Trying to see if I can extract the original code from the .exe file

Dion H
  • 1
  • 1
  • any particular project? the source may be available in a more convenient form from the developers – ti7 Jul 24 '23 at 21:49
  • It's easier to extract the bytecode and disassemble it. Decompiling all the way back to source depends on tools that are only available for older interpreter versions. – Charles Duffy Jul 24 '23 at 21:49
  • 1
    That said, there's a lot more work to do here before you have an on topic question. You need to figure out which interpreter version, whether it was packaged with pyinstaller vs freeze vs cx_freeze vs py2exe etc etc etc. None of them are _hard_ exactly -- a competent reverse engineer can get your bytecode out of any of them -- but details matter. – Charles Duffy Jul 24 '23 at 21:51
  • 1
    @codename47 Check your link; it's currently broken. (Assuming you meant https://stackoverflow.com/questions/6287918/how-to-decompile-an-exe-file-compiled-by-py2exe) – Charles Duffy Jul 24 '23 at 21:54
  • @DionH ...and temper your expectations about "original source". Even if this is a bytecode version that there are decompilers for, don't expect code comments or exact formatting. – Charles Duffy Jul 24 '23 at 21:56
  • I think pyinstaller was used. Can't say with 100% certainty. The previous developer didn't leave any documentation on the development of this project. – Dion H Jul 31 '23 at 14:57

0 Answers0