Rana
Rana

Reputation: 91

How can I decompile .pyc files from Python 3.10?

I did try uncompyle6, decompyle3, and others, but none of them worked with Python 3.10.

Is it even possible to do this right now?

Upvotes: 8

Views: 51309

Answers (5)

jbsidis
jbsidis

Reputation: 191

If we use ubuntu, open the Terminal:

sudo snap install pycdc #this helps to avoid the error: Command 'pycdc' not found when following MDKawsar's answer

Then tell the terminal where that python *.pyc script is:

pycdc /home/jbsidis/Downloads/scripts/assets/main.pyc

You will see the result

Upvotes: 1

thejtluv
thejtluv

Reputation: 9

It seems to get less reliable with time and additional Python releases. Decompiling is undesirable from a security standpoint, and expect Python devs will continue to try to prevent. Last I tried gave partial results with code missing (windows/cmake/msbuild method w/v3.10). I have not tried the pylingual.io option. It requires submitting your code up to their cloud service.

Upvotes: 0

kjee
kjee

Reputation: 427

Please try https://pylingual.io, which supports the latest Python versions (3.6 ~ 3.12). The service implements an open service that runs an NLP-based translation model + control flow analysis.

Upvotes: 3

MD Kawsar
MD Kawsar

Reputation: 437

Use pycdc. Github: https://github.com/zrax/pycdc

git clone https://github.com/zrax/pycdc
cd pycdc
cmake .
make
make check
pycdc C:\Users\Bobby\example.pyc

Upvotes: 21

Zbooby
Zbooby

Reputation: 49

on Windows (presume you have both Cmake and MSBuild.exe)

git clone https://github.com/zrax/pycdc
cd pycdc
cmake .
MSBuild.exe pycdc.vcxproj
cd pycdc/Debug
pycdc.exe yourfile.pyc

Upvotes: 3

Related Questions