summaryrefslogtreecommitdiff
path: root/python/platform.py
diff options
context:
space:
mode:
authorRyan Snyder <ryan@vector35.com>2019-09-11 21:03:56 -0400
committerRyan Snyder <ryan@vector35.com>2019-09-24 10:42:12 -0400
commitc5bd94376017e9d9d98a4dba2fac6b49572cda6d (patch)
treef81ed6dad33b591013cffcf63866627a02f468bb /python/platform.py
parentae51b060402a939afcae5b52e30cfebd4944a26e (diff)
typelibrary: minimal api commit
Diffstat (limited to 'python/platform.py')
-rw-r--r--python/platform.py19
1 files changed, 19 insertions, 0 deletions
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)