C++ python bytecode disassembler and decompiler
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
bytes Fix bytecode compatibility with Python 3.7 beta3 Apr 26, 2018
scripts Better name for this script, since it doesn't do anything in parallel. Apr 28, 2018
tests Add some scripts for fetching/building many Python versions and compi… Apr 27, 2018
.gitignore Switch build system to CMake Jun 11, 2014
ASTNode.cpp Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
ASTNode.h Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
ASTree.cpp Fix several undefined behavior issues identified by @nrathaus. Jan 28, 2018
ASTree.h Fixed imports, and restructured ifs to be "code blocks" Sep 8, 2010
CMakeLists.txt Add initial 3.7 alpha support, and fix 3.6 opcode map Dec 20, 2017
FastStack.h Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
LICENSE Added GPL v3 license file Jul 25, 2009
PythonBytecode.txt Update magic for 3.7.0 release Jul 2, 2018
README.markdown Fix #51 by adding more precise build instructions Dec 4, 2014
bytecode.cpp Use fputs instead of fprintf when no formatting is required Jan 28, 2018
bytecode.h Update bytecode for Python 3.6 beta3, and use a common file for opcod… Nov 9, 2016
bytecode_ops.inl Add initial 3.7 alpha support, and fix 3.6 opcode map Dec 20, 2017
data.cpp Fix several undefined behavior issues identified by @nrathaus. Jan 28, 2018
data.h Allow for output file override Oct 24, 2011
pyc_code.cpp Remove unnecessary complexity and just use the base sequence type common Apr 28, 2018
pyc_code.h Fix several undefined behavior issues identified by @nrathaus. Jan 28, 2018
pyc_module.cpp Fix bytecode compatibility with Python 3.7 beta3 Apr 26, 2018
pyc_module.h Update magic for 3.7.0 release Jul 2, 2018
pyc_numeric.cpp Fix several undefined behavior issues identified by @nrathaus. Jan 28, 2018
pyc_numeric.h Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
pyc_object.cpp Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
pyc_object.h Fix several undefined behavior issues identified by @nrathaus. Jan 28, 2018
pyc_sequence.cpp Remove unnecessary complexity and just use the base sequence type common Apr 28, 2018
pyc_sequence.h Remove unnecessary complexity and just use the base sequence type common Apr 28, 2018
pyc_string.cpp Fix several undefined behavior issues identified by @nrathaus. Jan 28, 2018
pyc_string.h Minor style cleanup Jun 11, 2014
pycdas.cpp Fix several undefined behavior issues identified by @nrathaus. Jan 28, 2018
pycdc.cpp Fix several undefined behavior issues identified by @nrathaus. Jan 28, 2018
pycdc_rt_test.sh Add some scripts for fetching/building many Python versions and compi… Apr 27, 2018
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.