A simple script to unpack and deobfuscate Python files. It automatically extracts data from exec() blocks, strips security layers, and restores the source code.
The script strips encoding and compression layers step by step:
Reverse β Base64 β Zlib β LZMA β Gzip β Marshal
To restore full source code, install the decompiler:
pip install uncompyle6If this library is missing, the script will output Python bytecode using the dis module instead.
-
Print result to terminal:
python decompiler.py obfuscated.py
-
Save clean code to a file:
python decompiler.py obfuscated.py -o clean.py
inputβ Path to the protected file.-o,--outputβ Path to save the decoded file (optional).