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 | |
const CircleRange * | getLandMark (void) const |
Get any landmark range. More... | |
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 | 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... | |
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 |
References equations.
|
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 CPUI_CAST, CPUI_COPY, CPUI_INDIRECT, CPUI_INT_ADD, CPUI_INT_SUB, CPUI_MULTIEQUAL, CPUI_PTRADD, CPUI_PTRSUB, numParams, opCode, typeCode, and vn.
Referenced by iterate().
|
inlineprivate |
Does the indicated equation apply for the given input slot.
Perform basic checks that the selected Equation exists and applies to the indicated input slot.
num | is the index selecting an Equation |
slot | is the indicated slot |
References equations, and typeCode.
Referenced by iterate().
const CircleRange * ValueSet::getLandMark | ( | void | ) | const |
Get any landmark range.
If a landmark was associated with this value set, return its range, otherwise return null.
References equations, and typeCode.
Referenced by 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 Widener::checkFreeze(), CircleRange::circleUnion(), computeTypeCode(), count, CPUI_MULTIEQUAL, doesEquationApply(), Widener::doWidening(), equations, CircleRange::intersect(), leftIsStable, MAX_STEP, CircleRange::minimalContainer(), numParams, opCode, partHead, CircleRange::pushForwardBinary(), CircleRange::pushForwardTrinary(), CircleRange::pushForwardUnary(), range, rightIsStable, and vn.
Referenced by ValueSetSolver::solve().
void ValueSet::printRaw | ( | ostream & | s | ) | const |
Write a text description of to the given stream.
s | is the stream to print to |
References CPUI_MAX, get_opname(), opCode, CircleRange::printRaw(), Varnode::printRaw(), range, typeCode, and vn.
|
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 CPUI_COPY, CPUI_INDIRECT, CPUI_MAX, leftIsStable, numParams, opCode, range, rightIsStable, CircleRange::setFull(), CircleRange::setRange(), typeCode, and vn.
|
static |
Maximum step inferred for a value set
Referenced by iterate().