From 4792eaf70e1ebe2c2f2a68c188a65a0a46e39acf Mon Sep 17 00:00:00 2001 From: Xusheng Date: Fri, 30 Sep 2022 16:35:17 +0800 Subject: Add SetExprType API to MLIL/HLIL Add get/set_expr_type to MLIL/HLIL Python APi --- highlevelil.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'highlevelil.cpp') diff --git a/highlevelil.cpp b/highlevelil.cpp index d0b3b4e2..7d3789d9 100644 --- a/highlevelil.cpp +++ b/highlevelil.cpp @@ -501,6 +501,22 @@ Confidence> HighLevelILFunction::GetExprType(const HighLevelILInstruct } +void HighLevelILFunction::SetExprType(size_t expr, const Confidence>& type) +{ + BNTypeWithConfidence tc; + tc.type = type->GetObject(); + tc.confidence = type.GetConfidence(); + BNSetHighLevelILExprType(m_object, expr, &tc); +} + + +void HighLevelILFunction::SetExprType(const BinaryNinja::HighLevelILInstruction& expr, + const Confidence>& type) +{ + SetExprType(expr.exprIndex, type); +} + + void HighLevelILFunction::VisitAllExprs(const function& func) { GetRootExpr().VisitExprs([&](const HighLevelILInstruction& expr) { return func(expr); }); -- cgit v1.3.1