Ghidra: Use getSourceFile to find Ghidra script location (#86)
`getAllScripts` was removed in a recent commit <2b49816c6c (diff-67260297e0f38cd74fe3ea2693266e52L555-L565)>
Use `getSourceFile` instead
This commit is contained in:
@@ -71,5 +71,4 @@ def CustomInitializer():
|
||||
currentProgram.setImageBase(toAddr(0), True)
|
||||
|
||||
def GetScriptDirectory():
|
||||
# Ghidra doesn't define __file__ so we have to iterate all the scripts
|
||||
return next(iter(filter(lambda x: x.getName() == '%SCRIPTFILENAME%', GhidraScriptUtil.getAllScripts())), None).getParentFile().toString()
|
||||
return getSourceFile().getParentFile().toString()
|
||||
|
||||
Reference in New Issue
Block a user