Skip to content
All tools
ReversingRuns locallyNo account

Python .pyc bytecode disassembler

Disassemble compiled Python, read code objects and constants, and recover logic from a .pyc without running it.

Open in ctfpal

Compiled Python is barely compiled. A .pyc holds a code object with the constants, variable names, and a linear instruction listing - enough that reading the disassembly is usually faster than finding a decompiler that supports the exact version.

The constants tuple is the shortcut

co_consts holds every literal in the function, including nested code objects for inner functions. For a challenge that compares your input against a stored value, that value is sitting in the constants. For one that builds the flag by arithmetic, the operands are there and the operations are readable.

For a PyInstaller executable, extract the archive first: the .pyc files are bundled inside, and the entry point script is the one named after the original program.

Related tools