summaryrefslogtreecommitdiff
path: root/highlevelil.cpp
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2022-09-30 16:35:17 +0800
committerXusheng <xusheng@vector35.com>2022-10-05 11:35:20 +0800
commit4792eaf70e1ebe2c2f2a68c188a65a0a46e39acf (patch)
treeede7281639b235dbee57cd221d16d0da09d98a1f /highlevelil.cpp
parent1268fa1d1d36d24d088982e61856d093a59611bd (diff)
Add SetExprType API to MLIL/HLIL
Add get/set_expr_type to MLIL/HLIL Python APi
Diffstat (limited to 'highlevelil.cpp')
-rw-r--r--highlevelil.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/highlevelil.cpp b/highlevelil.cpp
index d0b3b4e2..7d3789d9 100644
--- a/highlevelil.cpp
+++ b/highlevelil.cpp
@@ -501,6 +501,22 @@ Confidence<Ref<Type>> HighLevelILFunction::GetExprType(const HighLevelILInstruct
}
+void HighLevelILFunction::SetExprType(size_t expr, const Confidence<Ref<Type>>& 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<Ref<BinaryNinja::Type>>& type)
+{
+ SetExprType(expr.exprIndex, type);
+}
+
+
void HighLevelILFunction::VisitAllExprs(const function<bool(const HighLevelILInstruction& expr)>& func)
{
GetRootExpr().VisitExprs([&](const HighLevelILInstruction& expr) { return func(expr); });