Exe to python with pyinstaller?

25,582

You can extract the contents of the .exe file using PyInstaller Extractor. Run it like this:

python pyinstxtractor.py executable.exe

You will then get a bunch of files, including your original python file.

Share:
25,582
Mantas Kandratavičius
Author by

Mantas Kandratavičius

I'm a student looking to learn as much as I can, do mistakes, to fix them later and work with those who have the same goal.

Updated on July 23, 2022

Comments

  • Mantas Kandratavičius
    Mantas Kandratavičius almost 2 years

    So I made a huge mistake and deleted my code file (python). The only thing I have is my python file as .exe that I created with pyinstaller. Is there a way to reverse this and to extract my code file from .exe?

  • Mantas Kandratavičius
    Mantas Kandratavičius about 8 years
    That kinda worked, just the problem is now, that I dont have my original python file and the CMD says I can now use a python decompiler on pyc files. Where can I find one for python 3.x?
  • Zenadix
    Zenadix about 8 years
    Are you sure your source file wasn't extracted? In my case, it was there but without the .py extension.
  • Mantas Kandratavičius
    Mantas Kandratavičius about 8 years
    Oh god, I re-checked everything and I found it! While I'm still intrested if there are any 3.x pythong decompilers (because I was unable to find one myself) you still saved my life.
  • Zenadix
    Zenadix about 8 years
    I'm glad I could help! I honestly don't know much about pyc to py decompilers, but I think this question may be of help.
  • jis0324
    jis0324 over 3 years
    sorry, for my interrupt, actually, I extracted .exe using pyinstxtractor.py and I got extracted foler. So do you mean this folder include some *.py files? I hope you reply for me. Regards.
  • jis0324
    jis0324 over 3 years
    Hi, @Mantas Kandratavicius and Zenadix. Unfortunately, my extracted folder has no python files(.py files). Could you explain how I should do now? Regards!