Class ClassUtils

java.lang.Object
ghidra.program.model.gclass.ClassUtils

public class ClassUtils extends Object
Utility class for Class-related software modeling.
  • Field Details

    • VBPTR

      public static final String VBPTR
      Standard field name for a virtual base table pointer found within a class
      See Also:
    • VFPTR

      public static final String VFPTR
      Standard field name for a virtual function table pointer found within a class
      See Also:
    • VXPTR_TYPE

      public static final PointerDataType VXPTR_TYPE
      Type used for VBPTR and VFPTR fields in a class
  • Method Details

    • getClassInternalsPath

      public static CategoryPath getClassInternalsPath(Composite composite)
      Returns the category for class internals
      Parameters:
      composite - the class composite
      Returns:
      the category path
    • getClassInternalsPath

      public static CategoryPath getClassInternalsPath(ClassID id)
      Returns the category for class internals for the ClassID
      Parameters:
      id - the class ID
      Returns:
      the category path
    • getClassInternalsPath

      public static CategoryPath getClassInternalsPath(CategoryPath path, String className)
      Returns the category for class internals
      Parameters:
      path - the category path of the class composite
      className - the name of the class
      Returns:
      the category path
    • getBaseClassDataTypePath

      public static DataTypePath getBaseClassDataTypePath(Composite composite)
      Returns the data type path for a suitable base class
      Parameters:
      composite - the class composite
      Returns:
      the base class data type path
    • getSelfBaseType

      public static Composite getSelfBaseType(Composite composite)
      Returns the "self-base" composite for the specified class composite. This could be the composite argument itself of could be a component of it
      Parameters:
      composite - the main class type
      Returns:
      the self-base composite
    • getSpecialVxTableName

      public static String getSpecialVxTableName(long ptrOffsetInClass)
      Provides the standard special name for a virtual table (e.g., vbtable, vftable) that is keyed off of by the Decompiler during flattening and replacing of types within a class structure. More details to come
      Parameters:
      ptrOffsetInClass - the offset of the special field within the class
      Returns:
      the special name
    • isVTable

      public static boolean isVTable(DataType type)
      Indicates whether a label satisfies the format of a vxtable label
      Parameters:
      type - the data type
      Returns:
      true if is a vxtable label format
    • getVftDefaultEntry

      public static DataType getVftDefaultEntry(DataTypeManager dtm)
    • getVbtDefaultEntry

      public static DataType getVbtDefaultEntry(DataTypeManager dtm)
    • getVftEntrySize

      public static int getVftEntrySize(DataTypeManager dtm)
    • getVbtEntrySize

      public static int getVbtEntrySize(DataTypeManager dtm)