Skip to content

meltedinhex/analyst-ai-pack / skills/reverse-engineering-binaries-with-ghidra

reverse-engineering-binaries-with-ghidra

Verified

Uses Ghidra to disassemble and decompile a binary, navigate to key routines via imports and strings, annotate decompiled code, and run headless scripts to automate extraction of C2, crypto, and config. Activates for requests to reverse engineer with Ghidra, decompile a binary, or script Ghidra headless analysis.

FileKindSize
LICENSEother340 B
SKILL.mdskill md3.5 KB
references/api-reference.mdmarkdown1.2 KB
scripts/analyst.pyscript2.4 KB

references/api-reference.md

View on GitHub
# API Reference: Reverse Engineering Binaries with Ghidra

## Overview

`scripts/analyst.py` wraps Ghidra's `analyzeHeadless` to import a binary, run auto-analysis, and
optionally execute a post-script (such as a function/string exporter). It orchestrates Ghidra
and does not run the sample.

## Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | subprocess, JSON, tempfile |

## External tools

| Tool | Version | Purpose |
|------|---------|---------|
| Ghidra | 11.x | Disassembly, decompilation, headless scripting |
| JDK | 17+ | Required by Ghidra |

## Core functions

### `run_headless(ghidra_path, binary, post_script, script_path, project_dir, timeout)`
Builds and runs the `analyzeHeadless` command (import, overwrite, delete temp project) and
returns the command, return code, and trimmed stdout/stderr.

## Usage

```bash
python scripts/analyst.py headless --ghidra /opt/ghidra --bin sample.bin \
  --post-script ExportFunctions.py --script-path ./ghidra_scripts --out out.json
```

## Sources

- Ghidra documentation — https://ghidra-sre.org/
- Ghidra API / headless analyzer — https://ghidra.re/ghidra_docs/api/
- analyzeHeadless usage (Ghidra `support/analyzeHeadlessREADME.html`)
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall