My Project
|
A register or memory register that may be used to pass a parameter or return value. More...
#include <fspec.hh>
Public Types | |
enum | { checked = 1, used = 2, defnouse = 4, active = 8, unref = 16, killedbycall = 32, rem_formed = 64, indcreate_formed = 128, condexe_effect = 256 } |
Public Member Functions | |
ParamTrial (const Address &ad, int4 sz, int4 sl) | |
Construct from components. | |
const Address & | getAddress (void) const |
Get the starting address of this trial. | |
int4 | getSize (void) const |
Get the number of bytes in this trial. | |
int4 | getSlot (void) const |
Get the slot associated with this trial. | |
void | setSlot (int4 val) |
Set the slot associated with this trial. | |
const ParamEntry * | getEntry (void) const |
Get the model entry associated with this trial. | |
int4 | getOffset (void) const |
Get the offset associated with this trial. | |
void | setEntry (const ParamEntry *ent, int4 off) |
Set the model entry for this trial. | |
void | markUsed (void) |
Mark the trial as a formal parameter. | |
void | markActive (void) |
Mark that trial is actively used (in data-flow) | |
void | markInactive (void) |
Mark that trial is not actively used. | |
void | markNoUse (void) |
Mark trial as definitely not a parameter. | |
void | markUnref (void) |
Mark that this trial has no Varnode representative. | |
void | markKilledByCall (void) |
Mark that this storage is killed-by-call. | |
bool | isChecked (void) const |
Has this trial been checked. | |
bool | isActive (void) const |
Is this trial actively used in data-flow. | |
bool | isDefinitelyNotUsed (void) const |
Is this trial as definitely not a parameter. | |
bool | isUsed (void) const |
Is this trial as a formal parameter. | |
bool | isUnref (void) const |
Does this trial not have a Varnode representative. | |
bool | isKilledByCall (void) const |
Is this storage killed-by-call. | |
void | setRemFormed (void) |
Mark that this is formed by a INT_REM operation. | |
bool | isRemFormed (void) const |
Is this formed by a INT_REM operation. | |
void | setIndCreateFormed (void) |
Mark this trial as formed by indirect creation. | |
bool | isIndCreateFormed (void) const |
Is this trial formed by indirect creation. | |
void | setCondExeEffect (void) |
Mark this trial as possibly affected by conditional execution. | |
bool | hasCondExeEffect (void) const |
Is this trial possibly affected by conditional execution. | |
int4 | slotGroup (void) const |
Get position of this within its parameter group. | |
void | setAddress (const Address &ad, int4 sz) |
Reset the memory range of this trial. | |
ParamTrial | splitHi (int4 sz) const |
Create a trial representing the first part of this. More... | |
ParamTrial | splitLo (int4 sz) const |
Create a trial representing the last part of this. More... | |
bool | testShrink (const Address &newaddr, int4 sz) const |
Test if this trial can be made smaller. More... | |
bool | operator< (const ParamTrial &b) const |
Sort trials in formal parameter order. More... | |
A register or memory register that may be used to pass a parameter or return value.
The parameter recovery utilities (see ParamActive) use this to denote a putative parameter passing storage location. It is made up of the address and size of the memory range, a set of properties about the use of the range (as a parameter) in context, and a link to the matching part of the PrototypeModel.
Data-flow for the putative parameter is held directly by a Varnode. To quickly map to the Varnode (which may or may not exist at points during the ParamTrial lifetime), the concept of slot is used. ParamTrials are assigned a slot, starting at 1. For sub-function parameters, this represents the actual input index of the Varnode in the corresponding CALL or CALLIND op. For parameters, this gives the position within the list of possible input Varnodes in address order. The slot ordering varies over the course of analysis and is unlikely to match the final parameter ordering. The ParamTrial comparator sorts the trials in final parameter ordering.
anonymous enum |
bool ParamTrial::operator< | ( | const ParamTrial & | b | ) | const |
Sort trials in formal parameter order.
Trials are sorted primarily by the group index assigned by the PrototypeModel. Trials within the same group are sorted in address order (or its reverse)
b | is the other trial to compare with this |
ParamTrial ParamTrial::splitHi | ( | int4 | sz | ) | const |
Create a trial representing the first part of this.
Create a new ParamTrial based on the first bytes of the memory range.
sz | is the number of bytes to include in the new trial |
ParamTrial ParamTrial::splitLo | ( | int4 | sz | ) | const |
Create a trial representing the last part of this.
Create a new ParamTrial based on the last bytes of the memory range.
sz | is the number of bytes to include in the new trial |
bool ParamTrial::testShrink | ( | const Address & | newaddr, |
int4 | sz | ||
) | const |
Test if this trial can be made smaller.
A new address and size for the memory range is given, which must respect the endianness of the putative parameter and any existing match with the PrototypeModel
newaddr | is the new address |
sz | is the new size |