Main Interface Components
Ghidra’s CodeBrowser provides a comprehensive reverse engineering environment with multiple coordinated views and tools.The CodeBrowser is implemented by the
CodeBrowserPlugin which serves as the primary program listing display window and coordinates with other plugins.Primary Windows
- Code Browser
- Decompiler
- Symbol Tree
- Data Type Manager
The central listing view displays disassembled code, data, and program information:
- Listing Panel: Main program view with configurable fields
- Header Component: Allows rearrangement of program fields
- Field Panel: Displays addresses, bytes, mnemonics, operands, and comments
- Navigation Controls: Cursor movement and selection tools
Workspace Layout
Ghidra uses a docking window system that allows customization of the interface layout.Default Layout
By default, Ghidra opens with:
- Code Browser (center)
- Symbol Tree (left panel)
- Decompiler (right panel)
- Function Window (bottom)
Customize Layout
Drag window tabs to reposition views:
- Dock panels to any edge
- Create tabbed groups
- Float windows as separate dialogs
- Save layouts for different workflows
Navigation Features
Location Tracking
The CodeBrowser tracks your current location and generates events:- ProgramLocation: Current cursor position in the program
- ProgramSelection: Selected address ranges
- ProgramHighlight: Highlighted regions for emphasis
Navigation Actions
Go To Address
Press
G to open the Go To dialog:- Enter addresses in hexadecimal
- Navigate to labels by name
- Jump to file offsets
Follow References
Double-click or press
Enter on:- Function calls to jump to function definition
- Data references to navigate to data
- Cross-references to explore relationships
Context Actions
Right-click context menus provide location-specific actions based on:- Current cursor position
- Selection type (code, data, or undefined)
- Available context providers
Action Contexts
Ghidra uses specialized action contexts:ListingActionContext: Actions in the listing viewProgramActionContext: Program-wide actionsNavigatableActionContext: Navigation-specific actionsCodeViewerActionContext: Code viewer operations
Service Architecture
The CodeBrowser provides services to other plugins: Services Provided:CodeViewerService: Extends basic listing functionalityCodeFormatService: Manages field formattingFieldMouseHandlerService: Handles mouse interactions
ProgramManager: Program lifecycle managementGoToService: Navigation operationsClipboardService: Copy/paste functionality
Field Configuration
Customize the listing display fields:Configure Fields
- Add or remove fields
- Reorder field display
- Adjust field widths
- Configure field-specific options
Event System
Ghidra plugins communicate via events: Events Consumed:ProgramActivatedPluginEvent: Program becomes activeProgramClosedPluginEvent: Program is closedProgramLocationPluginEvent: Location changesProgramSelectionPluginEvent: Selection changesProgramHighlightPluginEvent: Highlight changesViewChangedPluginEvent: View configuration changes
ProgramLocationPluginEvent: Broadcasts location to other pluginsProgramSelectionPluginEvent: Broadcasts selection to other plugins
