From 892a0729a587d3a4e8ac248e4eee8a73c7ccc5d1 Mon Sep 17 00:00:00 2001 From: kat Date: Wed, 24 Jul 2024 11:15:31 -0400 Subject: Add Platform::GetRelatedPlatforms --- platform.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'platform.cpp') diff --git a/platform.cpp b/platform.cpp index 55044595..dc01b5ae 100644 --- a/platform.cpp +++ b/platform.cpp @@ -532,6 +532,22 @@ void Platform::AddRelatedPlatform(Architecture* arch, Platform* platform) } +std::vector> Platform::GetRelatedPlatforms() +{ + size_t count; + BNPlatform** related = BNGetRelatedPlatforms(m_object, &count); + + std::vector> result; + for (size_t i = 0; i < count; i++) + { + result.push_back(new CorePlatform(BNNewPlatformReference(related[i]))); + } + + BNFreePlatformList(related, count); + return result; +} + + Ref Platform::GetAssociatedPlatformByAddress(uint64_t& addr) { BNPlatform* platform = BNGetAssociatedPlatformByAddress(m_object, &addr); -- cgit v1.3.1