Package ghidra.pyghidra
Class PyGhidraScriptProvider
java.lang.Object
ghidra.app.script.GhidraScriptProvider
ghidra.app.script.AbstractPythonScriptProvider
ghidra.pyghidra.PyGhidraScriptProvider
- All Implemented Interfaces:
ExtensionPoint
,Comparable<GhidraScriptProvider>
GhidraScript
provider for native python3 scripts-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a description for this type of script.Returns an optional runtime environment name of aGhidraScriptProvider
that scripts can specify they require to run under.getScriptInstance
(ResourceFile sourceFile, PrintWriter writer) Returns a GhidraScript instance for the specified source file.static void
setScriptRunner
(Consumer<GhidraScript> scriptRunner) Sets the Python side script runner.Methods inherited from class ghidra.app.script.AbstractPythonScriptProvider
createNewScript, getBlockCommentEnd, getBlockCommentStart, getCertificationBodyPrefix, getCertifyHeaderEnd, getCertifyHeaderStart, getCommentCharacter, getExtension
Methods inherited from class ghidra.app.script.GhidraScriptProvider
compareTo, deleteScript, equals, fixupName, hashCode, toString, writeBody, writeHeader
-
Constructor Details
-
PyGhidraScriptProvider
public PyGhidraScriptProvider()
-
-
Method Details
-
setScriptRunner
Sets the Python side script runner. This method is for internal use only and is only public so it can be called from Python.- Parameters:
scriptRunner
- the Python side script runner- Throws:
AssertException
- if the script runner has already been set
-
getDescription
Description copied from class:GhidraScriptProvider
Returns a description for this type of script.- Specified by:
getDescription
in classAbstractPythonScriptProvider
- Returns:
- a description for this type of script
-
getRuntimeEnvironmentName
Description copied from class:GhidraScriptProvider
Returns an optional runtime environment name of aGhidraScriptProvider
that scripts can specify they require to run under. Useful for when more than oneGhidraScriptProvider
uses the same file extension.- Specified by:
getRuntimeEnvironmentName
in classAbstractPythonScriptProvider
- Returns:
- an optional runtime environment name of a
GhidraScriptProvider
that scripts can specify they require to run under (could be null if there is no requirement) - See Also:
-
getScriptInstance
public GhidraScript getScriptInstance(ResourceFile sourceFile, PrintWriter writer) throws GhidraScriptLoadException Description copied from class:GhidraScriptProvider
Returns a GhidraScript instance for the specified source file.- Specified by:
getScriptInstance
in classAbstractPythonScriptProvider
- Parameters:
sourceFile
- the source filewriter
- the print writer to write warning/error messages. If the error prevents success, throw an exception instead. The caller will print the error.- Returns:
- a GhidraScript instance for the specified source file
- Throws:
GhidraScriptLoadException
- when the script instance cannot be created
-