Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/a.cpp b/a.cpp
- index 395d5c9..b243544 100644
- --- a/a.cpp
- +++ b/a.cpp
- @@ -1,3 +1,5 @@
- +auto ast = api.getAstContext();
- +
- // Triton API has changed a lot. Commenting for now
- auto path_constraint = ponce_runtime_status.myPathConstraints[bound];
- if (path_constraint.conditionAddr == pc)
- @@ -10,16 +12,16 @@ if (path_constraint.conditionAddr == pc)
- if (cmdOptions.showExtraDebugInfo)
- msg("[+] Keeping condition %d\n", j);
- triton::usize ripId = ponce_runtime_status.myPathConstraints[j].conditionRipId;
- - auto symExpr = api.unrollAstFromId(ripId);
- + auto symExpr = api.getSymbolicExpression(ripId)->getAst();
- ea_t takenAddr = ponce_runtime_status.myPathConstraints[j].takenAddr;
- - expr.push_back(triton::ast::assert_(triton::ast::equal(symExpr, triton::ast::bv(takenAddr, symExpr->getBitvectorSize()))));
- + expr.push_back(ast.equal(symExpr, ast.bv(takenAddr, symExpr->getBitvectorSize())));
- }
- if (cmdOptions.showExtraDebugInfo)
- msg("[+] Inverting condition %d\n", bound);
- //And now we negate the selected condition
- triton::usize ripId = ponce_runtime_status.myPathConstraints[bound].conditionRipId;
- - auto symExpr = api.getFullAstFromId(ripId);
- + auto symExpr = api.getSymbolicExpression(ripId)->getAst();
- ea_t notTakenAddr = ponce_runtime_status.myPathConstraints[bound].notTakenAddr;
- if (cmdOptions.showExtraDebugInfo) {
- if (inf.is_64bit())
- @@ -27,10 +29,10 @@ if (path_constraint.conditionAddr == pc)
- else
- msg("[+] ripId: %d notTakenAddr: %#x\n", ripId, notTakenAddr);
- }
- - expr.push_back(triton::ast::assert_(triton::ast::equal(symExpr, triton::ast::bv(notTakenAddr, symExpr->getBitvectorSize()))));
- + expr.push_back(ast.equal(symExpr, ast.bv(notTakenAddr, symExpr->getBitvectorSize())));
- //Time to solve
- - auto final_expr = triton::ast::compound(expr);
- + auto final_expr = ast.compound(expr);
- if (cmdOptions.showDebugInfo)
- msg("[+] Solving formula...\n");
- @@ -41,7 +43,9 @@ if (path_constraint.conditionAddr == pc)
- /*Create the full formula*/
- ss << "(set-logic QF_AUFBV)\n";
- /* Then, delcare all symbolic variables */
- - ss << api.getSymbolicEngine()->getVariablesDeclaration();
- + for (auto it : api.getSymbolicVariables()) {
- + ss << ast.declare(ast.variable(v.second));
- + }
- //ss << api.getVariablesDeclaration();
- /* And concat the user expression */
- ss << "\n\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement