Package ghidra.program.model.data

# Interface Dynamic

All Superinterfaces:
  `BuiltInDataType`, `DataType`, `ExtensionPoint`

All Known Implementing Classes:
  `AbstractLeb128DataType`, `AbstractStringDataType`, `AIFFDataType`, `AlignmentDataType`, `AndroidElfRelocationTableDataType`, `AUDataType`, `BadDataType`, `BitmapResourceDataType`, `CountedDynamicDataType`, `DialogResourceDataType`, `DynamicDataType`, `GifDataType`, `GroupIconResourceDataType`, `HTMLResourceDataType`, `IconMaskResourceDataType`, `IconResourceDataType`, `IndexedDynamicDataType`, `JPEGDataType`, `MenuResourceDataType`, `MissingBuiltInDataType`, `MUIResourceDataType`, `PascalString255DataType`, `PascalStringDataType`, `PascalUnicodeDataType`, `PERichTableDataType`, `PEx64UnwindInfoDataType`, `PngDataType`, `RepeatCountDataType`, `RepeatedDynamicDataType`, `RepeatedStringDataType`, `RTTI0DataType`, `RTTI1DataType`, `RTTI2DataType`, `RTTI3DataType`, `RTTI4DataType`, `RTTIDataType`, `SignedLeb128DataType`, `StringDataType`, `StringUTF8DataType`, `StructuredDynamicDataType`, `TerminatedStringDataType`, `TerminatedUnicode32DataType`, `TerminatedUnicodeDataType`, `Unicode32DataType`, `UnicodeDataType`, `UnsignedLeb128DataType`, `WAVEDataType`, `WEVTResourceDataType`

public interface Dynamic extends BuiltInDataType
A DataType class that must compute its length based upon actual data. This type may be referred to directly within a listing (including pointers). This type may only appear within a structure if canSpecifyLength() returns true. A pointer to this type can always appear within a structure. TypeDef to this data-type should not be allowed.

- ## Field Summary

  ### Fields inherited from interface ghidra.program.model.data.DataType

  `CONFLICT_SUFFIX, DEFAULT, NO_LAST_CHANGE_TIME, NO_SOURCE_SYNC_TIME, TYPEDEF_ATTRIBUTE_PREFIX, TYPEDEF_ATTRIBUTE_SUFFIX, VOID`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default boolean`
  `canSpecifyLength()`
  Determine if the length may be specified for an instanceof this datatype (e.g., `Data`, `Array`, `DataTypeComponent`, etc.).
  `int`
  `getLength(MemBuffer buf, int maxLength)`
  Compute the length for this data-type which corresponds to the specified memory location.
  `DataType`
  `getReplacementBaseType()`
  Returns a suitable replacement base data-type for pointers and arrays when exporting to C code

  ### Methods inherited from interface ghidra.program.model.data.BuiltInDataType

  `getCTypeDeclaration, setDefaultSettings`

  ### Methods inherited from interface ghidra.program.model.data.DataType

  `addParent, clone, copy, dataTypeAlignmentChanged, dataTypeDeleted, dataTypeNameChanged, dataTypeReplaced, dataTypeSizeChanged, dependsOn, encodeRepresentation, encodeValue, getAlignedLength, getAlignment, getCategoryPath, getDataOrganization, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDefaultSettings, getDescription, getDisplayName, getDocs, getLastChangeTime, getLastChangeTimeInSourceArchive, getLength, getMnemonic, getName, getParents, getPathName, getRepresentation, getSettingsDefinitions, getSourceArchive, getTypeDefSettingsDefinitions, getUniversalID, getValue, getValueClass, hasLanguageDependantLength, isDeleted, isEncodable, isEquivalent, isNotYetDefined, isZeroLength, removeParent, replaceWith, setCategoryPath, setDescription, setLastChangeTime, setLastChangeTimeInSourceArchive, setName, setNameAndCategory, setSourceArchive`

- ## Method Details

  - ### getLength

    int getLength(MemBuffer buf, int maxLength)
    Compute the length for this data-type which corresponds to the specified memory location.
    Parameters:
      `buf` - memory location
      `maxLength` - maximum number of bytes to consume in computing length, or -1 for unspecified.
    Returns:
      data length or -1 if it could not be determined. Returned length may exceed maxLength if data-type does not supported constrained lengths.

  - ### canSpecifyLength

    default boolean canSpecifyLength()
    Determine if the length may be specified for an instanceof this datatype (e.g., `Data`, `Array`, `DataTypeComponent`, etc.).
    Returns:
      true if a user-specified length can be used, else false

  - ### getReplacementBaseType

    DataType getReplacementBaseType()
    Returns a suitable replacement base data-type for pointers and arrays when exporting to C code
    Returns:
      suitable base data-type for this Dynamic data-type