Python
Decompilers allow you to recover source-like representations from compiled code such as Python bytecode or PyInstaller executables.
| Purpose |
Command / Tool |
Decompile Python .pyc |
uncompyle6 file.pyc, pycdc file.pyc |
| Extract PyInstaller executables |
python pyinstxtractor.py target.exe |
Decompile MicroPython .mpy files |
mpy-tool -d file.mpy |
| Tool |
Platform |
Purpose |
| uncompyle6 |
Python ≤ 3.8 |
Decompile .pyc bytecode |
| Decompyle++ |
Python ≥ 3.9 |
Alternative modern Python decompiler |
| pyinstxtractor |
Python EXE |
Decompile PyInstaller executables |
| pycdc |
Python |
C++ Decompiler for Python 2.x and 3.x |
| mpy-tool |
MicroPython |
Decompile MicroPython .mpy files |
- Some CTFs hide flags in string constants or hardcoded URLs visible only after decompilation.
- When decompiling Python bytecode, pay attention to the Python version used, as it affects compatibility with decompilers.