When to Use
- Static analysis of binaries without an IDA license.
- Bulk headless decompilation or scripted analysis across many binaries.
Applicable Scenarios
- Primary reverse engineering entry point when no IDA license is available
- Decompilation in batch headless analysis / CI
- Ghidra scripting (Java/Python Jython/PyGhidra) automation
- Interoperability with
binary-diff/patch-diff-exploit's ghidriff
Division of Labor with IDA
| Requirement | Priority |
|---|---|
| Existing IDA MCP deep dive | ida-reverse/ |
| Open source / batch / teaching | This skill |
| CLI-only quick reconnaissance | radare2/ |
Workflow
1. Project and automatic 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?
Limitations
- Decompiler output is less polished than IDA's for some architectures.
- Large firmware images may need significant RAM and patience.
Adapted from zhaoxuya520/reverse-skill (MIT).