description |
---|
11/01/2023 |
Did you ever have to both reverse and debug a binary simultaneously but you found that switching back and forth addresses were a pain because they were not matching?
This is the fix for that!
Fire up gdb
and be sure to run your binary and break at a specific point, it doesn't matter where.
Run vmmap
to list out all memory regions within the binary:
0x555555554000
is our binary's base address
Great, now that we have established that 0x555555554000
is our base address for our binary, we can add that information to Ghidra and align our memory addresses accordingly.
With your binary in Ghidra, select the "RAM" button in the menu bar:
Memory Map
Once inside, select the "home" button:
Base Image
Once inside, assign the base address the according value obtained from gdb
:
Base Image Address Established
We can now see that our instructions and addresses are aligned accordingly! Ultimately, making our efforts way easier.
gdb
disassembly
Ghidra Disassembly