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 --- mediumlevelil.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mediumlevelil.cpp') diff --git a/mediumlevelil.cpp b/mediumlevelil.cpp index cc619708..ba2c94a3 100644 --- a/mediumlevelil.cpp +++ b/mediumlevelil.cpp @@ -842,6 +842,22 @@ Confidence> MediumLevelILFunction::GetExprType(const MediumLevelILInst } +void MediumLevelILFunction::SetExprType(size_t expr, const Confidence>& 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>& type) +{ + SetExprType(expr.exprIndex, type); +} + + Ref MediumLevelILFunction::CreateFunctionGraph(DisassemblySettings* settings) { BNFlowGraph* graph = BNCreateMediumLevelILFunctionGraph(m_object, settings ? settings->GetObject() : nullptr); -- cgit v1.3.1