Package ghidra.util.state
Class ResultsState
- java.lang.Object
-
- ghidra.util.state.ResultsState
-
public class ResultsState extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ResultsState.FramePointerCandidate
-
Constructor Summary
Constructors Constructor Description ResultsState(Address entryPt, FunctionAnalyzer analyzer, Program program, boolean maintainInstructionResults, TaskMonitor monitor)
Constructor from a function entry point.ResultsState(java.util.LinkedList<SequenceNumber> flowList, FunctionAnalyzer analyzer, ContextState entryState, boolean maintainInstructionResults, TaskMonitor monitor)
Constructor for replaying over a specified set of context states indicated via a flowList.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assume(Register register, long value)
Set an assumed register value immediately following construction and prior to flow.java.util.Iterator<ContextState>
getContextStates(SequenceNumber seq)
SequenceNumber
getEntryPoint()
Returns entry point associated with this results state.AddressSetView
getExaminedSet()
Returns set of addresses analyzed with function.java.util.Collection<ResultsState.FramePointerCandidate>
getFramePointerCandidates()
Returns collection of frame pointer candidates.java.util.List<Register>
getInputRegisters()
Returns list of registers which are read before written.java.util.List<Register>
getModifiedRegisters()
Returns the set of registers which were modifiedjava.util.List<Register>
getPreservedRegisters()
Returns the set of registers which were modified yet preserved.java.util.Set<SequenceNumber>
getReturnAddresses()
java.util.Set<Varnode>
getReturnValues(Varnode varnode)
static long
getSignedOffset(Varnode v)
Varnode
getStackPointerVarnode()
static long
getUnsignedOffset(Varnode v, int size)
static Varnode
simplify(PcodeOp pcodeOp, Varnode[] values, AddressFactory addrFactory, TaskMonitor monitor)
Generate simplified operation
-
-
-
Constructor Detail
-
ResultsState
public ResultsState(Address entryPt, FunctionAnalyzer analyzer, Program program, boolean maintainInstructionResults, TaskMonitor monitor) throws CancelledException
Constructor from a function entry point. Program context is used to establish the entry context state. Analysis is performed during construction.- Parameters:
entryAddr
- function entry pointanalyzer
- function analysis call-back handlerprogram
- program containing functionmaintainInstructionResults
-monitor
- task monitor- Throws:
CancelledException
-
ResultsState
public ResultsState(java.util.LinkedList<SequenceNumber> flowList, FunctionAnalyzer analyzer, ContextState entryState, boolean maintainInstructionResults, TaskMonitor monitor) throws CancelledException
Constructor for replaying over a specified set of context states indicated via a flowList. Analysis is performed during construction.- Parameters:
flowList
- ordered list of context state entry pointsanalyzer
- function analysis call-back handlerentryState
- context state which feeds into the first point within the flowListmaintainInstructionResults
-monitor
- task monitor- Throws:
CancelledException
-
-
Method Detail
-
getEntryPoint
public SequenceNumber getEntryPoint()
Returns entry point associated with this results state.
-
getExaminedSet
public AddressSetView getExaminedSet()
Returns set of addresses analyzed with function. (In-line functions not included)
-
assume
public void assume(Register register, long value)
Set an assumed register value immediately following construction and prior to flow.- Parameters:
register
- (context register not permitted)value
-
-
getContextStates
public java.util.Iterator<ContextState> getContextStates(SequenceNumber seq)
-
simplify
public static Varnode simplify(PcodeOp pcodeOp, Varnode[] values, AddressFactory addrFactory, TaskMonitor monitor) throws CancelledException
Generate simplified operation- Parameters:
pcodeOp
- pcode operationvalues
- values associated with pcodeOp inputs- Returns:
- operation output result or simplification of an operation.
- Throws:
CancelledException
-
getFramePointerCandidates
public java.util.Collection<ResultsState.FramePointerCandidate> getFramePointerCandidates()
Returns collection of frame pointer candidates.
-
getPreservedRegisters
public java.util.List<Register> getPreservedRegisters()
Returns the set of registers which were modified yet preserved.
-
getModifiedRegisters
public java.util.List<Register> getModifiedRegisters()
Returns the set of registers which were modified
-
getInputRegisters
public java.util.List<Register> getInputRegisters()
Returns list of registers which are read before written.
-
getStackPointerVarnode
public Varnode getStackPointerVarnode()
- Returns:
- Varnode that represents the stack pointer register
-
getReturnAddresses
public java.util.Set<SequenceNumber> getReturnAddresses()
-
getUnsignedOffset
public static long getUnsignedOffset(Varnode v, int size)
-
getSignedOffset
public static long getSignedOffset(Varnode v)
-
-