From 72cc84aabd188e4add6e5012df86414b65d95bc8 Mon Sep 17 00:00:00 2001 From: Sam Russell Date: Thu, 7 Mar 2024 22:47:26 +0100 Subject: Expose get_expr_count() on python llil and mlil This is already exposed in the CPP interface, and is useful for workflows for enumerating all expressions in an ILFunction --- python/lowlevelil.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'python/lowlevelil.py') diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 590cae83..16ffbd88 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -3721,6 +3721,14 @@ class LowLevelILFunction: assert False, "flags type unsupported" return ExpressionIndex(core.BNLowLevelILAddExpr(self.handle, operation, size, _flags, a, b, c, d)) + def get_expr_count(self) -> int: + """ + ``get_expr_count`` gives a the total number of expressions in this IL function + + You can use this to enumerate all expressions in conjunction with LowLevelILInstruction.create() + """ + return core.BNGetLowLevelILExprCount(self.handle) + def replace_expr(self, original: InstructionOrExpression, new: InstructionOrExpression) -> None: """ ``replace_expr`` allows modification of expressions but ONLY during lifting. -- cgit v1.3.1