0

I have decompiled a .exe compiled. I got a .pyz file and some other files:

enter image description here

Extracted them and got this:

enter image description here

How am I able to get the .py file from all those .pyc files?

Amir Shabani
  • 3,857
  • 6
  • 30
  • 67
  • Seems like a Reverse Engineering question, already has an answer in [Reverse Engineering Stack Beta](https://reverseengineering.stackexchange.com/a/1702) – Hamman Samuel May 28 '19 at 21:00

1 Answers1

0

You can decompile .pyc files yes - see these similar questions:

Is it possible to decompile a compiled .pyc file into a .py file?

https://reverseengineering.stackexchange.com/questions/1701/decompiling-pyc-files

The short of it is that you can use a tool to generate .py files from .pyc: https://github.com/rocky/python-uncompyle6/

Jay
  • 2,861
  • 3
  • 29
  • 51
  • That's for 1 pyc but how about all of them? btw getting this for 1 file http://prntscr.com/nulugs – Kristian Arroyo Tomas May 28 '19 at 20:39
  • You would run the tool against each bytecode file. The original source likely had a number of python modules in it, so your decompiled source will have at least one file for each module. Many commercial app distributors will take steps to prevent rebuilding the original source though, so you may not be able to parse the `.pyc` files you have. Check out the other answers linked for some more info. – Jay May 28 '19 at 20:41
  • So there's no way to get the source code? With Easy Python Decompiler im getting Invalid pyc/pyo file - Magic value mismatch! – Kristian Arroyo Tomas May 28 '19 at 20:53