Tool

decompyle3

Reworking of uncompyle6 by the same author that translates Python 3.7 and 3.8 bytecode, including some PyPy 3.7 and 3.8 bytecode, back into equivalent Python source; older bytecode stays with uncompyle6. It disassembles code objects with the companion xdis library, then tokenizes and parses the instruction stream with a refactored grammar into a tree from which source is printed, and it can decompile between given start and stop offsets or, through decompyle3-code, only a file's lambdas, generators and comprehensions. The README says the grammar rewrite does not by itself fix uncompyle6's control-flow problem, which the author is addressing with dominator-based analysis in a separate, non-public project.

Requirements & limits

  • Latest release at review: 3.9.3, published 2025-10-01 on GitHub and PyPI; the reviewed master commit, from 2026-07-21, is 18 commits later and reports 3.9.4.dev0. The README says the code runs on Python 3.7 or 3.8, whereas pyproject.toml requires Python 3.7+ with classifiers through 3.13, master CI tests under Python 3.13, and a separate python-3.7-to-3.10 branch is tested under 3.8; the 3.9.3 release also ships wheels and eggs for 3.7, 3.8 and 3.9. It depends on xdis newer than 6.2, spark-parser 1.8.9 up to but not including 1.9.2, and click; master CI installs xdis from its git repository until the next xdis release.
  • The README reports testing on bytecode from Python 3.7 and 3.8, and the regression suite keeps compiled 3.7 and 3.8 samples plus a few PyPy ones; the release notes state that bytecode newer than 3.8 is not decompiled. The author warns of numerous decompilation bugs and does not intend serious work on 3.8 or 3.9 until the project is better funded. Candidate-release magic numbers, PJOrion or otherwise obfuscated code, Cython and MicroPython are not handled, and pathologically long expression or statement lists are slow.
  • Input .pyc or .pyo files come from the user; it cannot decompile Py2EXE executables directly, and bytecode bundled by such packagers has to be extracted first. The README's --syntax-verify option appears in the reviewed CLI as --verify syntax, next to --verify run; a syntax check is meaningful only when the checking interpreter matches the bytecode version, so the README suggests cross-checking with another decompiler such as unpyc37 and with programs that test themselves, including Python's standard-library tests. Recovered source remains subject to the rights of the original program’s owner.
  • GPL-3.0-or-later per pyproject.toml, with the GPL-3.0 text in COPYING. Nothing was installed or decompiled, and the reviewed sources establish no REA connection.

About this entry

Type
Tool
Category
Native analysis tools
Relationship
Foundation tool
Targets
App · Binary

Sources reviewed

The description was reviewed against primary sources. This does not establish runtime testing, security auditing or verified compatibility.

Report an outdated entry Suggest a translation fix

Primary sources

  1. README.rst GitHub · rocky/python-decompile3 · Revision 0b97289
  2. NEWS.md GitHub · rocky/python-decompile3 · Revision 0b97289
  3. pyproject.toml GitHub · rocky/python-decompile3 · Revision 0b97289
  4. decompyle3/version.py GitHub · rocky/python-decompile3 · Revision 0b97289
  5. decompyle3/bin/decompile.py GitHub · rocky/python-decompile3 · Revision 0b97289
  6. decompyle3/bin/decompile_code_type.py GitHub · rocky/python-decompile3 · Revision 0b97289
  7. .github/workflows/ubuntu.yml GitHub · rocky/python-decompile3 · Revision 0b97289
  8. test GitHub · rocky/python-decompile3 · Revision 0b97289
  9. COPYING GitHub · rocky/python-decompile3 · Revision 0b97289
  10. https://github.com/rocky/python-decompile3/releases/tag/3.9.3
  11. https://pypi.org/project/decompyle3/3.9.3/

More in Native binaries

All 104 entries in Native binaries