2

What is the way to get the program base address in Ghidra?

5

You can use currentProgram.getImageBase() to obtain the base address. This returns an Address object.

Example

>>> currentProgram.getImageBase()
00400000

>>> type(currentProgram.getImageBase())
<type 'ghidra.program.model.address.GenericAddress'>

>>> currentProgram.getImageBase().getOffset()
4194304L

>>> hex(currentProgram.getImageBase().getOffset())
'0x400000L'
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.