decompiler  1.0.0
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
LoadGuard Class Reference

Description of a LOAD operation that needs to be guarded. More...

#include <heritage.hh>

Public Member Functions

bool isGuarded (const Address &addr) const
 Does this guard apply to the given address. More...
 

Private Member Functions

void establishRange (const ValueSetRead &valueSet)
 Convert partial value set analysis into guard range. More...
 
void finalizeRange (const ValueSetRead &valueSet)
 Convert value set analysis to final guard range.
 
void set (PcodeOp *o, AddrSpace *s, uintb off)
 Set a new unanalyzed LOAD guard that initially guards everything. More...
 

Private Attributes

PcodeOpop
 The LOAD op.
 
AddrSpacespc
 The stack space being loaded from.
 
uintb pointerBase
 Base offset of the pointer.
 
uintb minimumOffset
 Minimum offset of the LOAD.
 
uintb maximumOffset
 Maximum offset of the LOAD.
 
int4 step
 Step of any access into this range (0=unknown)
 
int4 analysisState
 0=unanalyzed, 1=analyzed(partial result), 2=analyzed(full result)
 

Friends

class Heritage
 

Detailed Description

Description of a LOAD operation that needs to be guarded.

Heritage maintains a list of CPUI_LOAD ops that reference the stack dynamically. These can potentially alias stack Varnodes, so we maintain what (possibly limited) information we known about the range of stack addresses that can be referenced.

Member Function Documentation

◆ establishRange()

void LoadGuard::establishRange ( const ValueSetRead valueSet)
private

Convert partial value set analysis into guard range.

Make some determination of the range of possible values for a LOAD based an partial value set analysis. This can sometimes get

  • minimumOffset - otherwise the original constant pulled with the LOAD is used
  • step - the partial analysis shows step and direction
  • maximumOffset - in rare cases

isAnalyzed is set to true, if full range analysis is not needed

Parameters
valueSetis the calculated value set as seen by the LOAD operation

References analysisState, AddrSpace::getHighest(), CircleRange::getSize(), maximumOffset, minimumOffset, pointerBase, spc, and step.

◆ isGuarded()

bool LoadGuard::isGuarded ( const Address addr) const

Does this guard apply to the given address.

Check if the address falls within the range defined by this

Parameters
addris the given address
Returns
true if the address is contained

References Address::getOffset(), Address::getSpace(), maximumOffset, minimumOffset, and spc.

Referenced by RuleIndirectCollapse::applyOp().

◆ set()

void LoadGuard::set ( PcodeOp o,
AddrSpace s,
uintb  off 
)
inlineprivate

Set a new unanalyzed LOAD guard that initially guards everything.

Parameters
ois the LOAD op
sis the (stack) space it is loading from
offis the base offset that is indexed from

References analysisState, AddrSpace::getHighest(), maximumOffset, minimumOffset, op, pointerBase, spc, and step.


The documentation for this class was generated from the following files: