Documentation Index
Fetch the complete documentation index at: https://mintlify.com/NationalSecurityAgency/ghidra/llms.txt
Use this file to discover all available pages before exploring further.
Listing View Overview
The listing view is the primary window for examining disassembled code, displaying instructions, data, and program structure.The listing is rendered using the
ListingPanel component with a configurable FormatManager that controls how program information is displayed.Understanding the Listing Display
Field Layout
The listing displays multiple fields for each code unit:- Address Field
- Bytes Field
- Mnemonic Field
- Operands Field
Shows memory addresses where code and data reside:
- Hexadecimal format by default
- Supports multiple address spaces
- Physical and virtual addresses
- Overlay address spaces
Navigation in Disassembly
Cursor Movement
Navigate through code using keyboard shortcuts:
Arrow Keys: Move cursor up/down/left/rightPage Up/Down: Scroll by pageCtrl + Home/End: Jump to program start/endHome/End: Move to line start/end
Follow Flow
Track program flow:
Enteron a call: Jump to called functionEnteron a jump: Follow jump targetEnteron data reference: Navigate to referenced data- View flow arrows showing branching
Disassembly Actions
Creating Instructions
Disassemble
Convert undefined bytes to instructions:
- Press
Don undefined bytes - Right-click >
Disassemble - Auto-analysis handles most disassembly
Clear Code
Remove incorrect disassembly:
- Press
Cto clear code units - Right-click >
Clear Code Bytes - Reverts to undefined bytes
Working with Data
Define Data
Convert bytes to data types:
- Press
Bfor byte - Press
Wfor word (2 bytes) - Press
DthenWfor dword (4 bytes) - Press
Tto choose data type
Create Arrays
Define array structures:
- Select bytes for array
- Right-click >
Data>Create Array - Specify element count and type
Code Units
Ghidra organizes memory into code units:- Instructions: Disassembled assembly code
- Defined Data: Typed data (integers, strings, structures)
- Undefined: Raw bytes not yet analyzed
Iterating Code Units
Programmatic access to code units:Selection and Highlighting
Creating Selections
Select Ranges
Select address ranges:
- Click and drag to select
Shift + Clickto extend selectionCtrl + Ato select all
Select Functions
Select entire functions:
- Right-click in function >
Select>Function Ctrl + Shift + Ffor current function- Select by function name in Symbol Tree
Highlighting
Highlight code for visual emphasis:- Middle-mouse Highlight: Click middle mouse on tokens
- Search Highlights: Automatic highlighting of search results
- Cursor Highlights: Related instructions highlighted
- Custom Highlights: Apply via plugins
Highlighting is managed through the
ProgramHighlightPluginEvent and FieldSelection mechanisms in the CodeBrowser.Flow Arrows
Visualize program flow with arrows:- Unconditional Jumps: Solid arrows
- Conditional Branches: Dashed arrows
- Calls: Different color/style
- Active Flow: Highlighted when cursor on branch
Comments and Annotations
Comment Types
- EOL Comment
- Pre Comment
- Post Comment
- Plate Comment
End-of-line comment:
- Press
;to add - Appears at end of code line
- Brief annotations
Viewing Options
Format Configuration
Customize Display
Configure listing appearance:
Edit>Tool Options>Listing Fields- Enable/disable fields
- Adjust field order and width
Color Settings
Customize syntax highlighting:
Edit>Tool Options>Listing Colors- Set colors for instructions, data, comments
- Configure background colors
Advanced Features
Context Register Tracking
For processors with mode changes (ARM/Thumb, etc.):- Context registers determine disassembly mode
- Set via
Set Register Valuesaction - Affects instruction interpretation
- Tracked by address range
Memory Blocks
View and navigate memory organization:- Initialized vs uninitialized blocks
- Permissions (read, write, execute)
- Overlay blocks for multiple mappings
- Block viewer shows memory layout
Bookmarks
Mark important locations:- Press
Ctrl + Dto add bookmark - Categorize by type (analysis, note, warning)
- Bookmark window shows all marked locations
- Quick navigation to bookmarked addresses
