-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Describe the bug:
As per subject, accessing resources bundled in an extension's data/ directory is not possible from a Ghidra run configuration. Application.getModuleDataFile and similar functions in the Ghidra framework will fail as they will search for files in the compiled classes root (usually under build/classes/{kotlin,java}/main) rather than in the root of the zip file the extension is packaged as (see Application.getMyModuleRootDirectory in ghidra.framework).
Steps to reproduce:
Put some files in an extension's data/ directory and try to access them from your extension code.
Expected behavior:
The extension can access the bundled files correctly.
Additional context:
I suppose this also affects extensions that package their own Sleigh files which, coincidentally, should be put in the data/ directory as well. I was going to see how to have the IntelliJ plugin launch Ghidra with custom Sleigh files in an extension at a later stage but I stumbled on this issue earlier than I thought.
Now, I'm not sure if this is something that should be handled on the plugin's side by copying or linking the data/ directory in the appropriate place or if it is the Gradle build script's task to do that. I guess either way works for me, but one has to remember to add the copy/link operation in the Gradle script on every project as it is not part of the generated template (and I cannot really fault Ghidra's developers for that...).