From 8d66fde3c6a03e8c0509661cdaee5f0f55869f3d Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 28 Mar 2022 11:30:29 -0400 Subject: Ensure plugins are loaded before attempting to build type libs --- python/typelibrary.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'python/typelibrary.py') diff --git a/python/typelibrary.py b/python/typelibrary.py index 0a7bbccc..fb91a8e3 100644 --- a/python/typelibrary.py +++ b/python/typelibrary.py @@ -32,6 +32,7 @@ from . import architecture class TypeLibrary: def __init__(self, handle: core.BNTypeLibraryHandle): + binaryninja._init_plugins() self.handle: core.BNTypeLibraryHandle = core.handle_of_type(handle, core.BNTypeLibrary) def __del__(self): @@ -62,6 +63,7 @@ class TypeLibrary: :param str path: :rtype: TypeLibrary """ + binaryninja._init_plugins() handle: Optional[core.BNTypeLibraryHandle] = core.BNLoadTypeLibraryFromFile(path) if handle is None: return None @@ -314,7 +316,7 @@ class TypeLibrary: .. warning:: Use this api with extreme caution. """ - core.BNAddTypeLibraryNamedTypeSource(self.handle, QualifiedName(name)._to_core_struct(), source) + core.BNAddTypeLibraryNamedTypeSource(self.handle, types.QualifiedName(name)._to_core_struct(), source) def get_named_object(self, name: str) -> Optional[types.Type]: """ -- cgit v1.3.1