Development Environment
Ghidra is built using modern development tools and frameworks:- Primary Language: Java (JDK 21+)
- Secondary Languages: C++, Sleigh, Python 3, Jython 2.7
- IDE: Eclipse (recommended) or Visual Studio Code
- Build System: Gradle 8.5+
- Source Control: Git
Architecture Overview
Framework Layer
Ghidra’s architecture is built on a modular framework consisting of several core components:- DB - Database management for programs and traces
- Docking - Window and UI docking framework
- Generic - Common utilities and base classes
- SoftwareModeling - Program model, language specifications, and p-code
- Project - Project and domain object management
- Emulation - P-code emulation engine
Feature Modules
Ghidra features are organized as modules that extend the framework:- Base - Core features including analyzers, loaders, and plugins
- Decompiler - C decompiler engine
- Debugger - Dynamic analysis and debugging support
- BSim - Binary similarity analysis
- FunctionID - Function identification database
Extension Points
Ghidra provides several extension points for custom functionality:- Analyzers - Automatic program analysis
- Loaders - Binary file format support
- Plugins - UI components and services
- File Systems - Container file format support
- Exporters - Output format generation
- Language Modules - Processor architecture support via Sleigh
Development Workflow
Creating Extensions
Extensions can be developed using:- GhidraDev Eclipse Plugin - Full Eclipse integration with debugging support
- VSCode Integration - Lightweight script and module development
- Standalone Gradle Projects - Independent module development
Project Types
Script Projects
Designed for single-file Java scripts:- Compiled by Ghidra at runtime
- Executed via Script Manager or Headless Analyzer
- Stored in
~/ghidra_scriptsby default
Module Projects
For complex features like analyzers and plugins:- Built as Gradle projects
- Exported as installable extensions
- Distributed as
.ziparchives
Building Ghidra
Quick Build
Common Gradle Tasks
| Task | Description |
|---|---|
prepdev | Download dependencies and setup dev environment |
eclipse | Generate Eclipse project files |
buildNatives | Build native components |
sleighCompile | Compile Sleigh language specifications |
assembleAll | Build uncompressed distribution |
buildGhidra | Build compressed distribution |
unitTestReport | Run unit tests |
integrationTest | Run integration tests |
Eclipse Setup
- File → Import → General → Existing Projects into Workspace
- Select Ghidra source repository
- Check “Search for nested projects”
- Click Finish
Extension Development
Module Structure
Extension Properties
Build Configuration
Class Naming Conventions
Licensing
Ghidra is released under the Apache License 2.0. When contributing:- Prefer Apache License 2.0 for new code
- GPL code must reside in top-level
GPL/directory - Use Git commit authorship for credit (not source comments)
- Ensure Git credentials link to your GitHub account
Resources
- DevGuide.md - Complete developer’s guide
- GhidraClass - Training materials
- API Documentation - Javadoc reference
- Ghidra Repository - Source code
Next Steps
Development Setup
Configure Eclipse or VSCode for Ghidra development
Plugin Development
Create custom UI components and services
Analyzer Development
Build automatic program analysis components
Loader Development
Add support for new binary formats
