Class DynamicVariableStorage

java.lang.Object
ghidra.program.model.listing.VariableStorage
ghidra.program.model.lang.DynamicVariableStorage
All Implemented Interfaces:
Comparable<VariableStorage>

public class DynamicVariableStorage extends VariableStorage
  • Field Details

    • INDIRECT_VOID_STORAGE

      public static final DynamicVariableStorage INDIRECT_VOID_STORAGE
      INDIRECT_VOID_STORAGE used to identify return storage which is "mapped" with a data-type of void but was forced indirect with the corresponding use of a hidden return-storage-parameter.
  • Constructor Details

    • DynamicVariableStorage

      public DynamicVariableStorage(ProgramArchitecture program, AutoParameterType autoParamType, Address address, int size) throws InvalidInputException
      Construct dynamic variable storage with an optional auto-parameter type
      Parameters:
      program -
      autoParamType - auto-parameter type or null if not applicable
      address - varnode address
      size - varnode size
      Throws:
      InvalidInputException
    • DynamicVariableStorage

      public DynamicVariableStorage(ProgramArchitecture program, AutoParameterType autoParamType, Varnode... varnodes) throws InvalidInputException
      Construct dynamic variable storage with an optional auto-parameter type
      Parameters:
      program -
      autoParamType - auto-parameter type or null if not applicable
      varnodes - one or more ordered storage varnodes
      Throws:
      InvalidInputException - if specified varnodes violate storage restrictions
    • DynamicVariableStorage

      public DynamicVariableStorage(ProgramArchitecture program, boolean forcedIndirect, Address address, int size) throws InvalidInputException
      Construct dynamic variable storage
      Parameters:
      program -
      forcedIndirect - if true indicates that the parameter has been forced to pass as a pointer instead of its raw type
      address - varnode address
      size - varnode size
      Throws:
      InvalidInputException
    • DynamicVariableStorage

      public DynamicVariableStorage(ProgramArchitecture program, boolean forcedIndirect, Varnode... varnodes) throws InvalidInputException
      Construct dynamic variable storage
      Parameters:
      program -
      forcedIndirect - if true indicates that the parameter has been forced to pass as a pointer instead of its raw type
      varnodes - one or more ordered storage varnodes
      Throws:
      InvalidInputException - if specified varnodes violate storage restrictions
  • Method Details

    • isForcedIndirect

      public boolean isForcedIndirect()
      Description copied from class: VariableStorage
      If this storage corresponds to parameter which was forced by the associated calling convention to be passed as a pointer instead of its raw type.
      Overrides:
      isForcedIndirect in class VariableStorage
      Returns:
      true if this parameter was forced to be passed as a pointer instead of its raw type
    • isAutoStorage

      public boolean isAutoStorage()
      Description copied from class: VariableStorage
      Associated with auto-parameters. Parameters whose existence is dictated by a calling-convention may automatically inject additional hidden parameters. If this storage is associated with a auto-parameter, this method will return true.
      Overrides:
      isAutoStorage in class VariableStorage
      Returns:
      true if this storage is associated with an auto-parameter, else false
    • isUnassignedStorage

      public boolean isUnassignedStorage()
      Overrides:
      isUnassignedStorage in class VariableStorage
      Returns:
      true if storage has not been assigned (no varnodes)
    • isVoidStorage

      public boolean isVoidStorage()
      Overrides:
      isVoidStorage in class VariableStorage
      Returns:
      true if storage corresponds to the VOID_STORAGE instance
      See Also:
    • getAutoParameterType

      public AutoParameterType getAutoParameterType()
      Description copied from class: VariableStorage
      If this storage corresponds to a auto-parameter, return the type associated with the auto-parameter.
      Overrides:
      getAutoParameterType in class VariableStorage
      Returns:
      auto-parameter type or null if not applicable
    • toString

      public String toString()
      Overrides:
      toString in class VariableStorage
    • getUnassignedDynamicStorage

      public static DynamicVariableStorage getUnassignedDynamicStorage(AutoParameterType autoParamType)
      Construct Unassigned dynamic variable storage with an optional auto-parameter type. NOTE: The isUnassignedStorage() method should be used to detect this type of storage.
      Parameters:
      autoParamType - auto-parameter type or null if not applicable
      Returns:
      Unassigned dynamic variable storage
    • getUnassignedDynamicStorage

      public static DynamicVariableStorage getUnassignedDynamicStorage(boolean forcedIndirect)
      Construct Unassigned dynamic variable storage. NOTE: The isUnassignedStorage() method should be used to detect this type of storage.
      Parameters:
      forcedIndirect - if true indicates that the parameter has been forced to pass as a pointer instead of its raw type
      Returns:
      Unassigned dynamic variable storage