Skip to content
C++ python bytecode disassembler and decompiler
C++ Python Shell CMake
Branch: master
Clone or download
zrax Add bytecode and disassembly support for Python 3.8.
Also fixes running pymultic from outside of its source directory.
Latest commit 428d11c Feb 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
bytes
scripts Add bytecode and disassembly support for Python 3.8. Oct 14, 2019
tests Unmangle private names ('__' prefix) in class declarations. Oct 10, 2019
.gitignore Switch build system to CMake Jun 11, 2014
ASTNode.cpp Fix non-inplace matrix multiplication operator. Oct 10, 2019
ASTNode.h Fix non-inplace matrix multiplication operator. Oct 10, 2019
ASTree.cpp Unmangle private names ('__' prefix) in class declarations. Oct 10, 2019
ASTree.h Fixed imports, and restructured ifs to be "code blocks" Sep 8, 2010
CMakeLists.txt
FastStack.h Modernize and simplify FastStack with a vector. Oct 9, 2019
LICENSE Added GPL v3 license file Jul 25, 2009
PythonBytecode.txt Add bytecode and disassembly support for Python 3.8. Oct 14, 2019
README.markdown Fix #51 by adding more precise build instructions Dec 4, 2014
bytecode.cpp Add bytecode and disassembly support for Python 3.8. Oct 14, 2019
bytecode.h Update bytecode for Python 3.6 beta3, and use a common file for opcod… Nov 9, 2016
bytecode_ops.inl Add bytecode and disassembly support for Python 3.8. Oct 14, 2019
data.cpp Fix several undefined behavior issues identified by @nrathaus. Jan 28, 2018
data.h Start requring C++11 with explicit virtual overrides. Oct 2, 2019
pyc_code.cpp Add bytecode and disassembly support for Python 3.8. Oct 14, 2019
pyc_code.h Add bytecode and disassembly support for Python 3.8. Oct 14, 2019
pyc_module.cpp
pyc_module.h Add bytecode and disassembly support for Python 3.8. Oct 14, 2019
pyc_numeric.cpp
pyc_numeric.h Use std::string instead of manual character buffers where applicable. Oct 2, 2019
pyc_object.cpp Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
pyc_object.h
pyc_sequence.cpp Remove unnecessary complexity and just use the base sequence type common Apr 28, 2018
pyc_sequence.h
pyc_string.cpp Use std::string instead of manual character buffers where applicable. Oct 2, 2019
pyc_string.h
pycdas.cpp
pycdc.cpp

README.markdown

Decompyle++

A Python Byte-code Disassembler/Decompiler

Decompyle++ aims to translate compiled Python byte-code back into valid and human-readable Python source code. While other projects have achieved this with varied success, Decompyle++ is unique in that it seeks to support byte-code from any version of Python.

Decompyle++ includes both a byte-code disassembler (pycdas) and a decompiler (pycdc).

As the name implies, Decompyle++ is written in C++. If you wish to contribute, please fork us on github at https://github.com/zrax/pycdc

Building Decompyle++

  • Generate a project or makefile with CMake (See CMake's documentation for details)
  • Build the generated project or makefile
    • For projects (e.g. MSVC), open the generated project file and build it
    • For makefiles, just run make
    • To run tests (on *nix or MSYS), run make test

Usage

To run pycdas, the PYC Disassembler: ./pycdas [PATH TO PYC FILE] The byte-code disassembly is printed to stdout.

To run pycdc, the PYC Decompiler: ./pycdc [PATH TO PYC FILE] The decompiled Python source is printed to stdout. Any errors are printed to stderr.

Authors, Licence, Credits

Decompyle++ is the work of Michael Hansen and Darryl Pogue.

Additional contributions from:

  • charlietang98
  • Kunal Parmar
  • Olivier Iffrig
  • Zlodiy

It is released under the terms of the GNU General Public License, version 3; See LICENSE file for details.

You can’t perform that action at this time.