Overview
This quickstart guide will walk you through the essential steps of using Ghidra:- Launching Ghidra
- Creating a new project
- Importing a binary file
- Running analysis
- Navigating the CodeBrowser interface
This guide assumes you have already installed Ghidra and JDK 21. If not, please refer to the Installation Guide first.
Step 1: Launch Ghidra
Step 2: Create a New Project
Start Project Creation
In the Ghidra Project Manager window:
- Click File → New Project
- Or press
Ctrl+N(Windows/Linux) orCmd+N(macOS)
Choose Project Type
Select Non-Shared Project and click Next
Non-Shared projects are stored locally on your machine. Shared projects use a Ghidra Server for team collaboration.
Step 3: Import a Binary
Start Import Process
In the Project Manager window:
- Click File → Import File
- Or press
I - Or drag and drop a file into the project window
Select Binary File
Choose an executable file to analyze:
- Windows:
.exe,.dll,.sys - Linux: ELF executables
- macOS: Mach-O executables
- Or any raw binary file
Review Import Summary
Ghidra will automatically detect the file format. Review the import details:
- Format (PE, ELF, Mach-O, etc.)
- Language (processor architecture)
- Compiler (if detected)
Step 4: Open in CodeBrowser and Analyze
Open CodeBrowser
Double-click the imported file in the project listingThe Ghidra CodeBrowser tool will open
Start Analysis
You’ll be prompted: “Would you like to analyze [filename] now?”
- Click Yes
- Or click No to analyze later via Analysis → Auto Analyze
Configure Analysis Options
The Analysis Options dialog appears with recommended analyzers pre-selected:Common analyzers include:
- Decompiler Parameter ID
- Function Start Search
- Stack
- Reference
- Data Reference
- Disassemble Entry Points
- Subroutine References
For your first analysis, the default options are fine. Click Analyze to proceed.
Step 5: Navigate the CodeBrowser Interface
The CodeBrowser is divided into several key windows:Main Windows
Listing Window
Center-left: Shows disassembly with addresses, bytes, mnemonics, and operands
- Assembly instructions
- Function boundaries
- Comments and labels
Decompiler Window
Center-right: Shows decompiled C-like pseudocode
- High-level code representation
- Variable names and types
- Control flow structures
Program Trees
Top-left: Hierarchical view of program structure
- Memory blocks
- Imports/Exports
- Functions
Symbol Tree
Bottom-left: Lists all symbols, functions, and labels
- Navigate to functions
- Find global variables
- View imports/exports
Navigation Basics
Navigate to Entry Point
The entry point is typically displayed automatically after analysisOr navigate manually:
- Press
G(Go To) - Enter
entryor an address - Click OK
Follow Code References
Click on a function call or data reference:
- Double-click to jump to the target
- Right-click for more options
- Use Back arrow to return (or
Alt+Left)
View Function Graph
To see a visual representation of the current function:
- Press
Ctrl+For click the graph icon - Displays control flow as a graph with basic blocks
Essential Keyboard Shortcuts
| Shortcut | Action |
|---|---|
G | Go to address/symbol |
L | Rename label/function |
C | Clear code |
D | Disassemble |
F | Create function |
; | Add comment (pre or post) |
Ctrl+F | Show function graph |
Ctrl+Shift+E | Edit function signature |
X | Show cross-references |
Basic Analysis Workflow Example
Find the Main Function
- Look in the Symbol Tree under Functions
- Search for
main,_main, orWinMain - Double-click to navigate to the function
Examine the Decompiler Output
Review the decompiled pseudocode:
- Understand the function’s logic
- Identify interesting function calls
- Note data references
Rename Variables and Functions
Make the code more readable:
- Click on a variable or function name
- Press
Lto rename - Enter a descriptive name
- Press
Enter
Add Comments
Document your findings:
- Position cursor at an instruction
- Press
;for pre-comment orShift+;for post-comment - Type your comment
- Press
Enter
Follow Interesting Calls
Investigate function calls:
- Double-click on a function call
- Analyze the called function
- Use Back to return
Running Scripts
Ghidra includes powerful scripting capabilities:Browse Available Scripts
Ghidra includes hundreds of pre-built scripts:
- Search by name or description
- Organized by category
Next Steps
Now that you’ve completed your first analysis, explore more advanced features:- Function Comparison: Compare functions across binaries
- Data Type Manager: Create custom structures and types
- Debugging: Use the integrated debugger for dynamic analysis
- BSim: Find similar functions across multiple binaries
- Custom Scripts: Write your own Python or Java scripts
- Version Tracking: Track changes between binary versions
For comprehensive documentation, tutorials, and reference materials, check the
docs directory in your Ghidra installation or access Help → Topics within Ghidra.Additional Resources
- Cheat Sheet:
<GhidraInstallDir>/docs/CheatSheet.html - Ghidra Class Materials:
<GhidraInstallDir>/docs/GhidraClass/ - API Documentation:
<GhidraInstallDir>/docs/GhidraAPI_javadoc.zip - Community: GitHub Discussions
