C++ python bytecode disassembler and decompiler
  • C++ 84.5%
  • Python 14.9%
  • CMake 0.5%
Find a file
2015-10-01 16:06:09 -07:00
bytes Add Python 3.5 disassembly support 2015-10-01 16:06:09 -07:00
tests Add support for LOAD_BUILD_CLASS op-code 2015-04-20 17:38:36 -04:00
.gitignore Switch build system to CMake 2014-06-10 19:20:56 -07:00
ASTNode.cpp Support for with statement. 2012-06-06 22:02:33 -07:00
ASTNode.h Add support for LOAD_BUILD_CLASS op-code 2015-04-20 17:38:36 -04:00
ASTree.cpp Fix SEGFAULT due to defblock being changed. 2015-08-16 14:34:54 +03:00
ASTree.h Fixed imports, and restructured ifs to be "code blocks" 2010-09-07 21:32:34 -07:00
bytecode.cpp Add Python 3.5 disassembly support 2015-10-01 16:06:09 -07:00
bytecode.h Add Python 3.5 disassembly support 2015-10-01 16:06:09 -07:00
CMakeLists.txt Add Python 3.5 disassembly support 2015-10-01 16:06:09 -07:00
data.cpp Fixes for large operands (> 0x7fff). Closes #34 2013-08-06 22:16:28 -07:00
data.h Allow for output file override 2011-10-23 19:04:06 -07:00
FastStack.h Slightly more consistent formatting 2011-09-18 23:55:27 -07:00
LICENSE Added GPL v3 license file 2009-07-25 00:43:46 +00:00
pyc_code.cpp Make version comparisons human readable 2012-05-26 14:10:12 -07:00
pyc_code.h Add Python 3.5 disassembly support 2015-10-01 16:06:09 -07:00
pyc_module.cpp Add Python 3.5 disassembly support 2015-10-01 16:06:09 -07:00
pyc_module.h Add Python 3.5 disassembly support 2015-10-01 16:06:09 -07:00
pyc_numeric.cpp Minor style cleanup 2014-06-10 18:28:28 -07:00
pyc_numeric.h Alternative solution using union 2014-06-05 15:11:06 +11:00
pyc_object.cpp Support new marshal types from Python 3.4 2014-01-21 00:42:37 -08:00
pyc_object.h Support new marshal types from Python 3.4 2014-01-21 00:42:37 -08:00
pyc_sequence.cpp Support new marshal types from Python 3.4 2014-01-21 00:42:37 -08:00
pyc_sequence.h Use less conflicting filenames 2011-10-23 17:48:10 -07:00
pyc_string.cpp Minor style cleanup 2014-06-10 18:28:28 -07:00
pyc_string.h Minor style cleanup 2014-06-10 18:28:28 -07:00
pycdas.cpp Add Python 3.5 disassembly support 2015-10-01 16:06:09 -07:00
pycdc.cpp Fix a couple of string output issues 2011-10-23 19:37:06 -07:00
pycdc_test.sh Don't print an error if 'tests' directory already exists 2015-04-17 18:45:05 -07:00
PythonBytecode.txt Add Python 3.5 disassembly support 2015-10-01 16:06:09 -07:00
README.markdown Fix #51 by adding more precise build instructions 2014-12-03 18:07:27 -08:00

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.