Skip to content

Scripting

The upstream Script Manager organizes scripts by category and supports filtering by name or description. A script’s metadata can supply a category, menu path, toolbar icon, and key binding. The In Tool option exposes the corresponding action in the tool.

  1. Open the Script Manager in CodeBrowser and inspect an existing small Java example.
  2. Read its source before running it. Scripts execute with your account’s permissions.
  3. Create a script in a user script directory, rather than modifying a bundled example.
  4. Make the first version report information without changing the program.
  5. Add cancellation checks and test against a disposable project before adding writes.

For Java scripts, verify the inherited methods against the bundled GhidraScript API documentation for your exact release. Do not assume Python environments are interchangeable: Jython, PyGhidra, and external CPython have different setup and compatibility requirements.

Record expected input, output, and supported application version. If a script changes symbols or types, make its selection rules explicit and log each change. Keep a before/after sample to catch unintended edits.

Headless automation must avoid GUI-only prompts and tool services. Use Headless mode once the script works on a controlled sample. VERIFY API availability against the release rather than copying snippets from development-branch Javadocs.


Sources: Script Manager help, tagged GhidraScript source.

Adapted from the Ghidra documentation (Apache 2.0).