Ghidra Decompiler Analysis Engine
Public Member Functions | Static Public Member Functions | List of all members
ConditionMarker Class Reference

A helper class for describing the similarity of the boolean condition between 2 CBRANCH operations. More...

#include <condexe.hh>

Public Member Functions

 ConditionMarker (void)
 Constructor.
 
 ~ConditionMarker (void)
 Destructor. More...
 
bool verifyCondition (PcodeOp *op, PcodeOp *initop)
 Perform the correlation test on two CBRANCH operations.
 

Static Public Member Functions

static bool varnodeSame (Varnode *a, Varnode *b)
 Do the given Varnodes hold the same value, possibly as constants. More...
 
static bool varnodeComplement (Varnode *a, Varnode *b)
 Do the given boolean Varnodes always hold complementary values. More...
 

Detailed Description

A helper class for describing the similarity of the boolean condition between 2 CBRANCH operations.

This class determines if two CBRANCHs share the same condition. It also determines if the conditions are complements of each other, and/or they are shared along only one path.

The expression computing the root boolean value for one CBRANCH is marked out by setupInitOp(). For the other CBRANCH, findMatch() tries to find common Varnode in its boolean expression and then maps a critical path from the Varnode to the final boolean. Assuming the common Varnode exists, the method finalJudgement() decides if the two boolean values are the same, uncorrelated, or complements of one another.

Constructor & Destructor Documentation

◆ ~ConditionMarker()

ConditionMarker::~ConditionMarker ( void  )

Destructor.

Any marks on Varnodes in the root expression are cleared.

Member Function Documentation

◆ varnodeComplement()

bool ConditionMarker::varnodeComplement ( Varnode a,
Varnode b 
)
static

Do the given boolean Varnodes always hold complementary values.

Test if they are constants, 1 and 0, or if one is the direct BOOL_NEGATE of the other.

Parameters
ais the first Varnode to compare
bis the second Varnode to compare
Returns
true if the Varnodes (always) hold complementary values

◆ varnodeSame()

bool ConditionMarker::varnodeSame ( Varnode a,
Varnode b 
)
static

Do the given Varnodes hold the same value, possibly as constants.

Parameters
ais the first Varnode to compare
bis the second Varnode
Returns
true if the Varnodes (always) hold the same value

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