Skip to main content

ghidra-ai-bridge

AI-powered Ghidra query interface for reverse engineering agents.

ghidra-ai-bridge provides a CLI and Python API that lets AI agents (or humans) query Ghidra project data — decompiled code, structs, enums, vtables, cross-references, strings, and more — without running Ghidra interactively.

Features

  • Query decompiled code by address or function name
  • Cross-reference lookup — callers and callees
  • Struct/enum/vtable inspection from Ghidra exports
  • String search with reference tracking
  • Address map integration for reversed source code
  • Source type extraction — struct sizes, enum values from VALIDATE_SIZE / VALIDATE_OFFSET macros
  • Remaining stub tracking — find unreversed functions
  • Crash debugging — find which function contains a given address
  • Configurable — works with any Ghidra project via YAML config
  • Headless export — PyGhidra-based bulk export scripts
  • Normalized IR evidence — high P-code and CFG exports per function
  • Function context bundles — machine-readable callees, strings, globals, and CFG

Installation

pip install ghidra-ai-bridge

For headless Ghidra export support:

pip install ghidra-ai-bridge[headless]

Quick Start

# Interactive setup
ghidra-bridge init

# Export data from Ghidra project (requires pyghidra)
ghidra-bridge export all

# Build address map from reversed source
ghidra-bridge build-map

# Query
ghidra-bridge decompile 0x401000
ghidra-bridge search CPed
ghidra-bridge xrefs-to 0x5fb010
ghidra-bridge struct CEntity
ghidra-bridge info

Configuration

Create a ghidra-bridge.yaml in your project root:

ghidra:
  install_dir: ~/Downloads/ghidra_12.0.1_PUBLIC
  project_dir: ~/Documents/Ghidra
  project_name: my-project
  program_name: target.exe

paths:
  export_dir: .ghidra-exports
  address_map: .ghidra-exports/address_map.json

source:                                   # optional
  root: ./source
  hook_patterns:
    - 'RH_ScopedInstall\s*\(\s*(\w+)\s*,\s*(0x[0-9A-Fa-f]+)'
  stub_patterns:
    - 'plugin::Call\w*<[^>]*(0x[0-9A-Fa-f]+)[^>]*>'

binary:                                   # optional
  code_range_min: 0x00401000
  code_range_max: 0x00900000

Config priority: CLI args > environment variables > YAML file > defaults.

Environment variables: GHIDRA_INSTALL_DIR, GHIDRA_PROJECT_DIR, GHIDRA_PROJECT_NAME, GHIDRA_PROGRAM_NAME, GHIDRA_EXPORT_DIR.

Commands

Command Description
init Interactive setup wizard
export <type> Run Ghidra export (all, structs, decompiled, vtables, globals, strings, source-types)
build-map Build address map from source
decompile <addr|name> Show decompiled code
search <pattern> Search function names
xrefs-to <addr|name> Show callers
xrefs-from <addr|name> Show callees
struct <name> Show Ghidra struct definition
enum <name> Show Ghidra enum values
vtable <class> Show virtual function table
global <addr|name> Show global variable info
strings <pattern> Search strings
containing <addr> Find function containing address
decompile-class <class> Decompile all class methods
context <addr|name> Export a JSON evidence bundle for a function
pcode <addr|name> Show normalized high P-code JSON
cfg <addr|name> Show control-flow graph JSON
asm <addr|name> Show assembly captured during decompiled export
unimplemented [pattern] List unimplemented functions
remaining [class] Show remaining stubs
source-struct <name> Query struct from source
source-enum <name> Query enum from source
dump-asm <addr> <output> Dump assembly (requires pyghidra)
info Show export statistics
list List all functions

License

MIT

Metadata

Release files for ghidra-ai-bridge 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghidra-ai-bridge 0.2.0
File Size Uploaded
ghidra_ai_bridge-0.2.0.tar.gz 31.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ghidra-ai-bridge 0.2.0
File Interpreter ABI Platform
ghidra_ai_bridge-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 63.5 kB

Release files / ghidra_ai_bridge-0.2.0.tar.gz

Download URL ghidra_ai_bridge-0.2.0.tar.gz
Size 31.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cfe184a2c0f98d2c6d5d1489c2e91ba93884957c7d8a99da0382c5275d4d4f31
BLAKE2b-256 checksum
How to use checksums
c08a48a05efbf2efc1ebb94ca0f7e5fdddb0bacb69cb9fe47723137e8fbfad61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release files / ghidra_ai_bridge-0.2.0-py3-none-any.whl

Download URL ghidra_ai_bridge-0.2.0-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7be3c7d11e10367231f0aee12085afec24a89d8c2ccc3547d06b260898138779
BLAKE2b-256 checksum
How to use checksums
1f7d67f13402e311158b695ccd5c92c31c48dfce13554aa8654faab9169a9ffc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page