C++ python bytecode disassembler and decompiler
C++ Python Shell CMake
Permalink
Failed to load latest commit information.
bytes Initial support for Python 3.6 disassembly Jun 23, 2016
tests Add python 2.5 reference sources Sep 8, 2016
.gitignore Switch build system to CMake Jun 11, 2014
ASTNode.cpp Support @ operator Oct 2, 2015
ASTNode.h Help convince clang that 'this' can be NULL in some cases. Closes #65 Oct 3, 2015
ASTree.cpp Handle NOP instruction in decompyle (fixes #96) Oct 24, 2016
ASTree.h Fixed imports, and restructured ifs to be "code blocks" Sep 8, 2010
CMakeLists.txt Add more advanced round-trip test target that runs decompiled output … Aug 31, 2016
FastStack.h Slightly more consistent formatting Sep 19, 2011
LICENSE Added GPL v3 license file Jul 25, 2009
PythonBytecode.txt Update Python 3.6 magic from RC build Dec 14, 2016
README.markdown Fix #51 by adding more precise build instructions Dec 4, 2014
bytecode.cpp Update bytecode for Python 3.6 beta3, and use a common file for opcod… Nov 9, 2016
bytecode.h Update bytecode for Python 3.6 beta3, and use a common file for opcod… Nov 9, 2016
bytecode_ops.inl Update bytecode for Python 3.6 beta3, and use a common file for opcod… Nov 9, 2016
data.cpp Fixes for large operands (> 0x7fff). Closes #34 Aug 7, 2013
data.h Allow for output file override Oct 24, 2011
pyc_code.cpp Make version comparisons human readable May 26, 2012
pyc_code.h Fix display of cell vars Sep 8, 2016
pyc_module.cpp Initial support for Python 3.6 disassembly Jun 23, 2016
pyc_module.h Update Python 3.6 magic from RC build Dec 14, 2016
pyc_numeric.cpp Minor style cleanup Jun 11, 2014
pyc_numeric.h Alternative solution using union Jun 5, 2014
pyc_object.cpp Support new marshal types from Python 3.4 Jan 21, 2014
pyc_object.h Help convince clang that 'this' can be NULL in some cases. Closes #65 Oct 3, 2015
pyc_sequence.cpp Support new marshal types from Python 3.4 Jan 21, 2014
pyc_sequence.h Use less conflicting filenames Oct 24, 2011
pyc_string.cpp Fix formatting of char literals \x00-\x0F. Aug 31, 2016
pyc_string.h Minor style cleanup Jun 11, 2014
pycdas.cpp Display KW only arg count in pycdas output Sep 3, 2016
pycdc.cpp Fix a couple of string output issues Oct 24, 2011
pycdc_rt_test.sh Use .src.py extension instead of .src for pycdc test output Aug 31, 2016
pycdc_test.sh Use .src.py extension instead of .src for pycdc test output Aug 31, 2016

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.