Replies: 2 comments 1 reply
-
I haven't been ignoring this, I've just been busy with getting things ready for the 11.3 release. I will likely spend a large chunk of time addressing things like this and other API improvements for the 11.4 release. Seems like you also can't import a module that you have added via the Bundle Manager, like you could with Jython. |
Beta Was this translation helpful? Give feedback.
-
I didn't think you're ignoring this, I know you're all busy (and it's still a holiday season, at least where I live).
That's true, though I wasn't sure if that's an intended design or not. I assumed the "proper" way to install library packages for pyghidra is to source ghidra_venv/bin/activate and Currently I work around that by doing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have a Ghidra library, that I want to use in my scripts and interactively. But I want to use Ghidra flat api directly - so for example in my library I want to be able to write this:
In Jython it was possible with the following import:
This works as expected - for example I can have multiple windows open, or multiple programs open in a single tool, and getCurrentLocation will always refer to the active one. How can I achieve the same thing with PyGhidra?
One workaround I found is that I can do:
But option 1 crashes as soon as Ghidra window stops being active (get_current_interpreter becomes none when I switch windows). Option2 on the other hand obviously becomes stale when I work on more than one program. I think the root issue is that all PyGhidra interpreters share state (including loaded modules).
Is there a way to have the same behaviour as in Jython using PyGhidra?
Use case my use case is that I use my library in scripts and interactively. For example I when type
deobfuscate("FUN_01234567")
in the interactive console, I want to refer to FUN_01234567 in the active program. Similarly, when I run DeobfuscateActiveFunction.py, I want the script to get active function for the active program.Beta Was this translation helpful? Give feedback.
All reactions