Skip to content

Ghidra Integration

Ryan Cole edited this page Nov 14, 2026 · 1 revision

Two parts: a headless exporter (Ghidra's function boundaries for pbeta analyze) and a review window. Full reference: integrations/ghidra/README.md.

Headless exporter

Needs a JDK 25+ and Ghidra 12.x, with GHIDRA_INSTALL_DIR set to the Ghidra folder.

& "$env:GHIDRA_INSTALL_DIR\support\analyzeHeadless.bat" <project-dir> pb -import <copy-of>.exe `
    -scriptPath integrations/ghidra/scripts -preScript DisablePdb.java `
    -postScript ExportFunctions.java out.json -deleteProject

pbeta analyze app.exe --functions-from out.json --out app.json

Ghidra decides the function boundaries; every hash and feature is still computed by pbeta, so Ghidra-based and native analyses compare hash for hash. Ghidra's guessed names aren't used. Add pseudocode after out.json to store the decompiler's output too. pbeta analysis-diff a.json b.json compares two analyses of the same build.

Review window

A Permanent Beta Review window lists the review queue next to the listing and decompiler: each item's reason, candidates, evidence and checks. Go to the old function or a candidate, compare them side by side, and accept or reject. It decides nothing itself: it reads through pbeta-mcp and decisions run pbeta review, so the same rules apply.

Install

Needs Ghidra 12.2, a JDK 25+ and Gradle 9.1+, plus pbeta.exe and pbeta-mcp.exe.

cd integrations/ghidra/PermanentBeta
gradle -PGHIDRA_INSTALL_DIR="C:\path\to\ghidra_12.2"

In Ghidra: File > Install Extensions, +, pick the zip from dist\, restart. Enable PermanentBetaPlugin when offered (or File > Configure, Permanent Beta). Then Edit > Tool Options > Permanent Beta: paths to pbeta and pbeta-mcp, the review store, and your name as reviewer.

Use

  1. Repair with a store so there's something to review.
  2. Import the exact old and new executables that were analyzed into one project and open both. A program is tied to a build by its SHA-256.
  3. Window > Permanent Beta Review. Select an item, then a candidate.
  4. Go To Old Function, Go To Candidate, Compare Functions, Accept Candidate, Reject Item.
  5. Repair again with the same store.

Clone this wiki locally