Class DecompilerUtils

  • public class DecompilerUtils
    extends java.lang.Object
    • Constructor Detail

      • DecompilerUtils

        public DecompilerUtils()
    • Method Detail

      • getVarnodeRef

        public static Varnode getVarnodeRef​(ClangToken token)
        If the token refers to an individual Varnode, return it. Otherwise return null
        token - the token to check
        the Varnode or null otherwise
      • getForwardSlice

        public static java.util.Set<Varnode> getForwardSlice​(Varnode seed)
        Construct the set of varnodes making up a simple forward slice of seed
        seed - Varnode where the slice starts
        set of Varnodes in the slice
      • getBackwardSlice

        public static java.util.Set<Varnode> getBackwardSlice​(Varnode seed)
      • getForwardSliceToPCodeOps

        public static java.util.Set<PcodeOp> getForwardSliceToPCodeOps​(Varnode seed)
      • getBackwardSliceToPCodeOps

        public static java.util.Set<PcodeOp> getBackwardSliceToPCodeOps​(Varnode seed)
      • getFunction

        public static Function getFunction​(Program program,
                                           ClangFuncNameToken token)
        Returns the function represented by the given token. This will be either the decompiled function or a function referenced within the decompiled function.
        program - the program
        token - the token
        the function
      • findIndexOfFirstField

        public static int findIndexOfFirstField​(java.util.List<ClangToken> queryTokens,
                                                Field[] fields)
        Find index of first field containing a ClangNode in tokenList
        queryTokens - the list of tokens of interest
        fields - the universe of fields to check
        index of field, or -1
      • getTokensFromView

        public static java.util.List<ClangToken> getTokensFromView​(Field[] fields,
                                                                   Address address)
        Similar to getTokens(ClangNode, AddressSetView), but uses the tokens from the given view fields. Sometimes the tokens in the model (represented by the ClangNode) are different than the fields in the view (such as when a list of comment tokens are condensed into a single comment token).
        fields - the fields to check
        address - the address each returned token must match
        the matching tokens
      • getTokens

        public static java.util.List<ClangToken> getTokens​(ClangNode root,
                                                           AddressSetView addressSet)
        Find all ClangNodes that have a minimum address in the AddressSetView
        root - the root of the token tree
        addressSet - the addresses to restrict
        the list of tokens
      • isGoToStatement

        public static boolean isGoToStatement​(ClangToken token)
      • getDataType

        public static DataType getDataType​( context)
        Returns the data type for the given context if the context pertains to a data type
        context - the context
        the data type or null