From e95b220ef18c9dd9e1aecab32b735ff47237f9c7 Mon Sep 17 00:00:00 2001 From: kat Date: Thu, 22 Sep 2022 09:25:01 -0400 Subject: Add the Components API --- function.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'function.cpp') diff --git a/function.cpp b/function.cpp index 96795ef0..12c9d241 100644 --- a/function.cpp +++ b/function.cpp @@ -1446,6 +1446,24 @@ set Function::GetHighLevelILSSAVariablesIfAvailable() } +std::vector> Function::GetParentComponents() const +{ + std::vector> components; + + size_t count; + BNComponent** list = BNGetFunctionParentComponents(m_object, &count); + + components.reserve(count); + for (size_t i = 0; i < count; i++) + { + Ref component = new Component(list[i]); + components.push_back(component); + } + + return components; +} + + void Function::CreateAutoVariable( const Variable& var, const Confidence>& type, const string& name, bool ignoreDisjointUses) { -- cgit v1.3.1