Ghidra: Only reset image base to zero for ELF binaries
This commit is contained in:
@@ -47,8 +47,10 @@ def SetHeaderComment(addr, text):
|
|||||||
setPlateComment(toAddr(addr), text)
|
setPlateComment(toAddr(addr), text)
|
||||||
|
|
||||||
def CustomInitializer():
|
def CustomInitializer():
|
||||||
# Do we need this for PE/MachO?
|
# Ghidra sets the image base for ELF to 0x100000 for some reason
|
||||||
currentProgram.setImageBase(toAddr(0), True)
|
# https://github.com/NationalSecurityAgency/ghidra/issues/1020
|
||||||
|
if currentProgram.getExecutableFormat().endswith('(ELF)'):
|
||||||
|
currentProgram.setImageBase(toAddr(0), True)
|
||||||
|
|
||||||
def GetScriptDirectory():
|
def GetScriptDirectory():
|
||||||
# Ghidra doesn't define __file__ so we have to iterate all the scripts
|
# Ghidra doesn't define __file__ so we have to iterate all the scripts
|
||||||
|
|||||||
Reference in New Issue
Block a user