From 3c1f4e94217a70b4ca9657e246799620aa8a0495 Mon Sep 17 00:00:00 2001 From: Camas Date: Fri, 2 Oct 2020 04:05:19 +0100 Subject: [PATCH] Ghidra: Use getSourceFile to find Ghidra script location (#86) `getAllScripts` was removed in a recent commit Use `getSourceFile` instead --- .../Outputs/ScriptResources/Targets/Ghidra.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Il2CppInspector.Common/Outputs/ScriptResources/Targets/Ghidra.py b/Il2CppInspector.Common/Outputs/ScriptResources/Targets/Ghidra.py index cc23e0a..bc7a370 100644 --- a/Il2CppInspector.Common/Outputs/ScriptResources/Targets/Ghidra.py +++ b/Il2CppInspector.Common/Outputs/ScriptResources/Targets/Ghidra.py @@ -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()