从头开始用 C++ 重新实现 Ghidra 的分析核心,旨在消除 JVM 依赖并实现深度 AI 集成。
Ghidra 是由美国国家安全局(NSA)用 Java 构建的逆向工程框架。Enigma 是其分析管道的原生 C++ 重写版——能力相同,但无需 JVM、无需 Gradle、无需 Java 运行时。
目标是打造一个自包含的二进制分析引擎,可直接嵌入、扩展并与 AI 系统集成,而无需桥接层或封装器。
该项目正在积极开发中。核心分析管道已可用:
Binary (PE/ELF)
↓
BinaryLoader — parses sections, imports, exports, .pdata
↓
Capstone Disassembler — decodes instructions
↓
Pcode Engine — Ghidra's C++ decompiler library (taken as-is)
↓
Analysis Pipeline — function detection, type recovery, cross-references
↓
Program Model — functions, symbols, types, memory (387 headers, 119 .cpp)
↓
Storage — FlatBuffers snapshots + LMDB index + git-like commits
↓
Qt GUI — Disassembly / Decompiler / Hex / Explorer
依赖:
git clone https://github.com/adam-040/Enigma.git
cd Enigma/enigma-engine
cmake -B build-cmake -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build-cmake
在真实 Windows 二进制文件上测试:
本项目与 Ghidra 相互独立,采用 Apache License 2.0 许可。
| 组件 | 来源 |
|---|
| 反编译引擎(约 15 万行) | Ghidra C++ 库 — 原样采用 |
| Sleigh 处理器规范 | Ghidra — 原样采用 |
| 程序模型、类型系统、内存 | Java → C++ 移植(原创工作) |
| 分析管道、函数检测 | 原创 C++ 实现 |
| 二进制加载器 | 原创(PE/ELF 解析器,已为 LIEF 做好准备) |
| 存储系统 | 原创(FlatBuffers + LMDB + 提交) |
| GUI | 原创(Qt6) |
| 二进制文件 | Enigma | Ghidra | 召回率 |
|---|
| notepad.exe | 623 | 498 | 98%+ |
| shell32.dll | 30,233 | 30,993 | 97.55% |
| kernel32.dll | 3,763 | ~3,800 | ~99% |