summaryrefslogtreecommitdiff
path: root/mediumlevelil.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 /mediumlevelil.cpp
parent1268fa1d1d36d24d088982e61856d093a59611bd (diff)
Add SetExprType API to MLIL/HLIL
Add get/set_expr_type to MLIL/HLIL Python APi
Diffstat (limited to 'mediumlevelil.cpp')
-rw-r--r--mediumlevelil.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/mediumlevelil.cpp b/mediumlevelil.cpp
index cc619708..ba2c94a3 100644
--- a/mediumlevelil.cpp
+++ b/mediumlevelil.cpp
@@ -842,6 +842,22 @@ Confidence<Ref<Type>> MediumLevelILFunction::GetExprType(const MediumLevelILInst
}
+void MediumLevelILFunction::SetExprType(size_t expr, const Confidence<Ref<Type>>& type)
+{
+ BNTypeWithConfidence tc;
+ tc.type = type->GetObject();
+ tc.confidence = type.GetConfidence();
+ BNSetMediumLevelILExprType(m_object, expr, &tc);
+}
+
+
+void MediumLevelILFunction::SetExprType(const BinaryNinja::MediumLevelILInstruction& expr,
+ const Confidence<Ref<BinaryNinja::Type>>& type)
+{
+ SetExprType(expr.exprIndex, type);
+}
+
+
Ref<FlowGraph> MediumLevelILFunction::CreateFunctionGraph(DisassemblySettings* settings)
{
BNFlowGraph* graph = BNCreateMediumLevelILFunctionGraph(m_object, settings ? settings->GetObject() : nullptr);