summaryrefslogtreecommitdiff
path: root/workflow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'workflow.cpp')
-rw-r--r--workflow.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/workflow.cpp b/workflow.cpp
index d4981c1a..5be636d2 100644
--- a/workflow.cpp
+++ b/workflow.cpp
@@ -235,6 +235,65 @@ bool AnalysisContext::IsOffsetBackedByFile(uint64_t offset)
}
+bool AnalysisContext::IsOffsetCodeSemantics(uint64_t offset)
+{
+ return BNAnalysisContextIsOffsetCodeSemantics(m_object, offset);
+}
+
+
+bool AnalysisContext::IsOffsetExternSemantics(uint64_t offset)
+{
+ return BNAnalysisContextIsOffsetExternSemantics(m_object, offset);
+}
+
+
+bool AnalysisContext::IsOffsetWritableSemantics(uint64_t offset)
+{
+ return BNAnalysisContextIsOffsetWritableSemantics(m_object, offset);
+}
+
+
+bool AnalysisContext::IsOffsetReadOnlySemantics(uint64_t offset)
+{
+ return BNAnalysisContextIsOffsetReadOnlySemantics(m_object, offset);
+}
+
+
+vector<Ref<Section>> AnalysisContext::GetSections()
+{
+ size_t count;
+ BNSection** sections = BNAnalysisContextGetSections(m_object, &count);
+ vector<Ref<Section>> result;
+ result.reserve(count);
+ for (size_t i = 0; i < count; i++)
+ result.push_back(new Section(BNNewSectionReference(sections[i])));
+ BNFreeSectionList(sections, count);
+ return result;
+}
+
+
+Ref<Section> AnalysisContext::GetSectionByName(const string& name)
+{
+ BNSection* section = BNAnalysisContextGetSectionByName(m_object, name.c_str());
+ if (!section)
+ return nullptr;
+ return new Section(section);
+}
+
+
+vector<Ref<Section>> AnalysisContext::GetSectionsAt(uint64_t addr)
+{
+ size_t count;
+ BNSection** sections = BNAnalysisContextGetSectionsAt(m_object, addr, &count);
+ vector<Ref<Section>> result;
+ result.reserve(count);
+ for (size_t i = 0; i < count; i++)
+ result.push_back(new Section(BNNewSectionReference(sections[i])));
+ BNFreeSectionList(sections, count);
+ return result;
+}
+
+
uint64_t AnalysisContext::GetStart()
{
return BNAnalysisContextGetStart(m_object);