# Rellic LLVM bitcode 转 C 反编译器

> Trail of Bits 对 No More Gotos 论文中模式无关结构化算法的实现，可把 LLVM bitcode 转换为不含 goto 的 C 代码，定位为小巧、易于修改且能与 LLVM 和 Remill 互操作的反编译器后端。rellic-decomp 批量将 bitcode 模块转换为 C；rellic-xref 提供 Web 界面，可选择要应用的细化遍，并将 C AST 节点与生成它的 bitcode 相互对应；rellic-headergen 根据模块中的 DWARF 元数据生成描述数据结构布局的 C 代码。机器码须先由其他工具提升为 bitcode；仓库附带的 IDA 脚本借助 Anvill 完成这一步。

- 类型：工具
- 目标：二进制
- 类别：二进制分析库
- 关联：基础工具
- 来源复核于：2026-10-19
- 收录于：2026-10-19
- 原始资源：<https://github.com/lifting-bits/rellic>
- 一手来源：<https://github.com/lifting-bits/rellic/blob/370abaad86ae5adad82f85b81aff14557462b7f2/README.md>
- 目录页面：<https://awesomerea.org/zh/resources/rellic/>
- 记录 JSON：<https://awesomerea.org/resources/rellic/record.json>
- 英文版：[English](https://awesomerea.org/resources/rellic/index.md)

## 使用条件与局限

- 审阅时最新版本为 v0.2.3，发布于 2023-04-04，提供基于 LLVM 15 的构建：Ubuntu 20.04 的 deb 与 tgz 包，以及 macOS 11 的 tgz 包。所审阅的 master 提交（2025-11-03）比该版本多 13 个提交，内容是注释掉 AnghaBench CI 定时任务；此前的代码提交日期为 2024 年 4 月。
- README 称支持 Linux，并在 Ubuntu 22.04 上测试过，另外也说明了 macOS 上的构建方法。构建需要 CMake 3.21+、LLVM 与 Clang 16、Z3 4.7.1+、gflags 和 glog，其中大部分可由 Trail of Bits 预构建的 cxx-common 包提供；scripts/build.sh 会下载其余依赖并生成 deb 包。Docker Hub 和 GitHub Package Registry 上的 Docker 镜像按 Ubuntu 与 LLVM 版本区分。
- 输入为与反编译器使用相同 LLVM 版本构建的 LLVM bitcode 模块。C 源码可用 clang -emit-llvm 编译得到，而可执行文件需借助 Remill 或 Anvill 等独立提升器处理。README 示例中输出的控制流和变量类型与原始源码不同；其 AnghaBench 1,000 个程序的测试只检查 bitcode 能否转换为 C，不检查结果的可读性或行为。
- Apache-2.0 许可证。往返测试将 C 编译为 IR 再转回 C，检查结果能否构建且行为与原程序大致相同。rellic-xref 默认监听所有地址的 80 端口。

## 一手来源

1. <https://github.com/lifting-bits/rellic/blob/370abaad86ae5adad82f85b81aff14557462b7f2/README.md>
2. <https://github.com/lifting-bits/rellic/blob/370abaad86ae5adad82f85b81aff14557462b7f2/README.md#L179-L326>
3. <https://github.com/lifting-bits/rellic/blob/370abaad86ae5adad82f85b81aff14557462b7f2/docs/NoMoreGotos.pdf>
4. <https://github.com/lifting-bits/rellic/blob/370abaad86ae5adad82f85b81aff14557462b7f2/tools/xref/README.md>
5. <https://github.com/lifting-bits/rellic/blob/370abaad86ae5adad82f85b81aff14557462b7f2/tools/headergen/README.md>
6. <https://github.com/lifting-bits/rellic/blob/370abaad86ae5adad82f85b81aff14557462b7f2/tools/plugins/ida-rellic.py>
7. <https://github.com/lifting-bits/rellic/blob/370abaad86ae5adad82f85b81aff14557462b7f2/CMakeLists.txt>
8. <https://github.com/lifting-bits/rellic/blob/370abaad86ae5adad82f85b81aff14557462b7f2/LICENSE>
9. <https://github.com/lifting-bits/rellic/releases/tag/v0.2.3>
10. <https://github.com/lifting-bits/rellic/compare/v0.2.3...370abaad86ae5adad82f85b81aff14557462b7f2>

## 同分区更多条目：原生二进制

- [ghidra-delinker-extension Ghidra 目标文件反链接扩展](https://awesomerea.org/zh/resources/ghidra-delinker-extension/index.md) · 工具
- [BinExport 反汇编导出插件](https://awesomerea.org/zh/resources/binexport/index.md) · 工具
- [Karta 开源库匹配插件](https://awesomerea.org/zh/resources/karta/index.md) · 工具
- [VTIL-Core 虚拟机翻译中间语言核心库](https://awesomerea.org/zh/resources/vtil-core/index.md) · 工具
- [Frida Workbench VS Code 扩展](https://awesomerea.org/zh/resources/vscode-frida/index.md) · 工具
- [ghidriff Ghidra 二进制差异分析引擎](https://awesomerea.org/zh/resources/ghidriff/index.md) · 工具

## 关于此条目

说明已依据一手来源复核。
原创说明采用 MIT 许可；外部项目、论文与素材保留各自的权利和许可。
