Class DecompileCallback


  • public class DecompileCallback
    extends java.lang.Object
    Routines that the decompiler invokes to gather info during decompilation of a function.
    • Method Detail

      • setFunction

        public void setFunction​(Function func,
                                Address entry,
                                DecompileDebug dbg)
        Establish function and debug context for next decompilation
        Parameters:
        func - is the function to be decompiled
        entry - is the function's entry address
        dbg - is the debugging context (or null)
      • getNativeMessage

        public java.lang.String getNativeMessage()
        Returns:
        the last message from the decompiler
      • setShowNamespace

        public void setShowNamespace​(boolean showNamespace)
      • readXMLSize

        public int readXMLSize​(java.lang.String addrxml)
      • getBytes

        public byte[] getBytes​(java.lang.String addrxml)
      • getComments

        public java.lang.String getComments​(java.lang.String addrstring,
                                            java.lang.String types)
        Collect any/all comments for the function starting at the indicated address
        Parameters:
        addrstring - is the XML rep of function address
        types - is the string encoding of the comment type flags
        Returns:
        XML document describing comments
      • getPcodePacked

        public PackedBytes getPcodePacked​(java.lang.String addrstring)
      • buildInstruction

        public static java.lang.String buildInstruction​(PcodeOp[] ops,
                                                        int fallthruoffset,
                                                        int paramshift,
                                                        AddressFactory addrFactory)
        Build an XML representation of all the pcode op's a given Instruction is defined to perform.
        Parameters:
        ops - pcode ops
        fallthruoffset - number of bytes after instruction start that pcode flow falls into
        paramshift - special instructions for injection use
        addrFactory - is the address factory for recovering address space names
        Returns:
        XML document as string representing all the p-code
      • getPcodeInject

        public java.lang.String getPcodeInject​(java.lang.String nm,
                                               java.lang.String context,
                                               int type)
      • getCPoolRef

        public java.lang.String getCPoolRef​(long[] refs)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getSymbol

        public java.lang.String getSymbol​(java.lang.String addrstring)
      • getMappedSymbolsXML

        public java.lang.String getMappedSymbolsXML​(java.lang.String addrstring)
        Called by the native decompiler to query the GHIDRA database about any symbols at the given address.
        Parameters:
        addrstring - XML encoded address to query
        Returns:
        XML encoded result. Either function, reference, datatype, or hole
      • getExternalRefXML

        public java.lang.String getExternalRefXML​(java.lang.String addrstring)
      • getType

        public java.lang.String getType​(java.lang.String name,
                                        java.lang.String idstr)
      • getRegister

        public java.lang.String getRegister​(java.lang.String name)
      • getRegisterName

        public java.lang.String getRegisterName​(java.lang.String addrstring)
      • getTrackedRegisters

        public java.lang.String getTrackedRegisters​(java.lang.String addrstring)
      • getUserOpName

        public java.lang.String getUserOpName​(java.lang.String indexStr)