decompiler
1.0.0
|
A low-level variable or contiguous set of bytes described by an Address and a size. More...
#include <varnode.hh>
Public Types | |
enum | varnode_flags { mark = 0x01, constant = 0x02, annotation = 0x04, input = 0x08, written = 0x10, insert = 0x20, implied = 0x40, explict = 0x80, typelock = 0x100, namelock = 0x200, nolocalalias = 0x400, volatil = 0x800, spacebase_placeholder = 0x1000, externref = 0x2000, readonly = 0x4000, persist = 0x8000, addrtied = 0x10000, unaffected = 0x20000, spacebase = 0x40000, indirectonly = 0x80000, directwrite = 0x100000, addrforce = 0x200000, mapped = 0x400000, indirect_creation = 0x800000, return_address = 0x1000000, coverdirty = 0x2000000, precislo = 0x4000000, precishi = 0x8000000, indirectstorage = 0x10000000, hiddenretparm = 0x20000000, incidental_copy = 0x40000000, auto_live = 0x80000000 } |
enum | addl_flags { activeheritage = 0x01, writemask = 0x02, vacconsume = 0x04, lisconsume = 0x08, ptrcheck = 0x10, ptrflow = 0x20, unsignedprint = 0x40, stack_store = 0x80, locked_input = 0x100 } |
Additional boolean properties on a Varnode. More... | |
Public Member Functions | |
HighVariable * | getHigh (void) const |
Get the high-level variable associated with this Varnode. More... | |
PcodeOp * | loneDescend (void) const |
Return unique reading PcodeOp, or null if there are zero or more than 1. More... | |
Address | getUsePoint (const Funcdata &fd) const |
Get Address when this Varnode first comes into scope. More... | |
int4 | printRawNoMarkup (ostream &s) const |
Print a simple identifier for the Varnode. More... | |
void | printRaw (ostream &s) const |
Print a simple identifier plus additional info identifying Varnode with SSA form. More... | |
void | printCover (ostream &s) const |
Print raw coverage info about the Varnode. More... | |
void | printInfo (ostream &s) const |
Print raw attribute info about the Varnode. More... | |
Varnode (int4 s, const Address &m, Datatype *dt) | |
Construct a free Varnode. More... | |
bool | operator< (const Varnode &op2) const |
Comparison operator on Varnode. More... | |
bool | operator== (const Varnode &op2) const |
Equality operator. More... | |
~Varnode (void) | |
Destructor. More... | |
bool | intersects (const Varnode &op) const |
Return true if the storage locations intersect. More... | |
bool | intersects (const Address &op2loc, int4 op2size) const |
Check intersection against an Address range. More... | |
int4 | contains (const Varnode &op) const |
Return info about the containment of op in this. More... | |
int4 | characterizeOverlap (const Varnode &op) const |
Return 0, 1, or 2 for "no overlap", "partial overlap", "identical storage". | |
int4 | overlap (const Varnode &op) const |
Return relative point of overlap between two Varnodes. More... | |
int4 | overlap (const Address &op2loc, int4 op2size) const |
Return relative point of overlap with Address range. More... | |
int4 | termOrder (const Varnode *op) const |
Compare two Varnodes based on their term order. More... | |
void | printRawHeritage (ostream &s, int4 depth) const |
Print a simple SSA subtree rooted at this. More... | |
bool | isAddrTied (void) const |
Are all Varnodes at this storage location components of the same high-level variable? | |
bool | isIndirectZero (void) const |
Is this just a special placeholder representing INDIRECT creation? | |
bool | isExtraOut (void) const |
Is this Varnode created indirectly by a CALL operation? | |
bool | hasCover (void) const |
Does this have Cover information? | |
bool | constantMatch (uintb val) const |
Return true if this is a constant with value val. | |
int4 | isConstantExtended (uintb &val) const |
bool | isHeritageKnown (void) const |
Return true if this Varnode is linked into the SSA tree. | |
bool | updateType (Datatype *ct, bool lock, bool override) |
(Possibly) set the Datatype given various restrictions More... | |
void | copySymbol (const Varnode *vn) |
Copy symbol info from vn. More... | |
void | copySymbolIfValid (const Varnode *vn) |
Copy symbol info from vn if constant value matches. More... | |
Datatype * | getLocalType (void) const |
Calculate type of Varnode based on local information. More... | |
bool | copyShadow (const Varnode *op2) const |
Are this and op2 copied from the same source? More... | |
void | saveXml (ostream &s) const |
Save a description of this as an XML tag. More... | |
Private Member Functions | |
void | updateCover (void) const |
Internal function for update coverage information. More... | |
void | calcCover (void) const |
Turn on the Cover object for this Varnode. More... | |
void | clearCover (void) const |
Turn off any coverage information. More... | |
void | setFlags (uint4 fl) const |
Internal method for setting boolean attributes. More... | |
void | clearFlags (uint4 fl) const |
Internal method for clearing boolean attributes. More... | |
void | setDef (PcodeOp *op) |
Set the defining PcodeOp of this Varnode. More... | |
bool | setSymbolProperties (SymbolEntry *entry) |
Set properties from the given Symbol to this Varnode. More... | |
void | setSymbolEntry (SymbolEntry *entry) |
Attach a Symbol to this Varnode. More... | |
void | setSymbolReference (SymbolEntry *entry, int4 off) |
Attach a Symbol reference to this. More... | |
void | addDescend (PcodeOp *op) |
Add a descendant (reading) PcodeOp to this Varnode's list. More... | |
void | eraseDescend (PcodeOp *op) |
Erase a descendant (reading) PcodeOp from this Varnode's list. More... | |
void | destroyDescend (void) |
Clear all descendant (reading) PcodeOps. More... | |
Private Attributes | |
uint4 | flags |
The collection of boolean attributes for this Varnode. | |
int4 | size |
Size of the Varnode in bytes. | |
uint4 | create_index |
A unique one-up index assigned to Varnode at its creation. | |
int2 | mergegroup |
Which group of forced merges does this Varnode belong to. | |
uint2 | addlflags |
Additional flags. | |
Address | loc |
Storage location (or constant value) of the Varnode. | |
PcodeOp * | def |
The defining operation of this Varnode. | |
HighVariable * | high |
High-level variable of which this is an instantiation. | |
SymbolEntry * | mapentry |
cached SymbolEntry associated with Varnode | |
Datatype * | type |
Datatype associated with this varnode. | |
VarnodeLocSet::iterator | lociter |
Iterator into VarnodeBank sorted by location. | |
VarnodeDefSet::iterator | defiter |
Iterator into VarnodeBank sorted by definition. | |
list< PcodeOp * > | descend |
List of every op using this varnode as input. | |
Cover * | cover |
Addresses covered by the def->use of this Varnode. | |
union { | |
Datatype * dataType | |
Temporary data-type associated with this for use in type propagate algorithm. | |
ValueSet * valueSet | |
Value set associated with this when performing Value Set Analysis. | |
} | temp |
Temporary storage for analysis algorithms. | |
uintb | consumed |
What parts of this varnode are used. | |
uintb | nzm |
Which bits do we know are zero. | |
Friends | |
class | VarnodeBank |
class | Merge |
class | Funcdata |
A low-level variable or contiguous set of bytes described by an Address and a size.
A Varnode is the fundemental variable in the p-code language model. A Varnode represents anything that holds data, including registers, stack locations, global RAM locations, and constants. It is described most simply as a storage location for some number of bytes, and is identified by
In its raw form, the Varnode is referred to as free, and this pair uniquely identifies the Varnode, as determined by its comparison operators. In terms of the Static Single Assignment (SSA) form for the decompiler analysis, the Varnode class also represents a node in the tree. In this case the Varnode is not free, and each individual write to a storage location, as per SSA form, creates a unique Varnode, which is represented by a separate instance, so there may be multiple Varnode instances with the same Address and size.
enum Varnode::addl_flags |
Additional boolean properties on a Varnode.
Enumerator | |
---|---|
activeheritage | The varnode is actively being heritaged. |
writemask | Should not be considered a write in heritage calculation. |
vacconsume | Vacuous consume. |
lisconsume | In consume worklist. |
ptrcheck | The Varnode value is NOT a pointer. |
ptrflow | If this varnode flows to or from a pointer. |
unsignedprint | Constant that must be explicitly printed as unsigned. |
stack_store | Created by an explicit STORE. |
locked_input | Input that exists even if its unused. |
There are a large number of boolean attributes that can be placed on a Varnode. Some are calculated and maintained by the friend classes Funcdata and VarnodeBank, and others can be set and cleared publicly by separate subsystems.
Enumerator | |
---|---|
mark | Prevents infinite loops. |
constant | The varnode is constant. |
annotation | This varnode is an annotation and has no dataflow. |
input | This varnode has no ancestor. |
written | This varnode has a defining op (def is nonzero) |
insert | This varnode has been inserted in a tree This means the varnode is the output of an op or The output is a constant or the output is an input |
implied | This varnode is a temporary variable. |
explict | This varnode CANNOT be a temporary variable. |
typelock | The Dataype of the Varnode is locked. |
namelock | The Name of the Varnode is locked. |
nolocalalias | There are no aliases pointing to this varnode. |
volatil | This varnode's value is volatile. |
spacebase_placeholder | This varnode is inserted artificially to track a register value at a specific point in the code |
externref | Varnode address is specially mapped by the loader. |
readonly | Varnode is stored at a readonly location. |
persist | Persists after (and before) function. |
addrtied | High-level variable is tied to address. |
unaffected | Input which is unaffected by the function. |
spacebase | This is a base register for an address space. |
indirectonly | If all uses of illegalinput varnode are inputs to INDIRECT. |
directwrite | (could be) Directly affected by a valid input |
addrforce | Varnode is used to force variable into an address. |
mapped | Varnode has a database entry associated with it. |
indirect_creation | The value in this Varnode is created indirectly. |
return_address | Is the varnode storage for a return address. |
coverdirty | Cover is not upto date. |
precislo | Is this Varnode the low part of a double precision value. |
precishi | Is this Varnode the high part of a double precision value. |
indirectstorage | Is this Varnode storing a pointer to the actual symbol. |
hiddenretparm | Does this varnode point to the return value storage location. |
incidental_copy | Do copies of this varnode happen as a side-effect. |
auto_live | Is this varnode automatically considered live, never removed as dead-code. |
Construct a free Varnode.
This is the constructor for making an unmanaged Varnode It creates a free Varnode with possibly a Datatype attribute. Most applications create Varnodes through the Funcdata interface
References addlflags, annotation, constant, consumed, cover, coverdirty, def, flags, Address::getOffset(), Address::getSpace(), AddrSpace::getType(), high, IPTR_CONSTANT, IPTR_FSPEC, IPTR_IOP, mapentry, mergegroup, nzm, size, and type.
Varnode::~Varnode | ( | void | ) |
Destructor.
Delete the Varnode object. This routine assumes all other cross-references have been removed.
References cover, high, and HighVariable::remove().
Referenced by updateType().
|
private |
Add a descendant (reading) PcodeOp to this Varnode's list.
Put a new operator in the descendant list and set the cover dirty flag
op | is PcodeOp to add |
References coverdirty, descend, and setFlags().
Referenced by Funcdata::opSetInput(), and VarnodeBank::replace().
|
private |
Turn on the Cover object for this Varnode.
Initialize a new Cover and set dirty bit so that updateCover will rebuild.
References cover, coverdirty, hasCover(), and setFlags().
Referenced by Funcdata::assignHigh(), and Funcdata::setVarnodeProperties().
|
private |
Turn off any coverage information.
Delete the Cover object. Used for dead Varnodes before full deletion.
References cover.
Referenced by Funcdata::clearDeadVarnodes(), and Funcdata::opUnsetOutput().
|
private |
Internal method for clearing boolean attributes.
Clear desired boolean attributes on this Varnode and then set dirty bits if appropriate
fl | is the mask containing the list of attributes to clear |
References coverdirty, flags, and high.
Referenced by Funcdata::clearSymbolLinks(), Funcdata::fillinReadOnly(), VarnodeBank::makeFree(), setDef(), Funcdata::syncVarnodesWithSymbol(), and updateCover().
int4 Varnode::contains | ( | const Varnode & | op | ) | const |
Return info about the containment of op in this.
Return various values depending on the containment of another Varnode within this. Return
op | is the Varnode to test for containment |
References Address::getOffset(), Address::getSpace(), AddrSpace::getType(), IPTR_CONSTANT, loc, and size.
Referenced by ActionMarkExplicit::baseExplicit().
bool Varnode::copyShadow | ( | const Varnode * | op2 | ) | const |
Are this and op2 copied from the same source?
Make a local determination if this and op2 hold the same value. We check if there is a common ancester for which both this and op2 are created from a direct sequence of COPY operations. NOTE: This is a transitive relationship
op2 | is the Varnode to compare to this |
References CPUI_COPY.
Referenced by Merge::blockIntersection(), Merge::eliminateIntersect(), Merge::hideShadows(), and Merge::inflateTest().
void Varnode::copySymbol | ( | const Varnode * | vn | ) |
Copy symbol info from vn.
Copy any symbol and type information from -vn- into this
vn | is the Varnode to copy from |
References flags, high, mapentry, namelock, HighVariable::setSymbol(), type, and typelock.
Referenced by RuleAndCompare::applyOp(), RuleAddUnsigned::applyOp(), copySymbolIfValid(), Funcdata::opSetInput(), and Funcdata::replaceLessequal().
void Varnode::copySymbolIfValid | ( | const Varnode * | vn | ) |
Copy symbol info from vn if constant value matches.
Symbol information (if present) is copied from the given constant Varnode into this, which also must be constant, but only if the two constants are close in the sense of an equate.
vn | is the given constant Varnode |
References copySymbol(), Address::getOffset(), EquateSymbol::isValueClose(), loc, and size.
Referenced by RuleRangeMeld::applyOp(), and PcodeOp::collapseConstantSymbol().
|
private |
Clear all descendant (reading) PcodeOps.
Completely clear the descendant list Only called if Varnode is about to be irrevocably destroyed
References descend.
Referenced by Funcdata::destroyVarnode().
|
private |
Erase a descendant (reading) PcodeOp from this Varnode's list.
Erase the operation from our descendant list and set the cover dirty flag
op | is the PcodeOp to remove |
References coverdirty, descend, and setFlags().
Referenced by Funcdata::opUnsetInput().
HighVariable * Varnode::getHigh | ( | void | ) | const |
Get the high-level variable associated with this Varnode.
During the course of analysis Varnodes are merged into high-level variables that are intended to be closer to the concept of variables in C source code. For a large portion of the decompiler analysis this concept hasn't been built yet, and this routine will return null. But after a certain point, every Varnode managed by the Funcdata object, with the exception of ones that are marked as annotations, is associated with some HighVariable and will return a non-null result.
References high.
Referenced by ActionMarkImplied::apply(), ActionNameVars::apply(), ActionMarkExplicit::baseExplicit(), Scope::buildDefaultName(), Merge::buildDominantCopy(), Funcdata::buildDynamicSymbol(), ActionSetCasts::castOutput(), ActionMarkImplied::checkImpliedCover(), PrintC::emitInplaceOp(), Funcdata::findHigh(), MapState::gatherHighs(), TypeOp::getInputCast(), TypeOpLoad::getInputCast(), TypeOpStore::getInputCast(), TypeOpIntRight::getInputCast(), TypeOpIntSright::getInputCast(), TypeOpIntDiv::getInputCast(), TypeOpIntSdiv::getInputCast(), TypeOpIntRem::getInputCast(), TypeOpIntSrem::getInputCast(), Merge::inflate(), Merge::inflateTest(), CastStrategyC::isExtensionCastImplied(), Funcdata::linkSymbol(), Funcdata::linkSymbolReference(), ActionNameVars::linkSymbols(), CastStrategyC::localExtensionType(), ActionNameVars::lookForBadJumpTables(), ActionNameVars::lookForFuncParamNames(), ActionNameVars::makeRec(), Funcdata::mapGlobals(), TypeOp::markExplicitUnsigned(), Merge::markInternalCopies(), Merge::mergeAdjacent(), Merge::mergeIndirect(), Merge::mergeOpcode(), Merge::mergeRangeMust(), PrintC::opPtrsub(), PrintC::push_integer(), PrintC::pushSymbol(), PrintLanguage::pushVnExplicit(), PrintLanguage::pushVnLHS(), ScopeLocal::recoverNameRecommendationsForSymbols(), Funcdata::remapDynamicVarnode(), Funcdata::remapVarnode(), Funcdata::saveXmlHigh(), Merge::shadowedVarnode(), Funcdata::syncVarnodesWithSymbol(), and FuncProto::updateInputTypes().
Datatype * Varnode::getLocalType | ( | void | ) | const |
Calculate type of Varnode based on local information.
Make an initial determination of the Datatype of this Varnode. If a Datatype is already set and locked return it. Otherwise look through all the read PcodeOps and the write PcodeOp to determine if the Varnode is getting used as an int, float, or pointer, etc. Throw an exception if no Datatype can be found at all.
References def, descend, PcodeOp::getSlot(), and type.
Referenced by ActionInferTypes::buildLocaltypes().
Get Address when this Varnode first comes into scope.
A Varnode can be defined as "coming into scope" at the Address of the first PcodeOp that writes to that storage location. Within SSA form this first-use address always exists and is unique if we consider inputs to come into scope at the start Address of the function they are in
fd | is the Funcdata containing the tree |
References def.
Referenced by Scope::buildDefaultName(), Funcdata::findLinkedVarnode(), Funcdata::findLinkedVarnodes(), Funcdata::linkSymbol(), Funcdata::setVarnodeProperties(), and Funcdata::syncVarnodesWithSymbols().
bool Varnode::intersects | ( | const Address & | op2loc, |
int4 | op2size | ||
) | const |
Check intersection against an Address range.
Check if this intersects the given Address range
op2loc | is the start of the range |
op2size | is the size of the range in bytes |
References Address::getOffset(), Address::getSpace(), AddrSpace::getType(), IPTR_CONSTANT, loc, and size.
bool Varnode::intersects | ( | const Varnode & | op | ) | const |
Return true if the storage locations intersect.
Check whether the storage locations of two varnodes intersect
op | is the Varnode to compare with this |
References Address::getOffset(), Address::getSpace(), AddrSpace::getType(), IPTR_CONSTANT, loc, and size.
int4 Varnode::isConstantExtended | ( | uintb & | val | ) | const |
Is this an (extended) constant
If this is a constant, or is extended (INT_ZEXT,INT_SEXT) from a constant, the value of the constant is passed back and a non-negative integer is returned, either:
val | is a reference to the constant value that is passed back |
References CPUI_INT_SEXT, CPUI_INT_ZEXT, and def.
PcodeOp * Varnode::loneDescend | ( | void | ) | const |
Return unique reading PcodeOp, or null if there are zero or more than 1.
This is a convenience method for quickly finding the unique PcodeOp that reads this Varnode
References descend.
Referenced by ActionConstantPtr::apply(), RulePushMulti::applyOp(), RuleHighOrderAnd::applyOp(), RuleAndCommute::applyOp(), RuleLeftRight::applyOp(), RuleShiftCompare::applyOp(), RuleZextEliminate::applyOp(), RuleLoadVarnode::applyOp(), RuleSubCommute::applyOp(), RuleZextShiftZext::applyOp(), RuleShiftAnd::applyOp(), RuleSubZext::applyOp(), RuleSLess2Zero::applyOp(), RulePushPtr::applyOp(), RuleSubRight::applyOp(), RuleSubvarSubpiece::applyOp(), Funcdata::attemptDynamicMappingLate(), DynamicHash::buildVnDown(), RuleSubCommute::cancelExtensions(), ActionSetCasts::castInput(), TermOrder::collect(), ValueSetSolver::establishValueSets(), FuncCallSpecs::findPreexistingWhole(), Heritage::floatExtensionRead(), DynamicHash::gatherFirstLevelVars(), TypeOpStore::getInputCast(), Funcdata::linkSymbolReference(), TypeOp::markExplicitUnsigned(), opFlipInPlaceTest(), Heritage::refineRead(), Funcdata::replaceVolatile(), ActionConstantPtr::searchForLoadStore(), and Heritage::splitJoinRead().
bool Varnode::operator< | ( | const Varnode & | op2 | ) | const |
bool Varnode::operator== | ( | const Varnode & | op2 | ) | const |
int4 Varnode::overlap | ( | const Address & | op2loc, |
int4 | op2size | ||
) | const |
Return relative point of overlap with Address range.
Return whether Least Signifigant Byte of this occurs in an Address range I.e. return
op2loc | is the starting Address of the range |
op2size | is the size of the range in bytes |
References Address::isBigEndian(), loc, Address::overlap(), and size.
int4 Varnode::overlap | ( | const Varnode & | op | ) | const |
Return relative point of overlap between two Varnodes.
Return whether Least Signifigant Byte of this occurs in op I.e. return
op | is Varnode to test for overlap |
References Address::isBigEndian(), loc, Address::overlap(), and size.
Referenced by RuleSubRight::applyOp(), ActionMarkExplicit::baseExplicit(), Merge::markInternalCopies(), Heritage::normalizeReadSize(), Heritage::normalizeWriteSize(), Funcdata::setInputVarnode(), and HighVariable::setSymbol().
void Varnode::printCover | ( | ostream & | s | ) | const |
Print raw coverage info about the Varnode.
Print, to a stream, textual information about where this Varnode is in scope within its particular Funcdata. This amounts to a list of address ranges bounding the writes and reads of the Varnode
s | is the output stream |
References cover, coverdirty, flags, and Cover::print().
void Varnode::printInfo | ( | ostream & | s | ) | const |
Print raw attribute info about the Varnode.
Print boolean attribute information about this as keywords to a stream
s | is the output stream |
References consumed, create_index, isAddrTied(), Datatype::printRaw(), printRaw(), and type.
Referenced by HighVariable::printInfo(), and Funcdata::printVarnodeTree().
void Varnode::printRaw | ( | ostream & | s | ) | const |
Print a simple identifier plus additional info identifying Varnode with SSA form.
Print textual information about this Varnode including a base identifier along with enough size and attribute information to uniquely identify the Varnode within a text SSA listing In particular, the identifiers have either "i" or defining op SeqNum information appended to them in parantheses.
s | is the output stream |
References constant, def, flags, input, insert, printRawNoMarkup(), and size.
Referenced by Funcdata::fillinReadOnly(), printInfo(), ValueSet::printRaw(), and printRawHeritage().
void Varnode::printRawHeritage | ( | ostream & | s, |
int4 | depth | ||
) | const |
Print a simple SSA subtree rooted at this.
Recursively print a terse textual representation of the data-flow (SSA) tree rooted at this Varnode
s | is the output stream |
depth | is the current depth of the tree we are at |
References annotation, constant, def, flags, input, and printRaw().
int4 Varnode::printRawNoMarkup | ( | ostream & | s | ) | const |
Print a simple identifier for the Varnode.
Print to the stream either the name of the Varnode, such as a register name, if it exists or print a shortcut character representing the AddrSpace and a hex representation of the offset. This function also computes and returns the expected size of the identifier it prints to facilitate the printing of size modifiers by other print routines
s | is the output stream |
References AddrSpaceManager::getDefaultSize(), Address::getOffset(), Translate::getRegister(), Translate::getRegisterName(), Address::getShortcut(), Address::getSpace(), AddrSpace::getTrans(), loc, VarnodeData::offset, Address::printRaw(), VarnodeData::size, and size.
Referenced by Heritage::heritage(), and printRaw().
void Varnode::saveXml | ( | ostream & | s | ) | const |
Save a description of this as an XML tag.
Write an XML tag, <addr>, with at least the following attributes:
Additionally the tag will contain other optional attributes.
s | is the stream to write the tag to |
References a_v_i(), a_v_u(), Address::getOffset(), Address::getSpace(), isAddrTied(), loc, mergegroup, AddrSpace::saveXmlAttributes(), and size.
Referenced by Funcdata::saveVarnodeXml().
|
private |
Set the defining PcodeOp of this Varnode.
Directly change the defining PcodeOp and set appropriate dirty bits
op | is the pointer to the new PcodeOp, which can be null |
References clearFlags(), coverdirty, def, setFlags(), and written.
Referenced by VarnodeBank::createDef(), VarnodeBank::makeFree(), and VarnodeBank::setDef().
|
private |
Internal method for setting boolean attributes.
Set desired boolean attributes on this Varnode and then set dirty bits if appropriate
fl | is the mask containing the list of attributes to set |
References coverdirty, flags, and high.
Referenced by addDescend(), calcCover(), Funcdata::cloneVarnode(), eraseDescend(), Funcdata::markIndirectOnly(), Funcdata::newCodeRef(), Funcdata::newVarnode(), Funcdata::newVarnodeOut(), Funcdata::nodeSplitCloneVarnode(), VarnodeBank::replace(), setDef(), setSymbolEntry(), setSymbolProperties(), Funcdata::setVarnodeProperties(), Funcdata::spacebase(), Funcdata::spacebaseConstant(), Funcdata::syncVarnodesWithSymbol(), Funcdata::transferVarnodeProperties(), and VarnodeBank::xref().
|
private |
Attach a Symbol to this Varnode.
A reference to the given Symbol is set on this Varnode. The data-type on this Varnode is not changed.
entry | is a mapping to the given Symbol |
References high, mapentry, mapped, namelock, setFlags(), and HighVariable::setSymbol().
Referenced by Funcdata::attemptDynamicMapping(), Funcdata::attemptDynamicMappingLate(), Funcdata::buildDynamicSymbol(), Funcdata::linkSymbol(), Funcdata::remapDynamicVarnode(), and Funcdata::remapVarnode().
|
private |
Set properties from the given Symbol to this Varnode.
The given Symbol's data-type and flags are inherited by this Varnode. If the Symbol is type-locked, a reference to the Symbol is set on this Varnode.
entry | is a mapping to the given Symbol |
References SymbolEntry::getAllFlags(), high, mapentry, setFlags(), HighVariable::setSymbol(), typelock, and SymbolEntry::updateType().
Referenced by Funcdata::attemptDynamicMapping(), Funcdata::newVarnode(), Funcdata::newVarnodeOut(), and Funcdata::setVarnodeProperties().
|
private |
Attach a Symbol reference to this.
Link Symbol information to this as a reference. This only works for a constant Varnode. This used when there is a constant address reference to the Symbol and the Varnode holds the reference, not the actual value of the Symbol.
entry | is a mapping to the given Symbol \off is the byte offset into the Symbol of the reference |
References high, and HighVariable::setSymbolReference().
Referenced by Funcdata::linkSymbolReference().
int4 Varnode::termOrder | ( | const Varnode * | op | ) | const |
Compare two Varnodes based on their term order.
Compare term order of two Varnodes. Used in Term Rewriting strategies to order operands of commutative ops
op | is the Varnode to order against this |
References CPUI_INT_MULT.
|
private |
Internal function for update coverage information.
Rebuild variable cover based on where the Varnode is defined and read. This is only called by the Merge class which knows when to call it properly
References clearFlags(), cover, coverdirty, flags, hasCover(), and Cover::rebuild().
bool Varnode::updateType | ( | Datatype * | ct, |
bool | lock, | ||
bool | override | ||
) |
(Possibly) set the Datatype given various restrictions
Change the Datatype and lock state associated with this Varnode if various conditions are met
ct | is the Datatype to change to |
lock | is true if the new Datatype should be locked |
override | is true if an old lock should be overridden |
References flags, high, type, TYPE_UNKNOWN, typelock, and ~Varnode().
Referenced by ActionPrototypeTypes::apply(), RuleTransformCpool::applyOp(), RulePtrsubCharConstant::applyOp(), ActionSetCasts::castInput(), ActionSetCasts::castOutput(), Funcdata::fillinReadOnly(), Funcdata::opUndoPtradd(), RulePtrsubCharConstant::pushConstFurther(), Funcdata::spacebase(), Funcdata::spacebaseConstant(), Funcdata::syncVarnodesWithSymbol(), SymbolEntry::updateType(), and ActionInferTypes::writeBack().