Class HighFunction

  • All Implemented Interfaces:
    PcodeFactory

    public class HighFunction
    extends PcodeSyntaxTree
    High-level abstraction associated with a low level function made up of assembly instructions. Based on information the decompiler has produced after working on a function.
    • Field Detail

      • DECOMPILER_TAG_MAP

        public static final java.lang.String DECOMPILER_TAG_MAP
        See Also:
        Constant Field Values
    • Constructor Detail

      • HighFunction

        public HighFunction​(Function function,
                            Language language,
                            CompilerSpec compilerSpec,
                            PcodeDataTypeManager dtManager,
                            boolean showNamespace)
        Parameters:
        function - function associated with the higher level function abstraction.
        language - description of the processor language of the function
        compilerSpec - description of the compiler that produced the function
        dtManager - data type manager
        showNamespace - true signals to print function names with their namespace
    • Method Detail

      • getFunction

        public Function getFunction()
        Returns:
        get the associated low level function
      • getLanguage

        public Language getLanguage()
        Returns:
        get the language parser used to disassemble
      • getFunctionPrototype

        public FunctionPrototype getFunctionPrototype()
        Returns:
        the function prototype for the function (how things are passed/returned)
      • getJumpTables

        public JumpTable[] getJumpTables()
        Returns:
        an array of jump table definitions found for this function decompilation
      • getLocalSymbolMap

        public LocalSymbolMap getLocalSymbolMap()
        Returns:
        the local variable map describing the defined local variables
      • grabFromFunction

        public void grabFromFunction​(int overrideExtrapop,
                                     boolean includeDefaultNames,
                                     boolean doOverride)
        Populate the information for the HighFunction from the information in the Function object.
        Parameters:
        overrideExtrapop - is the value to use if extrapop is overridden
        includeDefaultNames - is true if default symbol names should be considered locked
        doOverride - is true if extrapop is overridden
      • splitOutMergeGroup

        public HighVariable splitOutMergeGroup​(HighVariable high,
                                               Varnode vn)
                                        throws PcodeException
        If a HighVariable consists of more than one (forced) merge group, split out the group that contains vn as a separate HighVariable. Otherwise just return the original high.
        Parameters:
        high - is the HighVariable to split
        vn - is a representative of the merge group to split out
        Returns:
        a HighVariable containing just the forced merge group of vn
        Throws:
        PcodeException - if the split can't be performed
      • buildFunctionXML

        public java.lang.String buildFunctionXML​(Address entryPoint,
                                                 int size)
        Build an XML string that represents all the information about this HighFunction. The size describes how many bytes starting from the entry point are used by the function, but this doesn't need to be strictly accurate as it is only used to associate the function with addresses near its entry point.
        Parameters:
        entryPoint - pass null to use the function entryPoint, pass an address to force an entry point
        size - describes how many bytes the function occupies as code
        Returns:
        the XML string
      • buildFunctionShellXML

        public static java.lang.String buildFunctionShellXML​(java.lang.String name,
                                                             Address addr)
        Build the XML representation of only the shell function info not including everything known about the function.
        Parameters:
        name - name of the function
        addr - address the function is located at
        Returns:
        the XML string
      • getErrorHandler

        public static org.xml.sax.ErrorHandler getErrorHandler​(java.lang.Object errOriginator,
                                                               java.lang.String targetName)
      • findCreateOverrideSpace

        public static Namespace findCreateOverrideSpace​(Function func)
      • stringTree

        public static XmlPullParser stringTree​(java.io.InputStream xml,
                                               org.xml.sax.ErrorHandler handler)
                                        throws PcodeXMLException
        Create XML parse tree from an input XML string TODO: this probably doesn't belong here.
        Parameters:
        xml - is the XML string to parse
        handler - is the handler to use for parsing errors
        Returns:
        the XML tree
        Throws:
        PcodeXMLException - for format errors in the XML
      • createNamespaceTag

        public static void createNamespaceTag​(java.lang.StringBuilder buf,
                                              Namespace namespc)
      • tagFindExclude

        public static java.lang.String tagFindExclude​(java.lang.String tagname,
                                                      java.lang.String doc)
        Parameters:
        tagname - -- Name of tag to search for
        doc - -- String through which to search for tags
        Returns:
        all characters between beginning and ending XML tags, excluding tags themselves