Package ghidra.python

Class PythonScriptProvider

    • Constructor Detail

      • PythonScriptProvider

        public PythonScriptProvider()
    • Method Detail

      • createNewScript

        public void createNewScript​(ResourceFile newScript,
                                    java.lang.String category)
                             throws java.io.IOException
        Description copied from class: GhidraScriptProvider
        Creates a new script using the specified file.
        Specified by:
        createNewScript in class GhidraScriptProvider
        Parameters:
        newScript - the new script file
        category - the script category
        Throws:
        java.io.IOException - if an error occurs writing the file
      • getCertifyHeaderStart NEW

        protected java.lang.String getCertifyHeaderStart()
        Description copied from class: GhidraScriptProvider
        Return the start of certification header line if this file type is subject to certification.
        Overrides:
        getCertifyHeaderStart in class GhidraScriptProvider
        Returns:
        start of certification header or null if not supported
      • getCertifyHeaderEnd NEW

        protected java.lang.String getCertifyHeaderEnd()
        Description copied from class: GhidraScriptProvider
        Return the end of certification header line if this file type is subject to certification.
        Overrides:
        getCertifyHeaderEnd in class GhidraScriptProvider
        Returns:
        end of certification header or null if not supported
      • getCertificationBodyPrefix NEW

        protected java.lang.String getCertificationBodyPrefix()
        Description copied from class: GhidraScriptProvider
        Return the prefix for each certification header bofy line if this file is subject to certification
        Overrides:
        getCertificationBodyPrefix in class GhidraScriptProvider
        Returns:
        certification heaber body prefix or null if not supported
      • getExtension

        public java.lang.String getExtension()
        Description copied from class: GhidraScriptProvider
        Returns the file extension for this type of script. For example, ".java" or ".py".
        Specified by:
        getExtension in class GhidraScriptProvider
        Returns:
        the file extension for this type of script
      • getScriptInstance

        public GhidraScript getScriptInstance​(ResourceFile sourceFile,
                                              java.io.PrintWriter writer)
                                       throws java.lang.ClassNotFoundException,
                                              java.lang.InstantiationException,
                                              java.lang.IllegalAccessException
        Description copied from class: GhidraScriptProvider
        Returns a GhidraScript instance for the specified source file.
        Specified by:
        getScriptInstance in class GhidraScriptProvider
        Parameters:
        sourceFile - the source file
        writer - the print writer to write warning/error messages
        Returns:
        a GhidraScript instance for the specified source file
        Throws:
        java.lang.ClassNotFoundException
        java.lang.InstantiationException
        java.lang.IllegalAccessException