decompiler
1.0.0
|
A helper class to mark up predicated INT_OR expressions. More...
Public Member Functions | |
bool | discoverZeroSlot (Varnode *vn) |
Check if vn is produced by a 2-branch MULTIEQUAL, one side of which is a zero constant. More... | |
bool | discoverCbranch (void) |
Find CBRANCH operation that determines whether zero is set or not. More... | |
void | discoverPathIsTrue (void) |
Does the condBlock true outgoing edge flow to the block that sets zero. More... | |
bool | discoverConditionalZero (Varnode *vn) |
Verify that CBRANCH boolean expression is either (vn == 0) or (vn != 0) More... | |
Public Attributes | |
PcodeOp * | op |
Base MULTIEQUAL op. | |
int4 | zeroSlot |
Input slot containing path that sets zero. | |
const FlowBlock * | zeroBlock |
Final block in path that sets zero. | |
const FlowBlock * | condBlock |
Conditional block determining if zero is set or not. | |
PcodeOp * | cbranch |
CBRANCH determining if zero is set. | |
Varnode * | otherVn |
Other (non-zero) Varnode getting set on other path. | |
bool | zeroPathIsTrue |
True if path to zero set is the true path out of condBlock. | |
A helper class to mark up predicated INT_OR expressions.
bool RuleOrPredicate::MultiPredicate::discoverCbranch | ( | void | ) |
Find CBRANCH operation that determines whether zero is set or not.
Assuming that op is a 2-branch MULTIEQUAL as per discoverZeroSlot(), try to find a single CBRANCH whose two out edges correspond to the in edges of the MULTIEQUAL. In this case, the boolean expression controlling the CBRANCH is also controlling whether zero flows into the MULTIEQUAL output Varnode.
References CPUI_CBRANCH, FlowBlock::getIn(), FlowBlock::getParent(), FlowBlock::lastOp(), FlowBlock::sizeIn(), and FlowBlock::sizeOut().
Referenced by RuleOrPredicate::applyOp(), and RuleOrPredicate::checkSingle().
bool RuleOrPredicate::MultiPredicate::discoverConditionalZero | ( | Varnode * | vn | ) |
Verify that CBRANCH boolean expression is either (vn == 0) or (vn != 0)
Modify zeroPathIsTrue so that if it is true, then: A vn value equal to zero, causes execution to flow to where the output of MULTIEQUAL is set to zero.
vn | is the given Varnode |
References PcodeOp::code(), CPUI_INT_EQUAL, CPUI_INT_NOTEQUAL, Varnode::getDef(), PcodeOp::getIn(), Varnode::getOffset(), Varnode::isConstant(), and Varnode::isWritten().
Referenced by RuleOrPredicate::checkSingle().
void RuleOrPredicate::MultiPredicate::discoverPathIsTrue | ( | void | ) |
Does the condBlock true outgoing edge flow to the block that sets zero.
The zeroPathIsTrue variable is set based on the current configuration
Referenced by RuleOrPredicate::applyOp(), and RuleOrPredicate::checkSingle().
bool RuleOrPredicate::MultiPredicate::discoverZeroSlot | ( | Varnode * | vn | ) |
Check if vn is produced by a 2-branch MULTIEQUAL, one side of which is a zero constant.
vn | is the given Varnode |
References PcodeOp::code(), CPUI_COPY, CPUI_MULTIEQUAL, Varnode::getDef(), PcodeOp::getIn(), Varnode::getOffset(), Varnode::isConstant(), Varnode::isFree(), Varnode::isWritten(), PcodeOp::numInput(), op, otherVn, and zeroSlot.
Referenced by RuleOrPredicate::applyOp().