# tiny-dec

> Zhuo Zhang's small educational decompiler for 32-bit RISC-V (RV32I) ELF files, written in Python to teach how decompilation works rather than to compete with production decompilers. Its 19 deliberately separate stages run from ELF loading, decoding and p-code lifting through SSA, stack, type, variable and range recovery to control-flow structuring and C output, and the CLI can stop at any stage to print that stage's intermediate result. The README also offers a Claude Code plugin whose AI tutor walks learners through the stages with quizzes and exercises.

- Type: Learning resource
- Targets: Binary
- Category: Learning resources
- Relationship: Learning resource
- Sources reviewed: 2026-10-19
- Added to the catalog: 2026-10-27
- Original resource: <https://github.com/ZhangZhuoSJTU/tiny-dec>
- Primary source: <https://github.com/ZhangZhuoSJTU/tiny-dec/blob/4f5f1e00a147ba1c1471d2e01f9dd4beb5a693d6/README.md>
- Catalog page: <https://awesomerea.org/resources/tiny-dec/>
- Record JSON: <https://awesomerea.org/resources/tiny-dec/record.json>
- Chinese version: [简体中文](https://awesomerea.org/zh/resources/tiny-dec/index.md)

## Requirements & limits

- Reviewed at commit 4f5f1e0 (2026-05-27), the repository's only commit; the package is version 0.1.0, and the repository's test and lint workflows passed on that commit. The README calls it a teaching tool, not a production decompiler: it handles RV32I only, and unresolved expressions stay in the output as raw<...> rather than being guessed. A live demo site at tiny-dec.zzhang.xyz shows the stages.
- Input is an RV32I ELF file. The repository commits 13 C test programs and 39 RV32I builds of them (-O0 and -O2, PIE and non-PIE) under tests/fixtures, so no outside binaries are needed. Rebuilding them or compiling one's own C code needs clang, lld and LLVM with RISC-V support, installed locally or through the included Docker development image.
- Requires Python 3.12+ and Poetry, and the loader leaves ELF parsing to pwntools; the README lists Ubuntu/Debian system packages, and a devcontainer is included. The AI tutor needs Claude Code and installs as a plugin from the repository's marketplace manifest; its skill files hold one lesson guide per pipeline stage.
- MIT license (Copyright 2026 Zhuo Zhang). The 500-test count and the example outputs are the author's. The tutor is an AI teaching aid.

## Primary sources

1. <https://github.com/ZhangZhuoSJTU/tiny-dec/blob/4f5f1e00a147ba1c1471d2e01f9dd4beb5a693d6/README.md>
2. <https://github.com/ZhangZhuoSJTU/tiny-dec/blob/4f5f1e00a147ba1c1471d2e01f9dd4beb5a693d6/pyproject.toml>
3. <https://github.com/ZhangZhuoSJTU/tiny-dec/blob/4f5f1e00a147ba1c1471d2e01f9dd4beb5a693d6/LICENSE>
4. <https://github.com/ZhangZhuoSJTU/tiny-dec/blob/4f5f1e00a147ba1c1471d2e01f9dd4beb5a693d6/DEVELOPMENT_NOTES.md>
5. <https://github.com/ZhangZhuoSJTU/tiny-dec/blob/4f5f1e00a147ba1c1471d2e01f9dd4beb5a693d6/.github/workflows/ci.yml>
6. <https://github.com/ZhangZhuoSJTU/tiny-dec/blob/4f5f1e00a147ba1c1471d2e01f9dd4beb5a693d6/.claude-plugin/plugin.json>
7. <https://github.com/ZhangZhuoSJTU/tiny-dec/tree/4f5f1e00a147ba1c1471d2e01f9dd4beb5a693d6/skills/teach-decompilation>
8. <https://github.com/ZhangZhuoSJTU/tiny-dec/tree/4f5f1e00a147ba1c1471d2e01f9dd4beb5a693d6/tests/fixtures>
9. <https://tiny-dec.zzhang.xyz/>

## More in References and learning

- [Reverse Engineering Reading List](https://awesomerea.org/resources/onethawt-re-reading-list/index.md) · Learning resource
- [Decomp Academy](https://awesomerea.org/resources/decomp-academy/index.md) · Learning resource
- [OWASP Firmware Security Testing Methodology (FSTM)](https://awesomerea.org/resources/owasp-fstm/index.md) · Learning resource
- [Emproof workshop: Firmware Reverse Engineering](https://awesomerea.org/resources/emproof-firmware-re-workshop/index.md) · Learning resource
- [iOS App Reverse Engineering](https://awesomerea.org/resources/ios-app-reverse-engineering-book/index.md) · Learning resource
- [Frida Snippets](https://awesomerea.org/resources/frida-snippets/index.md) · Learning resource

## About this entry

The description was reviewed against primary sources.
Original editorial content: MIT. Linked projects, papers and assets retain their own rights and licenses.
