Skip to content

Latest commit

 

History

History
39 lines (21 loc) · 1.78 KB

adjusting-binarys-base-address-to-match-ghidra-during-debugging.md

File metadata and controls

39 lines (21 loc) · 1.78 KB
description
11/01/2023

Adjusting Binary's Base Address to Match Ghidra During Debugging

Introduction

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!

How-to

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