decompiler  1.0.0
Classes | Typedefs | Functions
varnode.hh File Reference

The Varnode and VarnodeBank classes. More...

#include "pcoderaw.hh"
#include "cover.hh"

Classes

struct  VarnodeCompareLocDef
 Compare two Varnode pointers by location then definition. More...
 
struct  VarnodeCompareDefLoc
 Compare two Varnode pointers by definition then location. More...
 
class  Varnode
 A low-level variable or contiguous set of bytes described by an Address and a size. More...
 
class  VarnodeBank
 A container for Varnode objects from a specific function. More...
 

Typedefs

typedef set< Varnode *, VarnodeCompareLocDefVarnodeLocSet
 A set of Varnodes sorted by location (then by definition)
 
typedef set< Varnode *, VarnodeCompareDefLocVarnodeDefSet
 A set of Varnodes sorted by definition (then location)
 

Functions

bool contiguous_test (Varnode *vn1, Varnode *vn2)
 Test if Varnodes are pieces of a whole. More...
 
VarnodefindContiguousWhole (Funcdata &data, Varnode *vn1, Varnode *vn2)
 Retrieve the whole Varnode given pieces. More...
 

Detailed Description

The Varnode and VarnodeBank classes.

Function Documentation

bool contiguous_test ( Varnode vn1,
Varnode vn2 
)

Test if Varnodes are pieces of a whole.

Return true if vn1 contains the high part and vn2 the low part of what was(is) a single value.

Parameters
vn1is the putative high Varnode
vn2is the putative low Varnode
Returns
true if they are pieces of a whole

References PcodeOp::code(), CPUI_SUBPIECE, Varnode::getDef(), PcodeOp::getIn(), Varnode::getOffset(), Varnode::getSize(), Varnode::isInput(), and Varnode::isWritten().

Referenced by RuleSegment::applyOp(), and VarnodeBank::endDef().

Varnode* findContiguousWhole ( Funcdata data,
Varnode vn1,
Varnode vn2 
)

Retrieve the whole Varnode given pieces.

Assuming vn1,vn2 has passed the contiguous_test(), return the Varnode containing the whole value.

Parameters
datais the underlying function
vn1is the high Varnode
vn2is the low Varnode
Returns
the whole Varnode

References PcodeOp::code(), CPUI_SUBPIECE, Varnode::getDef(), PcodeOp::getIn(), and Varnode::isWritten().

Referenced by RuleSegment::applyOp(), and VarnodeBank::endDef().