From c5bd94376017e9d9d98a4dba2fac6b49572cda6d Mon Sep 17 00:00:00 2001 From: Ryan Snyder Date: Wed, 11 Sep 2019 21:03:56 -0400 Subject: typelibrary: minimal api commit --- python/architecture.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'python/architecture.py') diff --git a/python/architecture.py b/python/architecture.py index 5fe2aec9..296bdab9 100644 --- a/python/architecture.py +++ b/python/architecture.py @@ -31,6 +31,7 @@ import binaryninja from binaryninja import log from binaryninja import lowlevelil from binaryninja import types +from binaryninja import typelibrary from binaryninja import databuffer from binaryninja import platform from binaryninja import callingconvention @@ -430,6 +431,18 @@ class Architecture(with_metaclass(_ArchitectureMetaClass, object)): pl = core.BNGetArchitectureStandalonePlatform(self.handle) return platform.Platform(self, pl) + @property + def type_libraries(self): + """Architecture type libraries""" + count = ctypes.c_ulonglong(0) + result = [] + handles = core.BNGetArchitectureTypeLibraries(self.handle, count) + for i in range(0, count.value): + result.append(typelibrary.TypeLibrary(core.BNNewTypeLibraryReference(handles[i]))) + core.BNFreeTypeLibraryList(handles, count.value) + return result + + def __setattr__(self, name, value): if ((name == "name") or (name == "endianness") or (name == "address_size") or (name == "default_int_size") or (name == "regs") or (name == "get_max_instruction_length") or -- cgit v1.3.1