From 5c82c6036e04936e253d2031f73f8218bbed06aa Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Fri, 3 Sep 2021 11:12:56 -0400 Subject: Commonize _to_core_struct/_from_core_struct Improve implementation of immutable_copy/mutable_copy --- python/lineardisassembly.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python/lineardisassembly.py') diff --git a/python/lineardisassembly.py b/python/lineardisassembly.py index bc09636b..5f69c9c4 100644 --- a/python/lineardisassembly.py +++ b/python/lineardisassembly.py @@ -73,7 +73,7 @@ class LinearViewObjectIdentifier: def __hash__(self): return hash((self._name, self._start, self._end)) - def _to_api_object(self, obj = None): + def _to_core_struct(self, obj = None): if obj is None: result = core.BNLinearViewObjectIdentifier() else: @@ -224,7 +224,7 @@ class LinearViewObject: return LinearViewObject(result, self) def child_for_identifier(self, ident): - ident_obj = ident._to_api_object() + ident_obj = ident._to_core_struct() result = core.BNGetLinearViewObjectChildForIdentifier(self.handle, ident_obj) if not result: return None @@ -466,7 +466,7 @@ class LinearViewCursor: return core.BNSeekLinearViewCursorToCursorPathAndAddress(self.handle, path.handle, addr) path_objs = (core.BNLinearViewObjectIdentifier * len(path))() for i in range(0, len(path)): - path[i]._to_api_object(path_objs[i]) + path[i]._to_core_struct(path_objs[i]) if addr is None: return core.BNSeekLinearViewCursorToPath(self.handle, path_objs, len(path)) return core.BNSeekLinearViewCursorToPathAndAddress(self.handle, path_objs, len(path), addr) -- cgit v1.3.1