A complete walkthrough of the Ghidra CodeBrowser interface: what every panel does, how to navigate functions, understand the decompiler output, and start analyzing a real binary.
Ghidra; Complete Reverse Engineering Series | Part 3 of 60
| Phase | # | Title | Status |
|---|---|---|---|
| 1 | What Is Ghidra and Why Should I Care? | ||
| 2 | Installing Ghidra; Java, Download, First Launch | ||
| 3 | The CodeBrowser; Every Window Explained | ||
| 4 | Importing Your First Binary; What Ghidra Detects | ||
| 5 | Finding Your Way Around; Strings, XREFs, Navigation | coming soon | |
| 6 | Ghidra Projects; Saving, Exporting, Organizing | coming soon |
β Part 2; Installing Ghidra | Next β Part 4; Importing Your First Binary
The CodeBrowser - Every Window Explained
When the CodeBrowser opened for the first time, I counted eight different panels staring back at me. I had no idea what most of them were for. I just knew the center one had a lot of assembly and the right one had something that looked like C code. That was it.
This part maps every single window: what it is, what itβs for, and what you actually see in it when a real binary is loaded.
Quick Recap From Part 2
- Ghidra needs JDK 21 (not JRE, not older versions)
- The binary we use throughout this series is
crackme_ghidra, a simple serial checker - Ghidra stores your analysis in a project; the original binary is never modified
- We created a
GhidraPracticeproject and itβs ready to go
The Binary Weβre Using
Throughout Phase 1 and Phase 2, we use the same binary. Itβs a simple serial checker written in C:
#include <stdio.h>
#include <string.h>
int check_serial(char *input) {
char *secret = "iotsec2024";
int len = strlen(input);
if (len != 10) return -1;
return strcmp(input, secret);
}
int main() {
char buf[64];
printf("Enter serial: ");
scanf("%63s", buf);
if (check_serial(buf) == 0) {
printf("Valid serial!\n");
} else {
printf("Invalid.\n");
}
return 0;
}
To compile it yourself:
On Linux (32-bit ELF):
gcc -m32 -o crackme_ghidra crackme_ghidra.c
# if missing multilib: sudo apt install gcc-multilib
On Linux, cross-compile for Windows (64-bit exe):
sudo apt install mingw-w64
x86_64-w64-mingw32-gcc -o crackme_ghidra.exe crackme_ghidra.c
Or just download the compiled binary directly: (link coming, check the GitHub folder)
Windows Defender warning: Any crackme or reversing binary will trigger Defender. It pattern-matches on file structure, not actual malware behavior. Add your
ghidra_seriesfolder as an exclusion in Windows Security, or allow the threat when prompted. The binary is safe. You have the source code above.
Importing the Binary Into Ghidra
Before we can see any windows with real data, we need to import the binary into our project.
Open Ghidra β open your GhidraPractice project β File β Import File β select crackme_ghidra.exe
Ghidra will show you an import summary dialog. It auto-detects:
- Format: Portable Executable (PE)
- Language: x86 LE 64-bit
- Destination: your project folder
Donβt touch any options. Click OK.
After importing, double-click the binary in your project to open it in CodeBrowser. Ghidra will ask if you want to analyze it; click Yes, leave all options as default, click Analyze.
Analysis runs for a few seconds. Youβll see a progress bar in the bottom right. When it finishes, you might see a warning:
PDB universal warning: could not find the appropriate PDB file
Ignore this. PDB files are Windows debug symbols. We donβt have them. Ghidra just notes it and moves on. Click OK.
Now the CodeBrowser is open with real data. Eight panels. Letβs go through each one.
The Eight Windows
1. Listing Window; The Disassembly
This is the big center panel. Itβs where you spend most of your time.
Think of your binary like a song stored as an MP3: just raw bytes. When you open it in Ghidra, the Listing window is like a sheet music view of those bytes. It translates the raw bytes into assembly instructions so a human can read them. The bytes on disk didnβt change. The Listing window is just a translation.
Each line has this structure:
ADDRESS | RAW BYTES | MNEMONIC | OPERANDS | COMMENTS
1400015f6 48 83 ec 30 SUB RSP, 0x30
1400015fa 48 89 4d 10 MOV qword ptr [RBP + local_res8], param_1
1400015fe 48 8d 05 ... LEA RAX, [s_iotsec2024_140010000] = "iotsec2024"
- Address: where in memory this instruction lives. Think of RAM as a long street. Every house has a number. This is the house number.
- Raw bytes (shown in blue): the actual binary data.
48 83 ec 30in hex. This is what the CPU actually reads. - Mnemonic: the human-readable instruction name.
SUB= subtract.MOV= move.LEA= load address. Assembly language. - Operands: what the instruction operates on.
RSP, 0x30means βsubtract 0x30 from RSP.β - Comments: Ghidra auto-adds comments when it recognizes something (like a string). You can add your own with the
;key.
There are no column headers; you learn the positions by pattern after a few sessions.
2. Decompiler Window; The Pseudo-C
This is the right-side panel. It shows something that looks like C code.
Ghidra looks at the assembly instructions, recognizes patterns (βthis looks like a for loop, this looks like an if-else, this looks like a function callβ) and reconstructs what the original C code might have looked like. Keyword: might.
Hereβs what Ghidra gave us for check_serial. Compare it to what I originally wrote:
Original source:
int check_serial(char *input) {
char *secret = "iotsec2024";
int len = strlen(input);
if (len != 10) return -1;
return strcmp(input, secret);
}
Ghidraβs decompiled version:
int check_serial(char *param_1)
{
int iVar1;
size_t sVar2;
sVar2 = strlen(param_1);
if ((int)sVar2 == 10) {
iVar1 = strcmp(param_1,"iotsec2024");
}
else {
iVar1 = -1;
}
return iVar1;
}
Same logic. But notice:
inputbecameparam_1: Ghidra stripped the original variable names during compilation.- The
secretvariable disappeared: the compiler optimized it away and inlined the string directly. - Extra variables
iVar1,sVar2appeared, representing CPU registers in Ghidraβs output.
The logic is correct. The names are wrong. The structure is slightly different.
The most important thing about the decompiler: it will never say βIβm not sure.β It always shows clean-looking C code, even when it has misunderstood something. It can be confidently wrong. Use it to get the big picture, then verify the details in the Listing window.
3. Symbol Tree; The Index
This is the top-left panel. It has: Imports, Exports, Functions, Labels, Classes, Namespaces.
Think of it like the index page of a book. The book is your binary. The index doesnβt contain the content; it just tells you where everything is. βFunction check_serial at 0x1400015f6.β
Imports: functions this binary borrows from outside. Our crackme imports from kernel32.dll, msvcrt.dll, etc. It doesnβt implement printf itself; it borrows it. Expand Imports and youβll see every external function the binary uses.
In malware analysis, this is one of the first things you check. A binary that imports CreateRemoteThread, WriteProcessMemory, VirtualAllocEx is doing process injection. You know that before reading a single instruction.
Exports: functions this binary offers to other programs. Our crackme doesnβt offer anything; itβs a standalone program. Youβll see some mingw runtime entries there but those are compiler noise, not our code. Exports matter when analyzing DLLs.
Functions: every function Ghidra found inside the binary, organized alphabetically. This is where you start when reversing an unknown binary. Find main, find suspicious function names, double-click to navigate directly.
Labels: named memory addresses. Remember that LEA RAX, [s_iotsec2024_140010000] line? The string "iotsec2024" lives at address 0x140010000. Instead of making you remember that raw number, Ghidra sticks a label on it: s_iotsec2024_140010000. Like a DNS name for a memory address: instead of remembering 142.250.182.46, you just use google.com.
Classes: empty for our C program. Relevant for C++ binaries.
Namespaces: grouping of symbols. Not critical for now.
4. Program Tree; The Sections Map
Top-left panel, switchable with Symbol Tree. Shows the binaryβs memory sections.
Think of a building with different floors for different purposes. Ground floor is the shop, first floor is office, second floor is storage. Your binary is the same, divided into sections with specific jobs:
.text β the code lives here. CPU executes instructions from here.
.data β global variables that have initial values (stored on disk)
.bss β global variables with no initial value (just reserved zero memory)
.rdata β read-only data. Hardcoded strings live here.
.bss exists separately from .data for efficiency. If you have a 1MB array that starts as all zeros, why store 1MB of zeros on disk? .bss just says βreserve 1MB of zeroed memory hereβ; the OS fills it at runtime. Saves disk space.
Our hardcoded string "iotsec2024" lives in .rdata at 0x140010000. If there were 100 hardcoded strings in this binary, all 100 would be in .rdata. In malware analysis, .rdata is where you look for URLs, IP addresses, registry keys, passwords, anything hardcoded by the developer.
5. Data Type Manager; The Dictionary
Bottom-left panel.
Ghidra uses this internally to know what a int is, what a char* is, what a size_t is. When it sees 4 bytes in memory, it checks here to decide βthese are an int.β When it sees 8 bytes, βthese are a pointer.β
You can also define your own custom structs here, useful later when reversing binary protocols or file formats where you know the structure but Ghidra doesnβt.
Not much to explore right now. Just know it exists and what itβs for.
6. Console; The Log
Bottom panel.
Ghidraβs log window. Analysis messages, warnings, scripting output, errors all appear here. That PDB warning you saw during analysis appeared here. When you run scripts later in Phase 6, their output appears here too.
Nothing interactive for now. But worth checking if something behaves unexpectedly; the reason is usually logged here.
7. Function Graph; The Flowchart
Not open by default. To open it: make sure your cursor is inside a function in the Listing window, then Window β Function Graph.
This is the window that looks scary on first launch. Itβs actually the most useful one once you understand what youβre looking at.
The Function Graph takes one function and draws it as a flowchart. Every block of code that runs sequentially becomes a box. Every branch (every if/else, every loop) becomes an arrow between boxes.
Hereβs what main looks like in the Function Graph:
βββββββββββββββββββββββββββββββββββ
β 140001638 - main β
β PUSH RBP, MOV, SUB... β
β CALL printf (Enter serial:) β
β CALL scanf β
β CALL check_serial β
β TEST EAX, EAX β
β JNZ βββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββ
β (green/true) β (red/false)
βΌ βΌ
βββββββββββββββββββ ββββββββββββββββββββββββ
β 140001674 β β 140001682 β
β "Valid serial!"β β "Invalid." β
β CALL printf β β CALL printf β
β JMP ββββββββ β ββββββββββββ¬βββββββββββββ
βββββββββββββββββββ β
βββββββββββ βββββββββ
βΌ βΌ
ββββββββββββββββββ
β 14000168e β
β MOV EAX, 0 β
β ADD RSP, 0x60 β
β POP RBP β
β RET β
ββββββββββββββββββ
Four boxes. Two paths. One exit.
The arrows are color coded: green = condition true, red = condition false. That JNZ instruction at the bottom of the main block is your if/else from the C code, drawn as a branch.
Hereβs the key insight: you can identify code structure just by looking at the shape of the blocks, without reading a single instruction.
Two blocks merging into one exit block = if/else. A block with an arrow looping back to itself = a loop. A block branching into many paths = a switch statement. You learn to recognize these shapes. Itβs a skill that builds fast.
8. Bytes Window; The Ground Truth
Window β Bytes
Raw hex view of the binary. Address on the left, hex bytes in the middle, ASCII representation on the right. No interpretation. No disassembly. No decompiler. Just bytes.
This window exists for one reason: when the decompiler lies to you, this is the ground truth.
The decompiler can be confidently wrong. The bytes cannot. When something in the decompiler looks suspicious or doesnβt make sense, you come here and read the actual bytes. Also useful when analyzing file formats, binary protocols, or encrypted data where you need exact byte values, not Ghidraβs interpretation.
The Workflow Loop
Now that you know all eight windows, hereβs how they actually work together during real reverse engineering:
LISTING WINDOW
(find the function, read assembly)
β
DECOMPILER
(get the big picture: what is this function doing?)
β
SYMBOL TREE / REFERENCES
(who calls this? what does it call?)
β
Back to LISTING WINDOW
(verify what the decompiler said, check the actual instructions)
β
FUNCTION GRAPH
(if the logic is complex, visualize the control flow)
β
BYTES WINDOW
(if something still doesn't add up, check the raw bytes)
This loop (Listing β Decompiler β References β Listing) is reverse engineering. Everything else is just supporting that loop.
Navigation Shortcuts; Memorize These
You will use these every single session. Learn them now.
| Shortcut | What it does |
|---|---|
G |
Go to any address; type it in and jump |
Double-click on a function name |
Navigate directly to that function |
Alt + Left |
Go back (like browser back button) |
Ctrl + F |
Search in the Listing window |
L |
Rename a label or variable |
T |
Retype a variable (change its data type) |
; |
Add a comment at the current address |
Ctrl + Shift + F |
Search for text across all windows |
The two youβll use most in Phase 1: G to jump to addresses and Alt+Left to go back when youβve navigated somewhere and want to return.
What I Found Confusing (And Now Donβt)
1. Eight panels open at once felt overwhelming
I didnβt know where to look first. The answer is: start with the Listing window in the center. Everything else supports it. Once I understood that, the layout made sense.
2. The decompiler looked too good to be true
It showed almost exactly the code I wrote. I thought βthis is amazing, why would anyone read assembly?β Then I realized: on a real binary, without source code, with optimizations and obfuscation, the decompiler wonβt be this clean. Our crackme is simple. Real binaries are not. The decompiler is a starting point, not a final answer.
3. Raw bytes vs mnemonic: whatβs the difference?
Both represent the same instruction. 48 83 ec 30 is the CPUβs version. SUB RSP, 0x30 is the humanβs version. Ghidra translates one to the other. The bytes are what actually exist on disk. The mnemonic is Ghidraβs translation for us.
4. The Function Graph looked scary
Four boxes and some arrows. Thatβs it. Once I stopped trying to read every instruction inside the boxes and just looked at the shape (how many boxes, how they connect, where the arrows go) and it immediately made sense. The shape tells you the structure. The instructions inside tell you the details. Learn the shape first.
5. Exports were not empty on our binary
I expected exports to be empty since weβre not writing a DLL. But mingw adds its own runtime functions and marks some as exports. Those are compiler internals, not our code. The only one worth noting is WinMainCRTStartup, the actual Windows entry point that runs before main().
Hands-On Summary; What We Did
1. Compiled crackme_ghidra.exe (or downloaded directly)
2. File β Import File β selected crackme_ghidra.exe
3. Kept all import options as default β clicked OK
4. Double-clicked binary in project β CodeBrowser opened
5. Clicked Analyze β left all analysis options as default β clicked Analyze
6. Dismissed PDB warning (safe to ignore)
7. Explored Listing Window: found address, raw bytes, mnemonic, operands columns
8. Read check_serial in Decompiler, compared to original source
9. Explored Symbol Tree: Imports (kernel32.dll etc), Functions (check_serial, main)
10. Explored Program Tree: .text, .rdata, .data sections
11. Found "iotsec2024" string in .rdata at 0x140010000
12. Opened Function Graph (Window β Function Graph): saw main as 4-block flowchart
13. Identified if/else structure from block shape alone
14. Opened Bytes Window (Window β Bytes): raw hex view
What We Learned
| Term | What it means |
|---|---|
| Listing Window | Disassembly view: address, raw bytes, assembly instructions, comments |
| Decompiler | Reconstructs pseudo-C from assembly; useful but not always accurate, verify in Listing |
| Mnemonic | The human-readable assembly instruction name (SUB, MOV, LEA, CALL etc) |
| Operands | What an instruction operates on: registers, memory addresses, values |
| Symbol Tree | Index of everything in the binary: functions, imports, exports, labels |
| Imports | Functions the binary borrows from external DLLs |
| Exports | Functions the binary offers to other programs |
| Labels | Named memory addresses (like DNS names for raw hex addresses) |
| Program Tree | Shows the binaryβs memory sections (.text, .data, .bss, .rdata) |
| .text | Section where executable code lives |
| .rdata | Read-only data section; hardcoded strings live here |
| .bss | Zero-initialized memory reserved at runtime, not stored on disk |
| Function Graph | Visual flowchart of a single function; control flow as boxes and arrows |
| Bytes Window | Raw hex view of the binary; ground truth when the decompiler misleads |
| PDB file | Windows debug symbols; Ghidra warns when missing, safe to ignore |
Coming Up Next; Part 4: Importing Your First Binary
We imported a binary in this part, but we skipped a lot of what happened during that import dialog and the analysis phase. Part 4 goes deep on exactly that: what Ghidra is detecting when you import, what auto-analysis is actually doing, and what all those options in the import dialog mean. By the end of Part 4, youβll understand what Ghidra knows about your binary before youβve looked at a single instruction.
Resources
- Ghidra Official Documentation; NSAβs docs, actually well written
- OllyDbg From Zero Series; IoTSec.in: compare how a Windows debugger works vs Ghidraβs static approach
- Mirai Botnet Series; IoTSec.in: ELF binaries in context, relevant when we hit Phase 5
- Ghidra Series Index; Start Here (Part 1)
β Part 2; Installing Ghidra |
Series Index | Next β Part 4; Importing Your First Binary







