https://github.com/zrax/pycdc
C++ python bytecode disassembler and decompiler
https://github.com/zrax/pycdc
cxx decompiler disassembler hacktoberfest python
Last synced: 10 days ago
JSON representation
C++ python bytecode disassembler and decompiler
- Host: GitHub
- URL: https://github.com/zrax/pycdc
- Owner: zrax
- License: gpl-3.0
- Created: 2011-09-18T04:16:33.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2024-10-13T16:54:24.000Z (6 months ago)
- Last Synced: 2025-04-09T17:18:20.566Z (10 days ago)
- Topics: cxx, decompiler, disassembler, hacktoberfest, python
- Language: C++
- Homepage:
- Size: 882 KB
- Stars: 3,633
- Watchers: 96
- Forks: 694
- Open Issues: 195
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
- awesome-python-re - pycdc - A disassembler and decompiler written in C++ aiming to support all Python versions. This decompiler is known to be unstable. (Decompilers)
README
# 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](http://www.cmake.org) (See CMake's documentation for details)
* The following options can be passed to CMake to control debug features:| Option | Description |
| --- | --- |
| `-DCMAKE_BUILD_TYPE=Debug` | Produce debugging symbols |
| `-DENABLE_BLOCK_DEBUG=ON` | Enable block debugging output |
| `-DENABLE_STACK_DEBUG=ON` | Enable stack debugging output |* 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 check JOBS=4` (optional
`FILTER=xxxx` to run only certain tests)## 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.**Marshalled code objects**:
Both tools support Python marshalled code objects, as output from `marshal.dumps(compile(...))`.To use this feature, specify `-c -v ` on the command line - the version must be specified as the objects themselves do not contain version metadata.
## Authors, Licence, Credits
Decompyle++ is the work of Michael Hansen and Darryl Pogue.Additional contributions from:
* charlietang98
* Kunal Parmar
* Olivier Iffrig
* ZlodiyIt is released under the terms of the GNU General Public License, version 3;
See LICENSE file for details.