Package ghidra.program.model.lang
Class DynamicVariableStorage
- java.lang.Object
-
- ghidra.program.model.listing.VariableStorage
-
- ghidra.program.model.lang.DynamicVariableStorage
-
- All Implemented Interfaces:
java.lang.Comparable<VariableStorage>
public class DynamicVariableStorage extends VariableStorage
-
-
Field Summary
-
Fields inherited from class ghidra.program.model.listing.VariableStorage
BAD_STORAGE, program, UNASSIGNED_STORAGE, varnodes, VOID_STORAGE
-
-
Constructor Summary
Constructors Constructor Description DynamicVariableStorage(Program program, boolean forcedIndirect, Address address, int size)
Construct dynamic variable storageDynamicVariableStorage(Program program, boolean forcedIndirect, Varnode... varnodes)
Construct dynamic variable storageDynamicVariableStorage(Program program, AutoParameterType autoParamType, Address address, int size)
Construct dynamic variable storage with an optional auto-parameter typeDynamicVariableStorage(Program program, AutoParameterType autoParamType, Varnode... varnodes)
Construct dynamic variable storage with an optional auto-parameter type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AutoParameterType
getAutoParameterType()
If this storage corresponds to a auto-parameter, return the type associated with the auto-parameter.static DynamicVariableStorage
getUnassignedDynamicStorage(boolean forcedIndirect)
Construct Unassigned dynamic variable storage.static DynamicVariableStorage
getUnassignedDynamicStorage(AutoParameterType autoParamType)
Construct Unassigned dynamic variable storage with an optional auto-parameter type.boolean
isAutoStorage()
Associated with auto-parameters.boolean
isForcedIndirect()
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.boolean
isUnassignedStorage()
java.lang.String
toString()
-
Methods inherited from class ghidra.program.model.listing.VariableStorage
clone, compareTo, contains, deserialize, equals, getFirstVarnode, getLastVarnode, getLongHash, getMinAddress, getProgram, getRegister, getRegisters, getSerializationString, getSerializationString, getStackOffset, getVarnodeCount, getVarnodes, getVarnodes, hashCode, hasStackStorage, intersects, intersects, intersects, isBadStorage, isCompoundStorage, isConstantStorage, isHashStorage, isMemoryStorage, isRegisterStorage, isStackStorage, isUniqueStorage, isValid, isVoidStorage, size, translateSerialization
-
-
-
-
Constructor Detail
-
DynamicVariableStorage
public DynamicVariableStorage(Program 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 applicableaddress
- varnode addresssize
- varnode size- Throws:
InvalidInputException
-
DynamicVariableStorage
public DynamicVariableStorage(Program 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 applicablevarnodes
- one or more ordered storage varnodes- Throws:
InvalidInputException
- if specified varnodes violate storage restrictions
-
DynamicVariableStorage
public DynamicVariableStorage(Program 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 typeaddress
- varnode addresssize
- varnode size- Throws:
InvalidInputException
-
DynamicVariableStorage
public DynamicVariableStorage(Program 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 typevarnodes
- one or more ordered storage varnodes- Throws:
InvalidInputException
- if specified varnodes violate storage restrictions
-
-
Method Detail
-
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 classVariableStorage
- 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 classVariableStorage
- Returns:
- true if this storage is associated with an auto-parameter, else false
-
isUnassignedStorage
public boolean isUnassignedStorage()
- Overrides:
isUnassignedStorage
in classVariableStorage
- Returns:
- true if storage has not been assigned (no varnodes)
-
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 classVariableStorage
- Returns:
- auto-parameter type or null if not applicable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classVariableStorage
-
getUnassignedDynamicStorage
public static DynamicVariableStorage getUnassignedDynamicStorage(AutoParameterType autoParamType)
Construct Unassigned dynamic variable storage with an optional auto-parameter type. NOTE: TheisUnassignedStorage()
method should be used to detect this type of storage.- Parameters:
autoParamType
- auto-parameter type or null if not applicable
-
getUnassignedDynamicStorage
public static DynamicVariableStorage getUnassignedDynamicStorage(boolean forcedIndirect)
Construct Unassigned dynamic variable storage. NOTE: TheisUnassignedStorage()
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
-
-