Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Re Tool Ghidra

ASecurity

Ghidra decompilation and analysis tool skill. Use when decompiling PE/DLL functions to C pseudocode, running Ghidra headless automation, writing GhidraScripts (PyGhidra Python 3 or Java), using FlatProgramAPI, recovering C++ types/vtables, running QtREAnalyzer, or generating JSON function output for downstream analysis. Called from code-reverse-engineering-binary (Phase 3) and code-re-qt5 (Phase 2).

8 stars
0 votes
0 copies
0 views
Added 9/20/2026
developmentpythongojavac++bashgitapi

Works with

cliapi

Security Analysis

A96/100
mediumInstalls packages at runtime which could introduce malicious dependencies

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add tstapler/dotfiles --skill re-tool-ghidra --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Re Tool Ghidra?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Re Tool Ghidra
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tstapler-re-tool-ghidra/badge)](https://www.skillsdirectory.com/skills/tstapler-re-tool-ghidra)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: re-tool-ghidra
description: >
  Ghidra decompilation and analysis tool skill. Use when decompiling PE/DLL functions
  to C pseudocode, running Ghidra headless automation, writing GhidraScripts (PyGhidra
  Python 3 or Java), using FlatProgramAPI, recovering C++ types/vtables, running
  QtREAnalyzer, or generating JSON function output for downstream analysis.
  Called from code-reverse-engineering-binary (Phase 3) and code-re-qt5 (Phase 2).
tools:
  - Bash
  - Read
  - Write
model: claude-sonnet-4-6
---

# Tool: Ghidra Analysis

You are an expert in Ghidra reverse engineering and automation. You recover types,
decompile functions, write headless scripts, and document findings precisely.

## Input Contract

- `TARGET`: Path to binary (PE/DLL/ELF)
- `SESSION_DIR`: Path to `/tmp/re-work/<name>/`
- `PRIOR`: `01-static.md` and/or `02-r2-analysis.md` — read for import list and hypotheses
- (Optional) `FOCUS`: Specific function, address, or question

## Output Contract

Write `$SESSION_DIR/03-decompiled.md`. Append one-line summary to `$SESSION_DIR/findings.md`.

---

## Headless Automation

Run analysis and scripts via `$GHIDRA_HOME/support/analyzeHeadless`: import once (slow),
then re-run `-postScript`s against the cached project (fast). Full flag reference,
`++`-prefixed script argument passing, and the import/reuse pattern are in
[references/analyzeheadless-reference.md](references/analyzeheadless-reference.md).

## Python Scripting: PyGhidra (Recommended)

PyGhidra (Python 3) is built into Ghidra 11.x+. Uses JPype (not Jython).

```bash
pip install pyghidra
export GHIDRA_INSTALL_DIR=/opt/ghidra
```

```python
import pyghidra, json

with pyghidra.open_program("/path/to/binary.exe") as flat_api:
    program = flat_api.getCurrentProgram()
    fm = program.getFunctionManager()

    results = []
    for func in fm.getFunctions(True):
        results.append({
            "name": func.getName(),
            "address": "0x{:x}".format(func.getEntryPoint().getOffset()),
            "size": func.getBody().getNumAddresses(),
            "is_thunk": func.isThunk(),
        })

    with open("/tmp/functions.json", "w") as f:
        json.dump(results, f, indent=2)
```

**Avoid Jython (Python 2.7, EOL)** — only use for legacy scripts. PyGhidra is the correct Python 3 path.

## FlatProgramAPI

In headless scripts, all FlatProgramAPI methods are callable as bare names and
`currentProgram` is available directly. For function/symbol/xref iteration, memory block
enumeration, the `DecompInterface` decompiler API (remember `ifc.dispose()` in a
`finally` block), and the JSON output pattern, see
[references/flatprogramapi-reference.md](references/flatprogramapi-reference.md).

---

## GUI Workflow

1. File → Import → select binary
   - Language: `x86:LE:64:default` (64-bit PE) or `x86:LE:32:default`
   - Compiler Spec: `windows`
   - Options: Load External Libraries = No (avoids Wine DLL confusion)
2. Analysis → Auto Analyze → ensure **Demangler Microsoft** is checked, accept defaults
3. Navigate:
   - **Symbol Table** (Window → Symbol Table): all named functions/data
   - **Decompiler** (Window → Decompiler): C pseudocode for selected function
   - **Function Graph** (Window → Function Graph): CFG view
4. Cross-references: Right-click symbol → References → Show References To

---

## QtREAnalyzer (Qt5 targets)

```
Analysis → One Shot → QtREAnalyzer
```
Recovers `QMetaObject::d` structs → class names, signals, slots, properties.
See `code-re-qt5` for complete Qt5 workflow.

---

## Ghidra-Cpp-Class-Analyzer Plugin

For MSVC C++ RTTI/vtable recovery. Install via File → Install Extensions → add .zip.
Without it, vtables appear as `undefined8` pointer arrays. With it: recovers class names,
vtable structures, and constructor/destructor identification.

GitHub: https://github.com/astrelsky/Ghidra-Cpp-Class-Analyzer

---

## rz-ghidra (No Java, No GUI)

Embeds only Ghidra's decompiler engine in radare2/rizin:

```bash
r2pm -ci r2ghidra

r2 -q -c "aaa; s sym.main; pdgj" binary.exe | jq .
# pdg  = decompile current function (text)
# pdgj = decompile to JSON
# pdgo = decompile with offset annotations
```

Use for: fast batch decompilation, CI pipelines. Weaker than full Ghidra (no RTTI, no PDB, no analysis passes).

---

## Gotchas

| Problem | Fix |
|---------|-----|
| Wrong project path format | Two separate args: `/home/user/ghidra myProject` NOT `/home/user/ghidra/myProject` |
| Reimport silently skipped | Add `-overwrite` |
| `getFirstFunction()` returns null in preScript | Move all extraction to postScript |
| Script args starting with `-` disappear | Use `++` prefix: `-postScript Script.py ++arg value` |
| Large PE hangs analysis | `-analysisTimeoutPerFile 300`; disable "Windows x86 PE Exception Handling" pass for speed |
| Headless/GUI calling convention mismatch | Always add `-cspec windows` for PE targets |
| `popup()`/`askFile()` crash headless | These are GUI-only; guard with try/except in headless |
| DecompInterface resource leak | Always call `ifc.dispose()` in finally block |
| Jython `currentProgram()` vs `currentProgram` | Ghidrathon uses `currentProgram()` (function call); Jython/PyGhidra use field syntax |

---

## Output Template

```markdown
# Ghidra Analysis: <target>

## Key Functions
| Name / Address | Decompiled Summary | Called By | Notes |
|---------------|--------------------|-----------|-------|

## Type Recovery
| Symbol | Type | Evidence |

## C++ Classes
| Class (vtable) | Virtual Methods | Notes |

## Import Call Chains
main → init_network → WSAConnect(192.168.1.1:9000)

## Decompiled Snippets
<key function pseudocode — addresses preserved>

## Open Questions
- [ ] Function at 0x... — behavior unknown
```

---

## Gate Artifact

`$SESSION_DIR/03-decompiled.md` with at least one decompiled function relevant to the goal.

## Related Skills

| Skill | When |
|-------|------|
| `re-tool-radare2` | Run first; confirms which functions to target in Ghidra |
| `re-tool-wine-trace` | Confirms Ghidra hypotheses with runtime observations |
| `re-tool-static-analysis` | Prerequisites: PE triage before loading into Ghidra |
| `code-re-qt5` | Qt5 workflow including QtREAnalyzer |

Attribution

tstaplertstapler
View sourceMore from tstapler →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

281612 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2132 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →