C++ python bytecode disassembler and decompiler
C++ Python Shell CMake
Switch branches/tags
Nothing to show
Latest commit b9dd99d Jul 6, 2017 @zrax Don't create special objects for NULL, just use NULL directly.
Also move null check into PycRef for nullable references.
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 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 Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
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 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 Add MAGIC_NUMBER for Python 3.5.3 Apr 11, 2017
README.markdown Fix #51 by adding more precise build instructions Dec 4, 2014
bytecode.cpp Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
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 Add MAGIC_NUMBER for Python 3.5.3 Apr 11, 2017
pyc_module.h Minor typing/aliasing cleanup Jul 5, 2017
pyc_numeric.cpp Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
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 Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
pyc_sequence.cpp Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
pyc_sequence.h Use less conflicting filenames Oct 24, 2011
pyc_string.cpp Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
pyc_string.h Minor style cleanup Jun 11, 2014
pycdas.cpp Don't create special objects for NULL, just use NULL directly. Jul 5, 2017
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.