Package ghidra.app.script
Class UnsupportedScriptProvider
java.lang.Object
ghidra.app.script.GhidraScriptProvider
ghidra.app.script.UnsupportedScriptProvider
- All Implemented Interfaces:
ExtensionPoint
,Comparable<GhidraScriptProvider>
A stub provider for unsupported scripts. These will typically be scripts with supported
extensions but unsupported
ScriptInfo.AT_RUNTIME
tags.-
Constructor Summary
ConstructorDescriptionUnsupportedScriptProvider
(GhidraScriptProvider baseProvider) Creates a newUnsupportedScriptProvider
that is derived from the given base provider. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createNewScript
(ResourceFile newScript, String category) Creates a new script using the specified file.Returns a Pattern that matches block comment closings.Returns a Pattern that matches block comment openings.protected String
Return the prefix for each certification header body line if this file is subject to certification.protected String
Return the end of certification header line if this file type is subject to certification.protected String
Return the start of certification header line if this file type is subject to certification.Returns the comment character.Returns a description for this type of script.Returns the file extension for this type of script.getScriptInstance
(ResourceFile sourceFile, PrintWriter writer) Returns a GhidraScript instance for the specified source file.Methods inherited from class ghidra.app.script.GhidraScriptProvider
compareTo, deleteScript, equals, fixupName, getRuntimeEnvironmentName, hashCode, toString, writeBody, writeHeader
-
Constructor Details
-
UnsupportedScriptProvider
public UnsupportedScriptProvider() -
UnsupportedScriptProvider
Creates a newUnsupportedScriptProvider
that is derived from the given base provider. The base provider is any provider with a compatible extension, but without the requiredScriptInfo.AT_RUNTIME
tag.- Parameters:
baseProvider
- The baseGhidraScriptProvider
-
-
Method Details
-
getDescription
Description copied from class:GhidraScriptProvider
Returns a description for this type of script.- Specified by:
getDescription
in classGhidraScriptProvider
- Returns:
- a description for this type of script
-
getExtension
Description copied from class:GhidraScriptProvider
Returns the file extension for this type of script.For example, ".java" or ".py".
- Specified by:
getExtension
in classGhidraScriptProvider
- Returns:
- the file extension for this type of script
-
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 classGhidraScriptProvider
- 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
-
createNewScript
Description copied from class:GhidraScriptProvider
Creates a new script using the specified file.- Specified by:
createNewScript
in classGhidraScriptProvider
- Parameters:
newScript
- the new script filecategory
- the script category- Throws:
IOException
- if an error occurs writing the file
-
getCommentCharacter
Description copied from class:GhidraScriptProvider
Returns the comment character.For example, "//" or "#".
- Specified by:
getCommentCharacter
in classGhidraScriptProvider
- Returns:
- the comment character
-
getBlockCommentStart
Description copied from class:GhidraScriptProvider
Returns a Pattern that matches block comment openings.If block comments are not supported by this provider, then this returns null.
- Overrides:
getBlockCommentStart
in classGhidraScriptProvider
- Returns:
- the Pattern for block comment openings, null if block comments are not supported
-
getBlockCommentEnd
Description copied from class:GhidraScriptProvider
Returns a Pattern that matches block comment closings.If block comments are not supported by this provider, then this returns null.
- Overrides:
getBlockCommentEnd
in classGhidraScriptProvider
- Returns:
- the Pattern for block comment closings, null if block comments are not supported
-
getCertifyHeaderStart
Description copied from class:GhidraScriptProvider
Return the start of certification header line if this file type is subject to certification.- Overrides:
getCertifyHeaderStart
in classGhidraScriptProvider
- Returns:
- start of certification header or null if not supported
-
getCertificationBodyPrefix
Description copied from class:GhidraScriptProvider
Return the prefix for each certification header body line if this file is subject to certification.- Overrides:
getCertificationBodyPrefix
in classGhidraScriptProvider
- Returns:
- certification header body prefix or null if not supported
-
getCertifyHeaderEnd
Description copied from class:GhidraScriptProvider
Return the end of certification header line if this file type is subject to certification.- Overrides:
getCertifyHeaderEnd
in classGhidraScriptProvider
- Returns:
- end of certification header or null if not supported
-