Tool:Pycdc
| Developer | Michael Hansen, Darryl Pogue and contributors |
|---|---|
| License | GPL-3.0 |
| Website | https://github.com/zrax/pycdc |
| On this wiki | Facts · Code · Notes · Topics |
Decompyle++ (pycdc, pycdas): a C++ GPL-3.0 Python bytecode decompiler and disassembler that aims to cover bytecode of any Python version.
Overview
Decompyle++ contains a disassembler (pycdas) and a decompiler (pycdc), both written in C++ and built with CMake. Its README states the goal of supporting byte-code from any version of Python; it lists no version table.
Usage
pycdas file.pyc prints the disassembly to stdout; pycdc file.pyc prints decompiled source to stdout and errors to stderr. Marshalled code objects (marshal.dumps(compile(...))) work with -c -v <version>, because such objects carry no version metadata.
Choosing it
See Technique:Choosing a decompiler. It is the usual first try when the interpreter version is newer than the Python 3.8 limit of the Python-based decompilers, and a native binary needs no Python environment.
Failure modes
In ASTree.cpp (commit b4289760970dbc399684f1e155ec6d1ea1cc787e) an opcode without a handler hits the default case (line 2696), which prints "Unsupported opcode: <NAME> (<n>)" to stderr, marks the build unclean and returns the nodes built so far; other messages include "Warning: Stack history is not empty!" (line 2708) and "Warning: block stack is not empty!" (line 2716). bytecode.cpp lines 38-41 declare opcode tables up to Python 3.13, and tests/compiled holds only a few 3.11 to 3.13 samples next to a tests/xfail directory of 39 known failing files. Unverified: how complete the output is for 3.11 and later on real programs. Its README documents no failure modes; always compare with pycdas output.
Sources
- README of https://github.com/zrax/pycdc (build options, usage, license).
Code & repositories
- https://github.com/zrax/pycdc @
b4289760970dbc399684f1e155ec6d1ea1cc787e· license: GPL-3.0
Decompyle++ pycdc/pycdas, C++ Python bytecode decompiler and disassembler
Tested on: source read, not run: not run; README read · checked 2026-10-18; last activity 2026-04-07