Ghidra 11.3.2
Ghidra internal decompiler documentation.
|
Static methods for determining if two boolean expressions are the same or complementary. More...
#include <op.hh>
Public Types | |
enum | { same = 1 , complementary = 2 , uncorrelated = 3 } |
Static Public Member Functions | |
static int4 | evaluate (Varnode *vn1, Varnode *vn2, int4 depth) |
Determine if two boolean Varnodes hold related values. | |
Static Private Member Functions | |
static bool | sameOpComplement (PcodeOp *bin1op, PcodeOp *bin2op) |
Test if two operations with same opcode produce complementary boolean values. | |
static bool | varnodeSame (Varnode *a, Varnode *b) |
Do the given Varnodes hold the same value, possibly as constants. | |
Static methods for determining if two boolean expressions are the same or complementary.
Traverse (upto a specific depth) the two boolean expressions consisting of BOOL_AND, BOOL_OR, and BOOL_XOR operations. Leaf operators in the expression can be other operators with boolean output (INT_LESS, INT_SLESS, etc.).
anonymous enum |
Determine if two boolean Varnodes hold related values.
The values may be the same, or opposite of each other (complementary). Otherwise the values are uncorrelated. The trees constructing each Varnode are examined up to a maximum depth. If this is exceeded uncorrelated is returned.
vn1 | is the first boolean Varnode |
vn2 | is the second boolean Varnode |
depth | is the maximum depth to traverse in the evaluation |
References ghidra::PcodeOp::code(), complementary, ghidra::CPUI_BOOL_AND, ghidra::CPUI_BOOL_NEGATE, ghidra::CPUI_BOOL_OR, ghidra::CPUI_BOOL_XOR, ghidra::CPUI_MAX, evaluate(), ghidra::Varnode::getDef(), ghidra::PcodeOp::getIn(), ghidra::PcodeOp::isBoolOutput(), ghidra::Varnode::isWritten(), same, sameOpComplement(), uncorrelated, and varnodeSame().
Referenced by evaluate(), ghidra::RuleBooleanUndistribute::isMatch(), and ghidra::BooleanExpressionMatch::verifyCondition().
Test if two operations with same opcode produce complementary boolean values.
This only tests for cases where the opcode is INT_LESS or INT_SLESS and one of the inputs is constant.
bin1op | is the first p-code op to compare |
bin2op | is the second p-code op to compare |
References ghidra::PcodeOp::code(), ghidra::CPUI_INT_LESS, ghidra::CPUI_INT_SLESS, ghidra::PcodeOp::getIn(), ghidra::Varnode::getOffset(), ghidra::Varnode::getSize(), ghidra::Varnode::isConstant(), and varnodeSame().
Referenced by evaluate().
Do the given Varnodes hold the same value, possibly as constants.
References ghidra::Varnode::getOffset(), and ghidra::Varnode::isConstant().
Referenced by evaluate(), and sameOpComplement().