DatanoiseTV/revenant
GitHub: DatanoiseTV/revenant
一款利用大语言模型驱动的自动化逆向分析引擎,专为重构和复活厂商已停止维护的硬件固件与遗留软件而设计。
Stars: 0 | Forks: 0
# revenant
[](LICENSE)
[](https://github.com/DatanoiseTV/revenant/releases)
[](https://github.com/DatanoiseTV/revenant/pkgs/container/revenant)
[](pyproject.toml)
**让被遗弃的硬件和软件重获新生。** revenant 是一个由 LLM 驱动、针对厂商不再支持的固件和二进制文件的自动化逆向工程引擎。只需将其指向一个固件镜像或编译好的程序,它就能识别目标、重构其结构,并生成维持设备运行所需的产出物:引脚图、设备树、外设清单、可编译的自定义固件项目、恢复的函数名,以及(可选的)净室开源重写实现。
完全在 Docker 中运行。挂载你的工作文件夹即可开始。
├── verification.json # cross-validation verdicts
└── graphs/ # architecture.mmd, pipeline.mmd (Mermaid)
```
## 工作原理
一个具备依赖感知能力的 DAG 引擎会并发运行每一个处于就绪状态的阶段,并根据其输入的内容哈希值缓存每个阶段的输出,因此重新运行是瞬间完成的,并且只有发生变动的工作才会被重新执行。
```
recon → triage → extract → disasm → semantic → decompile ─┬─ naming
(file type + (Ghidra, when needed) ├─ (firmware) pinmap → devicetree → firmware_template
compression scan) ├─ (software) behavior
├─ verify (--cross-validate)
└─ reimplement (--reimplement)
└────────── report
```
默认的 `claude-code` 后端是**代理式**的:模型不需要固定的命令脚本,而是通过 [radare2 MCP server](https://github.com/radareorg/radare2-mcp) 在迭代循环中亲自驱动 radare2,从而决定接下来检查什么。其他后端在预先计算的反汇编特征上使用确定性的补全路径,因此本地模型同样适用。
## 实时 TUI
安装 `tui` 扩展(已内置在 Docker 镜像中)即可获得实时视图 — 包含阶段 DAG 树及各阶段的状态与耗时、动态进度条、滚动日志面板,以及带有外设/引脚/组件表格的最终总结。它基于 [rich](https://github.com/Textualize/rich)(`Tree`/`Table`/`Panel`/`ProgressBar`/`Live`)构建,能够正确计算布局和 Unicode 单元格宽度 — 无需手动对齐 ASCII 字符。该界面在终端环境下会自动启用;使用 `--no-tui` 可切换为纯文本日志(此为 CI/无头环境运行时的默认选项)。
[options]
-o, --out DIR output workspace (default: revenant-out)
--mode MODE auto | firmware | software (track selection)
--provider P claude-code | openai | lmstudio | none
--model M model id for the provider
--no-agentic disable MCP-driven agentic analysis
--toolchain T firmware template: esp-idf|arduino|zephyr|stm32-hal|bare-metal|linux
--arch / --soc / --load-addr detection hints
--only / --skip STAGE... run/skip specific stages
--deep thorough: enable decompile + capabilities + sbom
--no-verify disable the default adversarial cross-validation pass
--decompile run Ghidra headless decompilation (better C for the LLM)
--capabilities capa capability detection (network/crypto/anti-analysis)
--emulate run a target Linux ELF under user-mode QEMU (executes it)
--sbom software bill of materials + known-CVE scan (syft/grype)
--reimplement also produce a 1:1 open-source reimplementation
--fast shallower (faster) radare2 analysis for large binaries
-j, --concurrency N max parallel stages (default 6)
--no-cache ignore the stage cache
--tui / --no-tui force/disable the live TUI
revenant doctor report tool + provider availability
revenant init write a sample revenant.yaml config
```
## 状态与局限性
- 识别与重构结果属于**尽力而为的静态推断**。置信度评分和默认的对抗性验证扫描有助于捕获薄弱的发现,但仍需对照真实硬件和权威文档进行验证。
- 重写实现阶段是基于代理且受边界限制的 — 请将其输出视为脚手架,而非最终完成的移植版本。
- 默认镜像中包含了 Ghidra;你可以通过 `--build-arg INSTALL_GHIDRA=false` 构建仅包含 radare2 的更小镜像。
- 原生解析 ELF 格式;Mach-O/PE 头信息则通过 radare2/LIEF 识别。
## 许可证
[Apache-2.0](LICENSE)。请将其用于修复、保存、互操作性、安全研究和教育目的 — 请参阅上文免责声明。
Live TUI (scales to your terminal): the stage DAG runs on the left while
results fill in on the right — SoC, peripherals, external components (sensors,
port expanders, rotary encoders, displays, LED strips, audio DACs) and the pin
map. Timings are from a real claude-code run (agentic identification ~96 s / 11
turns over radare2 MCP; full pipeline ~3 min); GIF playback is accelerated. The
on-screen data is an illustrative synthetic target, not a real device.
标签:C2, DLL 劫持, Docker, Python, 云资产清单, 固件分析, 大语言模型, 安全防御评估, 嵌入式系统, 无后门, 网络调试, 自动化, 请求拦截, 逆向工具, 逆向工程