Scripting ghidra headless analysis

From meltedinhex/analyst-ai-pack · View interactive version

Scripting ghidra headless analysis is an AI agent skill from the GitHub repository meltedinhex/analyst-ai-pack. 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

How to use this skill

Skill file

Scripting Ghidra Headless Analysis

When to Use

strings, or decompiled output.

Do not use this to run untrusted samples — Ghidra analyzes binaries statically and never

executes them, but keep the import directory isolated. This skill prepares automation, it does not

run the binary.

Prerequisites

Safety & Handling

Workflow

Step 1: Generate the headless command

python scripts/analyst.py command --project /proj --name Batch --import ./samples --script export.py

Builds an analyzeHeadless invocation with project path, import directory, post-script, and common

flags (-recursive, -overwrite, -deleteProject optional).

Step 2: Generate a post-analysis script skeleton

python scripts/analyst.py postscript --out export.py --emit functions,strings

Emits a Ghidra Python (Jython) script that iterates functions/strings and writes JSON next to the

program.

Step 3: Run and collect

Execute the generated command, then aggregate the per-sample JSON exports.

Step 4: Review

Spot-check a few exports to confirm analysis completeness before scaling up.

Validation

Pitfalls

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.