# zrax/pycdc

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/zrax-pycdc).**

4,304 stars · 808 forks · C++ · gpl-3.0

## Links

- GitHub: https://github.com/zrax/pycdc
- awesome-repositories: https://awesome-repositories.com/repository/zrax-pycdc.md

## Topics

`cxx` `decompiler` `disassembler` `hacktoberfest` `python`

## Description

pycdc is a reverse engineering toolset that decompiles and disassembles compiled Python bytecode files back into readable source code. It parses .pyc file headers, reconstructs abstract syntax trees from bytecode instructions, and handles version-specific opcodes across Python versions 1.0 through 3.13 with endian-aware binary parsing.

The tool recovers numeric constants, string literals, and marshalled Python objects from compiled bytecode, supporting both file-based and in-memory bytecode loading. It provides a human-readable disassembly listing of bytecode instructions alongside full source code reconstruction, with the ability to decompile marshalled code objects when the target Python version is specified.

The project covers binary data structure recovery, marshalled object extraction, and multi-version Python reverse engineering through a command-line interface that outputs formatted results. It is distributed as a C++ executable that reads .pyc files or bytecode buffers and produces decompiled Python source code.

## Tags

### Part of an Awesome List

- [Bytecode Decompilers](https://awesome-repositories.com/f/awesome-lists/devtools/bytecode-analysis-tools/bytecode-decompilers.md) — Translate compiled Python bytecode back into readable source code by analyzing and reconstructing the original program structure. ([source](https://github.com/zrax/pycdc#readme))
- [Bytecode Disassemblers](https://awesome-repositories.com/f/awesome-lists/devtools/bytecode-analysis-tools/bytecode-disassemblers.md) — Converts compiled Python bytecode into human-readable assembly-like listings of opcodes and operands. ([source](https://github.com/zrax/pycdc#readme))
- [Bytecode File Header Analysis](https://awesome-repositories.com/f/awesome-lists/devtools/bytecode-analysis-tools/bytecode-file-header-analysis.md) — Parses .pyc file headers to identify Python language version, encoding settings, and other metadata for correct decompilation.

### Programming Languages & Runtimes

- [Python Reverse Engineering](https://awesome-repositories.com/f/programming-languages-runtimes/python-reverse-engineering.md) — Analyzes, parses, and decompiles compiled Python code objects from binary files for security and forensics.
- [Multi-Version Python Decompilers](https://awesome-repositories.com/f/programming-languages-runtimes/version-specific-bytecode-dispatch/multi-version-python-decompilers.md) — Handles bytecode from Python versions 1.0 through 3.13 with version-specific opcode mapping and endian-aware parsing.
- [Bytecode Numeric Recovery](https://awesome-repositories.com/f/programming-languages-runtimes/bytecode-numeric-recovery.md) — Reconstructs integer, floating-point, and complex number literals from both string-stored and binary-encoded bytecode representations.
- [Marshalled Code Object Processing](https://awesome-repositories.com/f/programming-languages-runtimes/marshalled-code-object-processing.md) — Decompile marshalled code objects from Python's marshal format, reconstructing source code when the target Python version is specified. ([source](https://github.com/zrax/pycdc#readme))
- [Multi-Version Bytecode Analyzers](https://awesome-repositories.com/f/programming-languages-runtimes/python-reverse-engineering/multi-version-bytecode-analyzers.md) — Analyzing and decompiling bytecode across Python versions 1.0 through 3.13 with version-specific opcode handling.
- [Marshal Format Deserializers](https://awesome-repositories.com/f/programming-languages-runtimes/python-serialization-libraries/marshal-format-deserializers.md) — Loads serialized Python objects from a byte stream, reconstructing their types and values for further processing. ([source](https://github.com/zrax/pycdc/blob/master/pyc_object.cpp))
- [Version-Specific Bytecode Dispatch](https://awesome-repositories.com/f/programming-languages-runtimes/version-specific-bytecode-dispatch.md) — Handle bytecode from Python versions 1.0 through 3.13 by mapping version-specific opcodes to a common internal representation. ([source](https://github.com/zrax/pycdc/blob/master/bytecode.cpp))
- [Python Bytecode Integer Literals](https://awesome-repositories.com/f/programming-languages-runtimes/fixed-width-integer-implementations/integer-literal-definitions/python-bytecode-integer-literals.md) — Reconstructs integer literal values from compiled bytecode, handling both standard and arbitrary-precision integers. ([source](https://github.com/zrax/pycdc/blob/master/pyc_numeric.cpp))

### Development Tools & Productivity

- [Binary Data Structure Reconstructors](https://awesome-repositories.com/f/development-tools-productivity/memory-string-extraction/binary-string-recovery/binary-data-structure-reconstructors.md) — Reconstructing high-level data types like strings, tuples, and lists from raw bytecode streams in compiled files.
- [Bytecode String Decoders](https://awesome-repositories.com/f/development-tools-productivity/string-literal-handling/bytecode-string-decoders.md) — Decode and format string objects stored in .pyc files, handling Unicode, ASCII, interned, and short string types with proper quoting. ([source](https://github.com/zrax/pycdc/blob/master/pyc_string.cpp))

### Game Development

- [String Literal Decoding](https://awesome-repositories.com/f/game-development/source-to-runtime-asset-conversion/runtime-asset-decoding/string-literal-decoding.md) — Decodes and formats Unicode, ASCII, interned, and short string objects from compiled bytecode with proper quoting and escaping.

### Software Engineering & Architecture

- [Bytecode-to-AST Reconstruction](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-parsing/bytecode-to-ast-reconstruction.md) — Translates raw bytecode instruction sequences into an abstract syntax tree that mirrors the original program structure.
