Package ghidra.util.state
Class ContextState
java.lang.Object
ghidra.util.state.ContextState
-
Constructor Summary
ConstructorDescriptionContextState
(Address entryPt, Program program) Constructs an empty state.ContextState
(Address entryPt, ProgramContext programCtx, Program program) Constructs an empty state.ContextState
(SequenceNumber pcodeEntry, ContextState previousState) Derive a new context state from an initial state -
Method Summary
Modifier and TypeMethodDescriptionbranchState
(SequenceNumber pcodeEntry) Branch the current state.When done processing a particular instruction, this method should be invoked to clear any unique Varnode state.Retrieve the value/operation stored within the specified space using an offset identified by a value/operation.get
(int spaceID, Varnode offsetValue, int size, TaskMonitor monitor) Retrieve the value/operation stored within the specified space using an offset identified by a value/operation.Retrieve the value/operation stored in the specified addressable location (address or register varnode).get
(Varnode varnode, TaskMonitor monitor) Retrieve the value/operation stored in the specified addressable location (address or register varnode).Returns the point at which the state was instantiated.Returns previous ContextState which flowed into this one.Returns program associated with this context stateboolean
boolean
isFlowFrom
(SequenceNumber seq) void
lock()
When no longer updating this state, this method should be invoked to cleanup resources no longer needed (e.g., uniqueState no longer maintained).void
setDebugVarnod
(Varnode varnode) Set a varnode to be debugged.boolean
void
Store a value.
-
Constructor Details
-
ContextState
Constructs an empty state.- Parameters:
entryPt
- the entry point for the context stateprogram
- the program
-
ContextState
Constructs an empty state.- Parameters:
entryPt
- the entry point for the context stateprogramCtx
- initial program context or nullprogram
- the program
-
ContextState
Derive a new context state from an initial state- Parameters:
pcodeEntry
- the pcode entry sequence numberpreviousState
- previous context state flowing into the specified pcode location
-
-
Method Details
-
getProgram
Returns program associated with this context state -
getPreviousContextState
Returns previous ContextState which flowed into this one. -
isFlowFrom
-
getFlowFroms
-
getExitPoint
-
getSequenceRange
-
setDebugVarnod
Set a varnode to be debugged. This will be passed to any states derived from this state.- Parameters:
varnode
- varnode to be debugged
-
branchState
Branch the current state. The current state should be associated with branch target, the returned state should be used for the fall-through flow.- Returns:
-
getEntryPoint
Returns the point at which the state was instantiated. -
clearUniqueState
When done processing a particular instruction, this method should be invoked to clear any unique Varnode state.- Returns:
- previous unique state
-
lock
public void lock()When no longer updating this state, this method should be invoked to cleanup resources no longer needed (e.g., uniqueState no longer maintained). -
store
-
store
Store a value. Unique varnodes not permitted once locked.- Parameters:
addressVarnode
- identifies storage (address, register or unique)storedValue
- constant or OperationVarnode
-
get
Retrieve the value/operation stored within the specified space using an offset identified by a value/operation.- Parameters:
spaceID
-offsetValue
-size
-- Returns:
- stored value/operation or null or DUMMY_BYTE_VARNODE
-
get
public Varnode get(int spaceID, Varnode offsetValue, int size, TaskMonitor monitor) throws CancelledException Retrieve the value/operation stored within the specified space using an offset identified by a value/operation.- Parameters:
spaceID
-offsetValue
-size
-- Returns:
- stored value/operation or null or DUMMY_BYTE_VARNODE
- Throws:
CancelledException
-
get
Retrieve the value/operation stored in the specified addressable location (address or register varnode). If varnode is a constant, the input argument will be returned. Unique varnodes not permitted once locked.- Parameters:
varnode
- identifies constant or storage (constant, address, register or unique), if VarnodeOperation specified null will always be returned.- Returns:
- stored value/operation
-
get
Retrieve the value/operation stored in the specified addressable location (address or register varnode). If varnode is a constant, the input argument will be returned. Unique varnodes not permitted once locked.- Parameters:
varnode
- identifies constant or storage (constant, address, register or unique), if VarnodeOperation specified null will always be returned.- Returns:
- stored value/operation
- Throws:
CancelledException
-
getDifferingRegisters
-
hasDifferingRegisters
-