# Ghidrathon Ghidra Python 3 脚本扩展

> Mandiant FLARE 团队开发的 Ghidra 扩展，借助 Jep 把用户本机的 CPython 3 解释器嵌入 Ghidra，作为 Ghidra 基于 Jython 的 Python 2.7 脚本支持之外的选择。它提供交互式 Python 3 解释器窗口，可在脚本管理器中编写和运行 Python 3 脚本，也可在无界面的 analyzeHeadless 运行中执行 Python 3 后处理脚本；currentProgram() 等 GhidraScript 状态和 FlatProgramAPI 方法以 Python 内置名称的形式提供。由于直接使用所配置的解释器或虚拟环境，脚本可以导入其中已安装的包；README 以 capa、Unicorn 和 angr 为开发动机举例，并演示在 Ghidra 内用 Unicorn 模拟执行 ARM 代码。

- 类型：工具
- 目标：二进制
- 类别：原生分析工具
- 关联：基础工具
- 来源复核于：2026-10-27
- 收录于：2026-11-03
- 原始资源：<https://github.com/mandiant/Ghidrathon>
- 一手来源：<https://github.com/mandiant/Ghidrathon/blob/56866ad97ab7cc207ce85542c5ec20e01a10352d/README.md>
- 目录页面：<https://awesomerea.org/zh/resources/ghidrathon/>
- 记录 JSON：<https://awesomerea.org/resources/ghidrathon/record.json>
- 英文版：[English](https://awesomerea.org/resources/ghidrathon/index.md)

## 使用条件与局限

- 该仓库已在 GitHub 归档，处于只读状态。main 分支最后一次提交为 2024-05-08；最新版本 v4.0.0 发布于 2024-02-13，附带一个扩展 zip，由发布工作流针对 Ghidra 11.0 构建，并打包了配置脚本。归档未说明原因；据 Ghidra 自身的变更记录，11.3（2025 年 2 月）集成了 PyGhidra 这一原生 CPython 3 接口，其模块提供 CPython 解释器插件，以及用于 CPython 3 GhidraScript 的脚本提供程序。
- README 要求 Python 3.8+、恰好 Jep 4.2.0、Ghidra 10.3.2+ 和 Java 17+。安装时先按 util/requirements.txt 把 Jep 装进选定的解释器或虚拟环境，再针对 Ghidra 安装目录运行 util/ghidrathon_configure.py，它会在该目录或 GHIDRATHON_SAVE_PATH 下写入 ghidrathon.save 文件；随后通过 Ghidra 的扩展管理器安装 zip，README 说明遇到版本不匹配提示时可选择仍然安装。从源码构建需要 Gradle 7.3+，并需把 Jep 4.2.0 JAR 下载到 lib/。
- CI 仅在 Ubuntu、Windows 和 macOS 上，以 Python 3.8 和 3.12 针对 Ghidra 10.3.2 与 11.0 构建测试，并以无界面后处理脚本方式运行仓库中的 Python 测试。Jep 通过 JNI 把 Python 嵌入 JVM，README 指出 Ghidra 开发者不建议在 Ghidra 中使用 JNI；与 Ghidra 的 Java 和 Jython API 不同，脚本需通过 currentProgram() 这类函数调用读取 GhidraScript 状态。
- Apache-2.0（LICENSE.txt）。仓库提交的是 Java 与 Python 源码、一个示例脚本、Python 测试和三张 README 截图，不含二进制文件；CI 测试分析的是从下载的 Ghidra 发行包中取得的 demangler 可执行文件。

## 一手来源

1. <https://github.com/mandiant/Ghidrathon/blob/56866ad97ab7cc207ce85542c5ec20e01a10352d/README.md>
2. <https://github.com/mandiant/Ghidrathon/blob/56866ad97ab7cc207ce85542c5ec20e01a10352d/doc/building.md>
3. <https://github.com/mandiant/Ghidrathon/blob/56866ad97ab7cc207ce85542c5ec20e01a10352d/util/ghidrathon_configure.py>
4. <https://github.com/mandiant/Ghidrathon/blob/56866ad97ab7cc207ce85542c5ec20e01a10352d/util/requirements.txt>
5. <https://github.com/mandiant/Ghidrathon/blob/56866ad97ab7cc207ce85542c5ec20e01a10352d/ghidra_scripts/ghidrathon_example.py>
6. <https://github.com/mandiant/Ghidrathon/blob/56866ad97ab7cc207ce85542c5ec20e01a10352d/.github/workflows/tests.yml>
7. <https://github.com/mandiant/Ghidrathon/blob/56866ad97ab7cc207ce85542c5ec20e01a10352d/.github/workflows/build.yml>
8. <https://github.com/mandiant/Ghidrathon/blob/56866ad97ab7cc207ce85542c5ec20e01a10352d/LICENSE.txt>
9. <https://github.com/mandiant/Ghidrathon/releases/tag/v4.0.0>
10. <https://github.com/NationalSecurityAgency/ghidra/blob/1b9e58a915cf867e106495eaa2a4b18eb4971c9d/Ghidra/Configurations/Public_Release/src/global/docs/ChangeHistory.md#L1283>
11. <https://github.com/NationalSecurityAgency/ghidra/blob/1b9e58a915cf867e106495eaa2a4b18eb4971c9d/Ghidra/Features/PyGhidra/README.md>

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

- [diStorm3 x86/AMD64 反汇编库](https://awesomerea.org/zh/resources/distorm/index.md) · 工具
- [ProbeDroid Android 动态插桩工具包](https://awesomerea.org/zh/resources/probedroid/index.md) · 工具
- [Fridump 基于 Frida 的进程内存转储工具](https://awesomerea.org/zh/resources/fridump/index.md) · 工具
- [Redress Go 二进制分析工具](https://awesomerea.org/zh/resources/redress/index.md) · 工具
- [ghidra-nanomips nanoMIPS 处理器模块](https://awesomerea.org/zh/resources/ghidra-nanomips/index.md) · 工具
- [SMDA 递归反汇编库](https://awesomerea.org/zh/resources/smda/index.md) · 工具

## 关于此条目

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