Skip to content

meltedinhex/analyst-ai-pack / skills/scripting-ghidra-headless-analysis

scripting-ghidra-headless-analysis

Verified

Automates batch reverse engineering by generating Ghidra analyzeHeadless commands and post-analysis script skeletons to import, auto-analyze, and export results for many samples without the GUI. Activates for requests to script Ghidra headless analysis, batch-analyze samples with Ghidra, or generate an analyzeHeadless command and post-script.

FileKindSize
LICENSEother340 B
SKILL.mdskill md2.9 KB
references/api-reference.mdmarkdown1.2 KB
scripts/analyst.pyscript3.6 KB

references/api-reference.md

View on GitHub
# API Reference: Scripting Ghidra Headless Analysis

## Overview

`scripts/analyst.py` generates a Ghidra `analyzeHeadless` command line and a Jython-compatible
post-analysis script that exports functions and/or strings to JSON. It only generates text — it
does not run Ghidra or any sample.

## Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | shlex, JSON, file IO |

## Core functions

### `command(project, name, import_dir, script, recursive, overwrite)`
Builds the analyzeHeadless invocation with common flags.

### `postscript(out, emit)`
Writes a Jython post-script emitting `functions` and/or `strings` to a JSON file next to the
program.

## Generated script notes

- Targets Jython 2 (no f-strings); uses `currentProgram`, `getFunctionManager`, `getListing`.

## Usage

```bash
python scripts/analyst.py command --project /proj --name Batch --import ./samples --script export.py
python scripts/analyst.py postscript --out export.py --emit functions,strings
```

## Sources

- Ghidra analyzeHeadless documentation — https://ghidra-sre.org/
- Ghidra FlatProgramAPI / program model — https://ghidra.re/ghidra_docs/api/
- Headless batch-analysis workflow from official Ghidra `support/analyzeHeadlessREADME.html`
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall