From 4c242707996e94877d3e2762a2ef88835e98abbc Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Thu, 17 Nov 2022 17:19:34 -0500 Subject: Type library C++ api & import recording --- platform.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'platform.cpp') diff --git a/platform.cpp b/platform.cpp index b3ec68e8..06d65539 100644 --- a/platform.cpp +++ b/platform.cpp @@ -342,6 +342,38 @@ map Platform::GetSystemCalls() } +vector> Platform::GetTypeLibraries() +{ + size_t count; + BNTypeLibrary** libs = BNGetPlatformTypeLibraries(m_object, &count); + + vector> result; + for (size_t i = 0; i < count; ++i) + { + result.push_back(new TypeLibrary(BNNewTypeLibraryReference(libs[i]))); + } + + BNFreeTypeLibraryList(libs, count); + return result; +} + + +vector> Platform::GetTypeLibrariesByName(const std::string& name) +{ + size_t count; + BNTypeLibrary** libs = BNGetPlatformTypeLibrariesByName(m_object, name.c_str(), &count); + + vector> result; + for (size_t i = 0; i < count; ++i) + { + result.push_back(new TypeLibrary(BNNewTypeLibraryReference(libs[i]))); + } + + BNFreeTypeLibraryList(libs, count); + return result; +} + + Ref Platform::GetTypeByName(const QualifiedName& name) { BNQualifiedName nameObj = name.GetAPIObject(); -- cgit v1.3.1