Ghidra Reverse Engineering
ACTION REQUIRED (execute immediately after reading)
NOW: Read ../field-journal/precedent-reverse.md
NOW: Confirm need for Ghidra(no IDA / prefer open source / batch headless)
NEXT: Read ../tool-index.md to check ghidra / ghidra-mcp path
NEXT: Missing tools → bootstrap ghidra-mcp(if manifest supports) or install Ghidra per manual steps
ACT: Import sample → auto-analyze → export decompilation of key functions
Applicable Scenarios
- Primary reverse engineering entry point when no IDA license
- Batch headless analysis / decompilation in CI
- Ghidra scripting (Java/Python Jython/PyGhidra) automation
- Interop with
binary-diff / patch-diff-exploit 's ghidriff
Division of Labor with IDA
| Requirement |
Preferred |
| Existing IDA MCP for deep dive |
ida-reverse/ |
| Open source / batch / teaching |
This skill |
| CLI-only quick reconnaissance |
radare2/ |
Workflow
1. Project and Auto Analysis
□ 新建 Project → Import 文件 → Analyze(默认分析器)
□ 记录语言/编译器识别结果与基址
□ 标记入口、导出表、字符串 xref
2. Key Functions
□ 从字符串 / 导入 API 反查
□ Decompile 窗口还原算法
□ 重命名函数/变量;写 Plate comment
□ 需要动态时交接 Frida/GDB(reverse-engineering 动态章)
3. Headless (Batch)
# 示例:analyzeHeadless 路径因安装而异,MUST 从 tool-index 取
analyzeHeadless /path/to/project Proj -import sample.bin -postScript ExportDecomp.py
4. MCP (if configured)
□ 确认 ghidra MCP 端口(常见 8765,以 tool-index 为准)
□ 用 MCP 工具拉反编译 / xrefs,禁止猜端口
Toolchain
| Tool |
Purpose |
Bootstrap |
| Ghidra |
Primary decompilation tool |
Manual release / package manager |
| ghidra-mcp |
AI bridge |
bootstrap capability name ghidra-mcp |
| ghidriff |
Patch diffing |
See patch-diff-exploit |
Reference
references/ghidra-cheatsheet.md
../ida-reverse/ ../radare2/ ../binary-diff/
Routing Context
Upstream: MASTER R22
Downstream: Dynamic verification → Frida/GDB; exploitation → pwn-chain
Peer: ida-reverse(commercial deep dive)
Task Completion Self-Check
- Is it based on real Ghidra/tool-index paths?
- Are function addresses and renames annotated?
- Are there reproducible steps?
- Checklist / journal?