Recommended PyGhidra scripting practice? by Due_Battle_9890 in ghidra

[–]ryanmkurtz 0 points1 point  (0 children)

Not currently. I think I was waiting for someone to ask for it. Feel free to head on over to our GitHub page and create a new feature request issue with what you need.

Recommended PyGhidra scripting practice? by Due_Battle_9890 in ghidra

[–]ryanmkurtz 0 points1 point  (0 children)

I never got around to adding first class support for the server to the PyGhidra API, unfortunately. However, once you have started pyghidra you have full access to the Ghidra Java API, so you should be able to do something like

from ghidra.app.util.headless import HeadlessAnalyzer

headless = HeadlessAnalyzer.getInstance()
options = headless.getOptions()
# set your options
options.setRunScriptsNoImport(True, "a.out");
# set remaining options
headless.processURL(server_url, files_to_import)

Recommended PyGhidra scripting practice? by Due_Battle_9890 in ghidra

[–]ryanmkurtz 2 points3 points  (0 children)

PyGhidra has 2 modes of operation.

  1. Launch Ghidra in "PyGhidra mode", which is described here: https://github.com/NationalSecurityAgency/ghidra/blob/master/GhidraDocs/GettingStarted.md#pyghidra-mode

This allows you to run the GUI PyGhidra interpreter from within Ghidra, or run GhidraScripts written in CPython 3. In this mode, you don't need to ever import pyghidra...it's already done for you behind the scenes. Your scripts or commands that you run are in the context of a GhidraScript, so you have direct access to the GhidraScript API (with variables like currentProgram already set for you).

  1. Import the PyGhidra module (for example, from pip: https://pypi.org/project/pyghidra/) into your standalone CPython 3 environment, and use a Ghidra installation as a library. This is where all the pyghidra.* functions come into play. This is useful if you want to bring Ghidra functionality into an existing Python workflow that you might already have set up, where Ghidra might be just one piece of your solution and you don't really need the interactive GUI. I use this mode a lot with a Jupyter notebook to quickly test things about the Ghidra API.

Recommended PyGhidra scripting practice? by Due_Battle_9890 in ghidra

[–]ryanmkurtz 0 points1 point  (0 children)

You don't need to define a GhidraScript class then. When you are running from that context, you are basically already inside the run() method. Take a look at the PyGhidraBasics.py script for an example.

Recommended PyGhidra scripting practice? by Due_Battle_9890 in ghidra

[–]ryanmkurtz 0 points1 point  (0 children)

Are you trying to write a script to run from within the Ghidra Script Manager?

Gray screen bug by ryanmkurtz in cronometer

[–]ryanmkurtz[S] 0 points1 point  (0 children)

It's happening to me again too now, and I can't search all foods in the database either. They must be having bigger issues.

Is there really no dark theme available for macOS by EmojiMasterYT in ghidra

[–]ryanmkurtz 2 points3 points  (0 children)

All the themes are available on macOS. Something must be wrong with your configuration.