Class VtableUtils

java.lang.Object
ghidra.app.cmd.data.rtti.gcc.VtableUtils

public class VtableUtils
extends Object
  • Field Details

  • Method Details

    • getNumPtrDiffs

      public static int getNumPtrDiffs​(Program program, Address address)
      Gets the number of ptrdiff_t's in the vtable_prefix at the address
      Parameters:
      program - the program containing the vtable_prefix
      address - the address of the vtable_prefix
      Returns:
      the number of ptrdiff_t's in the vtable_prefix at the address
    • getNumPtrDiffs

      public static int getNumPtrDiffs​(Program program, Address address, int maxLength)
      Gets the size of the ptrdiff_t array at the start of a vtable_prefix
      Parameters:
      program - the program containing the ptrdiff_t array
      address - the address of the ptrdiff_t array
      maxLength - the max length for the ptrdiff_t array
      Returns:
      the number of ptrdiff_t's in the array or 0 if invalid
    • getTypeInfo

      public static ClassTypeInfo getTypeInfo​(Program program, Address address)
      Returns the TypeInfo Model this vtable points to
      Parameters:
      program - program the vtable is in
      address - address of the start of the vtable
      Returns:
      the pointed to TypeInfo Model or null if not found
    • getFunctionTableLength

      public static int getFunctionTableLength​(Program program, Address address)
      Gets the number of elements in the vtable_prefix's function table
      Parameters:
      program - the program containing the function table
      address - the address of the function table
      Returns:
      the number of elements in the vtable_prefix's function table
    • getFunctionTable

      public static Function[] getFunctionTable​(Program program, Address address)
      Gets the function table at the specified address.
      Parameters:
      program - the program containing the function table
      address - the address of the function table
      Returns:
      a Function[] representing the function table.
    • getVttModel

      public static VttModel getVttModel​(Program program, GnuVtable vtable)
      Gets the VttModel for the specified VtableModel if one exists
      Parameters:
      program - the program containing the vtable
      vtable - the vtable
      Returns:
      the VttModel or VttModel.INVALID if none
    • isMangled

      public static boolean isMangled​(String s)
    • getSymbolName

      public static String getSymbolName​(Vtable vtable)
    • getProgram

      public static Program getProgram​(Vtable vtable)