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/platform.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'python/platform.py') diff --git a/python/platform.py b/python/platform.py index 543e7c54..2d061172 100644 --- a/python/platform.py +++ b/python/platform.py @@ -286,6 +286,25 @@ class Platform(with_metaclass(_PlatformMetaClass, object)): core.BNFreeSystemCallList(call_list, count.value) return result + @property + def type_libraries(self): + count = ctypes.c_ulonglong(0) + libs = core.BNGetPlatformTypeLibraries(self.handle, count) + result = [] + for i in range(0, count.value): + result.append(binaryninja.TypeLibrary(core.BNNewTypeLibraryReference(libs[i]))) + core.BNFreeTypeLibraryList(libs, count.value) + return result + + def type_libraries_by_name(self, name): + count = ctypes.c_ulonglong(0) + libs = core.BNGetPlatformTypeLibrariesByName(self.handle, name, count) + result = [] + for i in range(0, count.value): + result.append(binaryninja.TypeLibrary(core.BNNewTypeLibraryReference(libs[i]))) + core.BNFreeTypeLibraryList(libs, count.value) + return result + def __setattr__(self, name, value): try: object.__setattr__(self, name, value) -- cgit v1.3.1