decompiler
1.0.0
|
A range of values attached to a Varnode within a data-flow subsystem. More...
#include <rangeutil.hh>
Classes | |
class | Equation |
An external that can be applied to a ValueSet. More... | |
Public Member Functions | |
int4 | getCount (void) const |
Get the current iteration count. | |
const CircleRange * | getLandMark (void) const |
Get any landmark range. More... | |
int4 | getTypeCode (void) const |
Return '0' for normal constant, '1' for spacebase relative. | |
Varnode * | getVarnode (void) const |
Get the Varnode attached to this ValueSet. | |
const CircleRange & | getRange (void) const |
Get the actual range of values. | |
bool | isLeftStable (void) const |
Return true if the left boundary hasn't been changing. | |
bool | isRightStable (void) const |
Return true if the right boundary hasn't been changing. | |
void | printRaw (ostream &s) const |
Write a text description of to the given stream. More... | |
Static Public Attributes | |
static const int4 | MAX_STEP = 32 |
Private Member Functions | |
bool | doesEquationApply (int4 num, int4 slot) const |
Does the indicated equation apply for the given input slot. More... | |
void | setFull (void) |
Mark value set as possibly containing any value. | |
void | setVarnode (Varnode *v, int4 tCode) |
Attach this to given Varnode and set initial values. More... | |
void | addEquation (int4 slot, int4 type, const CircleRange &constraint) |
Insert an equation restricting this value set. More... | |
void | addLandmark (int4 type, const CircleRange &constraint) |
Add a widening landmark. | |
bool | computeTypeCode (void) |
Figure out if this value set is absolute or relative. More... | |
bool | iterate (Widener &widener) |
Regenerate this value set from operator inputs. More... | |
Private Attributes | |
int4 | typeCode |
0=pure constant 1=stack relative | |
int4 | numParams |
Number of input parameters to defining operation. | |
int4 | count |
Depth first numbering / widening count. | |
OpCode | opCode |
Op-code defining Varnode. | |
bool | leftIsStable |
Set to true if left boundary of range didn't change (last iteration) | |
bool | rightIsStable |
Set to true if right boundary of range didn't change (last iteration) | |
Varnode * | vn |
Varnode whose set this represents. | |
CircleRange | range |
Range of values or offsets in this set. | |
vector< Equation > | equations |
Any equations associated with this value set. | |
Partition * | partHead |
If Varnode is a component head, pointer to corresponding Partition. | |
ValueSet * | next |
Next ValueSet to iterate. | |
Friends | |
class | ValueSetSolver |
A range of values attached to a Varnode within a data-flow subsystem.
This class acts as both the set of values for the Varnode and as a node in a sub-graph overlaying the full data-flow of the function containing the Varnode. The values are stored in the CircleRange field and can be interpreted either as absolute values (if typeCode is 0) or as values relative to a stack pointer or some other register (if typeCode is non-zero).
|
private |
Insert an equation restricting this value set.
Equations are stored as an array of (slot,range) pairs, ordered on slot.
slot | is the given slot |
type | is the constraint characteristic |
constraint | is the given range |
Referenced by ghidra::ValueSetSolver::generateFalseEquation(), and ghidra::ValueSetSolver::generateTrueEquation().
|
private |
Figure out if this value set is absolute or relative.
Examine the input value sets that determine this set and decide if it is relative. In general, this will be relative if any of its inputs are. Certain combinations are indeterminate, which this method flags by returning true. The Varnode attached to this must have a defining op.
References ghidra::CPUI_CAST, ghidra::CPUI_COPY, ghidra::CPUI_INDIRECT, ghidra::CPUI_INT_ADD, ghidra::CPUI_INT_SUB, ghidra::CPUI_MULTIEQUAL, ghidra::CPUI_PTRADD, ghidra::CPUI_PTRSUB, ghidra::PcodeOp::getIn(), ghidra::Varnode::getValueSet(), and typeCode.
|
inlineprivate |
const CircleRange * ghidra::ValueSet::getLandMark | ( | void | ) | const |
Get any landmark range.
If a landmark was associated with this value set, return its range, otherwise return null.
Referenced by ghidra::WidenerFull::doWidening().
|
private |
Regenerate this value set from operator inputs.
Recalculate this value set by grabbing the value sets of the inputs to the operator defining the Varnode attached to this value set and pushing them forward through the operator.
References ghidra::Widener::checkFreeze(), ghidra::CircleRange::circleUnion(), ghidra::CPUI_MULTIEQUAL, ghidra::Widener::doWidening(), ghidra::CircleRange::getEnd(), ghidra::PcodeOp::getIn(), ghidra::CircleRange::getMin(), ghidra::Varnode::getSize(), ghidra::Varnode::getValueSet(), ghidra::CircleRange::intersect(), ghidra::CircleRange::isEmpty(), leftIsStable, ghidra::CircleRange::minimalContainer(), ghidra::CircleRange::pushForwardBinary(), ghidra::CircleRange::pushForwardTrinary(), ghidra::CircleRange::pushForwardUnary(), range, rightIsStable, ghidra::CircleRange::setFull(), and vn.
Referenced by ghidra::ValueSetSolver::solve().
void ghidra::ValueSet::printRaw | ( | ostream & | s | ) | const |
Write a text description of to the given stream.
s | is the stream to print to |
References ghidra::CPUI_MAX.
Referenced by ghidra::ValueSetSolver::solve().
|
private |
Attach this to given Varnode and set initial values.
The initial values in this are set based on the type of Varnode:
v | is the given Varnode to attach to |
tCode | indicates whether to treat values as constants are relative offsets |
References ghidra::PcodeOp::code(), ghidra::CPUI_COPY, ghidra::CPUI_INDIRECT, ghidra::CPUI_MAX, ghidra::PcodeOp::numInput(), and ghidra::Varnode::setValueSet().
|
static |
Maximum step inferred for a value set
Referenced by ghidra::CircleRange::printRaw().