From 73368f24d167eedee98e0c7269759558fa98bb36 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Fri, 23 Dec 2022 17:43:18 +0800 Subject: Fix import_library_type and import_library_object passing wrong type of arguments into the core. Fix https://github.com/Vector35/binaryninja-api/issues/3755 --- python/binaryview.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'python') diff --git a/python/binaryview.py b/python/binaryview.py index 1af47236..e3ab5898 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -6990,8 +6990,12 @@ class BinaryView: :rtype: Type """ _name = _types.QualifiedName(name) - _lib = ctypes.POINTER(core.BNTypeLibrary)() - _lib.contents = None if lib is None else lib.handle + _lib = ctypes.POINTER(ctypes.POINTER(core.BNTypeLibrary))() + if lib is not None: + _lib.contents = lib.handle + else: + _lib.contents = ctypes.POINTER(core.BNTypeLibrary)() + handle = core.BNBinaryViewImportTypeLibraryType( self.handle, _lib, _name._to_core_struct() ) @@ -7017,8 +7021,12 @@ class BinaryView: :rtype: Type """ _name = _types.QualifiedName(name) - _lib = ctypes.POINTER(core.BNTypeLibrary)() - _lib.contents = None if lib is None else lib.handle + _lib = ctypes.POINTER(ctypes.POINTER(core.BNTypeLibrary))() + if lib is not None: + _lib.contents = lib.handle + else: + _lib.contents = ctypes.POINTER(core.BNTypeLibrary)() + handle = core.BNBinaryViewImportTypeLibraryObject( self.handle, _lib, _name._to_core_struct() ) -- cgit v1.3.1