Package ghidra.python

Class PythonScript


public class PythonScript extends GhidraScript
A Python version of a GhidraScript.
  • Constructor Details

    • PythonScript

      public PythonScript()
  • Method Details

    • run

      public void run()
      Description copied from class: GhidraScript
      The run method is where the script specific code is placed.
      Specified by:
      run in class GhidraScript
    • runScript

      public void runScript(String scriptName, GhidraState scriptState) throws Exception
      Description copied from class: GhidraScript
      Runs a script by name using the given state.

      It attempts to locate the script in the directories defined in GhidraScriptUtil.getScriptDirectories().

      The script being run uses the given GhidraState (e.g., script variables) Any changes to the state by the script being run will be reflected in the given state object. If the given object is the current state, the this scripts state may be changed by the called script.

      Overrides:
      runScript in class GhidraScript
      Parameters:
      scriptName - the name of the script to run
      scriptState - the Ghidra state
      Throws:
      IllegalArgumentException - if the script does not exist
      Exception - if any exceptions occur while running the script
      See Also:
    • getCategory

      public String getCategory()
      Description copied from class: GhidraScript
      Returns the category for this script.
      Overrides:
      getCategory in class GhidraScript
      Returns:
      the category for this script