From e95b220ef18c9dd9e1aecab32b735ff47237f9c7 Mon Sep 17 00:00:00 2001 From: kat Date: Thu, 22 Sep 2022 09:25:01 -0400 Subject: Add the Components API --- python/function.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'python/function.py') diff --git a/python/function.py b/python/function.py index 93ed8b49..d093c076 100644 --- a/python/function.py +++ b/python/function.py @@ -61,6 +61,7 @@ from .variable import ( ) from . import decorators from .enums import RegisterValueType +from . import component ExpressionIndex = int InstructionIndex = int @@ -2196,6 +2197,15 @@ class Function: core.BNFreeTagList(tags, count.value) return result + @property + def parent_components(self): + _components = [] + count = ctypes.c_ulonglong(0) + bn_components = core.BNGetFunctionParentComponents(self.handle, count) + for i in range(count.value): + _components.append(component.Component(self.view, bn_components[i])) + return _components + def get_lifted_il_at( self, addr: int, arch: Optional['architecture.Architecture'] = None ) -> Optional['lowlevelil.LowLevelILInstruction']: -- cgit v1.3.1