本文整理汇总了C++中AnalysisProcessor::aluSpreadTaintMemReg方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisProcessor::aluSpreadTaintMemReg方法的具体用法?C++ AnalysisProcessor::aluSpreadTaintMemReg怎么用?C++ AnalysisProcessor::aluSpreadTaintMemReg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisProcessor
的用法示例。
在下文中一共展示了AnalysisProcessor::aluSpreadTaintMemReg方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: memReg
void OrIRBuilder::memReg(AnalysisProcessor &ap, Inst &inst) const {
SymbolicExpression *se;
smt2lib::smtAstAbstractNode *expr, *op1, *op2;
auto mem = this->operands[0].getMem();
auto memSize = this->operands[0].getMem().getSize();
auto reg = this->operands[1].getReg();
auto regSize = this->operands[1].getReg().getSize();
/* Create the SMT semantic */
op1 = ap.buildSymbolicMemOperand(mem, memSize);
op2 = ap.buildSymbolicRegOperand(reg, regSize);
/* Final expr */
expr = smt2lib::bvor(op1, op2);
/* Create the symbolic expression */
se = ap.createMemSE(inst, expr, mem, memSize);
/* Apply the taint */
ap.aluSpreadTaintMemReg(se, mem, reg, memSize);
/* Add the symbolic flags expression to the current inst */
EflagsBuilder::clearFlag(inst, ap, ID_TMP_CF, "Clears carry flag");
EflagsBuilder::clearFlag(inst, ap, ID_TMP_OF, "Clears overflow flag");
EflagsBuilder::pf(inst, se, ap, memSize);
EflagsBuilder::sf(inst, se, ap, memSize);
EflagsBuilder::zf(inst, se, ap, memSize);
}
示例2: memReg
void AddIRBuilder::memReg(AnalysisProcessor &ap, Inst &inst) const {
SymbolicElement *se;
std::stringstream expr, op1, op2;
uint32_t writeSize = this->operands[0].getSize();
uint64_t mem = this->operands[0].getValue();
uint64_t reg = this->operands[1].getValue();
uint32_t regSize = this->operands[1].getSize();
/* Create the SMT semantic */
op1 << ap.buildSymbolicMemOperand(mem, writeSize);
op2 << ap.buildSymbolicRegOperand(reg, regSize);
// Final expr
expr << smt2lib::bvadd(op1.str(), op2.str());
/* Create the symbolic element */
se = ap.createMemSE(inst, expr, mem, writeSize);
/* Apply the taint */
ap.aluSpreadTaintMemReg(se, mem, reg, writeSize);
/* Add the symbolic flags element to the current inst */
EflagsBuilder::af(inst, se, ap, writeSize, op1, op2);
EflagsBuilder::cfAdd(inst, se, ap, op1);
EflagsBuilder::ofAdd(inst, se, ap, writeSize, op1, op2);
EflagsBuilder::pf(inst, se, ap);
EflagsBuilder::sf(inst, se, ap, writeSize);
EflagsBuilder::zf(inst, se, ap, writeSize);
}
示例3: memReg
void SbbIRBuilder::memReg(AnalysisProcessor &ap, Inst &inst) const {
SymbolicExpression *se;
smt2lib::smtAstAbstractNode *expr, *op1, *op2, *op3;
auto memSize = this->operands[0].getMem().getSize();
auto mem = this->operands[0].getMem().getAddress();
auto reg = this->operands[1].getReg().getTritonRegId();
auto regSize = this->operands[1].getReg().getSize();
/* Create the SMT semantic */
op1 = ap.buildSymbolicMemOperand(mem, memSize);
op2 = ap.buildSymbolicRegOperand(reg, regSize);
op3 = ap.buildSymbolicFlagOperand(ID_CF, regSize);
/* Final expr */
expr = smt2lib::bvsub(op1, smt2lib::bvadd(op2, op3));
/* Create the symbolic expression */
se = ap.createMemSE(inst, expr, mem, memSize);
/* Apply the taint */
ap.aluSpreadTaintMemReg(se, mem, reg, memSize);
/* Add the symbolic flags expression to the current inst */
EflagsBuilder::af(inst, se, ap, memSize, op1, op2);
EflagsBuilder::cfSub(inst, se, ap, memSize, op1, op2);
EflagsBuilder::ofSub(inst, se, ap, memSize, op1, op2);
EflagsBuilder::pf(inst, se, ap, memSize);
EflagsBuilder::sf(inst, se, ap, memSize);
EflagsBuilder::zf(inst, se, ap, memSize);
}
示例4: memReg
void AddIRBuilder::memReg(AnalysisProcessor &ap, Inst &inst) const {
SymbolicExpression *se;
smt2lib::smtAstAbstractNode *expr, *op1, *op2;
uint32 writeSize = this->operands[0].getSize();
uint64 mem = this->operands[0].getValue();
uint64 reg = this->operands[1].getValue();
uint32 regSize = this->operands[1].getSize();
/* Create the SMT semantic */
op1 = ap.buildSymbolicMemOperand(mem, writeSize);
op2 = ap.buildSymbolicRegOperand(reg, regSize);
// Final expr
expr = smt2lib::bvadd(op1, op2);
/* Create the symbolic expression */
se = ap.createMemSE(inst, expr, mem, writeSize);
/* Apply the taint */
ap.aluSpreadTaintMemReg(se, mem, reg, writeSize);
/* Add the symbolic flags expression to the current inst */
EflagsBuilder::af(inst, se, ap, writeSize, op1, op2);
EflagsBuilder::cfAdd(inst, se, ap, op1);
EflagsBuilder::ofAdd(inst, se, ap, writeSize, op1, op2);
EflagsBuilder::pf(inst, se, ap, writeSize);
EflagsBuilder::sf(inst, se, ap, writeSize);
EflagsBuilder::zf(inst, se, ap, writeSize);
}
示例5: memReg
void XorIRBuilder::memReg(AnalysisProcessor &ap, Inst &inst) const {
SymbolicElement *se;
std::stringstream expr, op1, op2;
uint32 writeSize = this->operands[0].getSize();
uint64 mem = this->operands[0].getValue();
uint64 reg = this->operands[1].getValue();
uint32 regSize = this->operands[1].getSize();
/* Create the SMT semantic */
op1 << ap.buildSymbolicMemOperand(mem, writeSize);
op2 << ap.buildSymbolicRegOperand(reg, regSize);
// Final expr
expr << smt2lib::bvxor(op1.str(), op2.str());
/* Create the symbolic element */
se = ap.createMemSE(inst, expr, mem, writeSize);
/* Apply the taint */
ap.aluSpreadTaintMemReg(se, mem, reg, writeSize);
/* Add the symbolic flags element to the current inst */
EflagsBuilder::clearFlag(inst, ap, ID_CF, "Clears carry flag");
EflagsBuilder::clearFlag(inst, ap, ID_OF, "Clears overflow flag");
EflagsBuilder::pf(inst, se, ap);
EflagsBuilder::sf(inst, se, ap, writeSize);
EflagsBuilder::zf(inst, se, ap, writeSize);
}