summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2024-02-02 16:34:06 -0500
committerPeter LaFosse <peter@vector35.com>2024-02-02 16:34:13 -0500
commitefa49ca6d23530b5e1ececccea4a2dc0bbe3406b (patch)
tree5d92af54caae2427889041b3946f3eac7db11c5a /python
parentb7ba4c5cf63e20d0f1c30a3f2393c12dde5eb7c5 (diff)
Fix import_com_type_for_guid for windows x64
Diffstat (limited to 'python')
-rw-r--r--python/binaryview.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 0e508cbf..9b391cf5 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -7503,7 +7503,11 @@ class BinaryView:
if not isinstance(guid, str):
guid = str(guid)
- tl = self.get_type_library("win32common")
+ if self.arch is None:
+ return None
+
+ tl_name = "winX64common" if self.arch.name == "x86_64" else "win32common"
+ tl = self.get_type_library(tl_name)
if tl is None:
return None
@@ -7514,7 +7518,7 @@ class BinaryView:
return None
return self.import_library_type(type_name, tl)
- def import_library_object(self, name: str, lib: Optional[typelibrary.TypeLibrary] = None) -> Optional['_types.Type']:
+ def import_library_object(self, name: str, lib: Optional[typelibrary.TypeLibrary] = None) -> Optional[Tuple['typelibrary.TypeLibrary', '_types.Type']]:
"""
``import_library_object`` recursively imports an object from the specified type library, or, if \
no library was explicitly provided, the first type library associated with the current :py:class:`BinaryView` \