summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorkat <kat@vector35.com>2024-07-24 11:15:31 -0400
committerkat <kat@vector35.com>2024-07-24 11:30:01 -0400
commit892a0729a587d3a4e8ac248e4eee8a73c7ccc5d1 (patch)
tree318cd5a947b4c1feb9ca84c92f3a457338eeb93d /python
parentdfca98643532126fa78999192900d37b654e46ff (diff)
Add Platform::GetRelatedPlatforms
Diffstat (limited to 'python')
-rw-r--r--python/platform.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/python/platform.py b/python/platform.py
index 72f08341..767af952 100644
--- a/python/platform.py
+++ b/python/platform.py
@@ -546,6 +546,21 @@ class Platform(metaclass=_PlatformMetaClass):
return None
return CorePlatform._from_cache(handle=result)
+ def get_related_platforms(self) -> List['Platform']:
+ """
+ ``get_related_platforms`` returns a list of all related platforms for a given platform
+
+ :return:
+ """
+ count = ctypes.c_ulonglong()
+ platforms = core.BNGetRelatedPlatforms(self.handle, count)
+ assert platforms is not None, "core.BNGetRelatedPlatforms returned None"
+ result = []
+ for i in range(0, count.value):
+ result.append(CorePlatform._from_cache(core.BNNewPlatformReference(platforms[i])))
+ core.BNFreePlatformList(platforms, count.value)
+ return result
+
def add_related_platform(self, arch, platform):
core.BNAddRelatedPlatform(self.handle, arch.handle, platform.handle)