From faaf191349e170403273c0496df24c65a3536f34 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Fri, 11 Oct 2024 21:39:52 -0400 Subject: Allow `current_il_instruction` to work in Pseudo C (or any high level language) --- highlevelil.cpp | 2 +- python/scriptingprovider.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/highlevelil.cpp b/highlevelil.cpp index 698b6119..89cf645f 100644 --- a/highlevelil.cpp +++ b/highlevelil.cpp @@ -717,7 +717,7 @@ void HighLevelILTokenEmitter::EndForceZeroConfidence() HighLevelILTokenEmitter::CurrentExprGuard HighLevelILTokenEmitter::SetCurrentExpr(const HighLevelILInstruction& expr) { - return CurrentExprGuard(*this, {expr.address, expr.sourceOperand, expr.exprIndex, expr.instructionIndex}); + return CurrentExprGuard(*this, {expr.address, expr.sourceOperand, expr.exprIndex, expr.GetInstructionIndex()}); } diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index 4b76939f..3c673542 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -1823,7 +1823,7 @@ def _get_current_il_function(instance: PythonScriptingInstance): return instance.interpreter.locals["current_mlil"] elif ilType.view_type == FunctionGraphType.MediumLevelILSSAFormFunctionGraph: return instance.interpreter.locals["current_mlil_ssa"] - elif ilType.view_type == FunctionGraphType.HighLevelILFunctionGraph: + elif ilType.view_type == FunctionGraphType.HighLevelILFunctionGraph or ilType.view_type == FunctionGraphType.HighLevelLanguageRepresentationFunctionGraph: return instance.interpreter.locals["current_hlil"] elif ilType.view_type == FunctionGraphType.HighLevelILSSAFormFunctionGraph: return instance.interpreter.locals["current_hlil_ssa"] -- cgit v1.3.1