summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorBrandon Miller <brandon@vector35.com>2025-04-25 13:30:45 -0400
committerRyan Snyder <ryan@vector35.com>2025-06-23 13:44:12 -0400
commitb079d1a1e19151f5c39de84c2e1e6cc6a91abc74 (patch)
tree8cf27224630b690fcfdfd490ee43ec1cd56fc9b6 /binaryview.cpp
parent76215b86ff629da58aa94d4cf4093d2e67017412 (diff)
Perform BB analysis from Architecture C++ API
This commit moves AnalyzeBasicBlocks from the binary ninja core to the API and allows architecture plugins to optionally override AnalyzeBasicBlocks for a custom implementation Supply ABB inputs in BNBasicBlockAnalysisContext Register default analyze basic blocks callback This allows the nanomips and rust core architecture plugins to work again while using the C++ API DefaultAnalyzeBasicBlocks Use default ABB from Python plugins Fix bug in API ArchAndAddr operator overload Python APIs for basic block analysis
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index d8477826..66ef0e10 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -2186,6 +2186,12 @@ void BinaryView::AbortAnalysis()
}
+bool BinaryView::AnalysisIsAborted() const
+{
+ return BNAnalysisIsAborted(m_object);
+}
+
+
void BinaryView::DefineDataVariable(uint64_t addr, const Confidence<Ref<Type>>& type)
{
BNTypeWithConfidence tc;
@@ -5268,6 +5274,20 @@ void BinaryView::SetNewAutoFunctionAnalysisSuppressed(bool suppress)
}
+bool BinaryView::ShouldSkipTargetAnalysis(const ArchAndAddr& source, Ref<Function> sourceFunc,
+ uint64_t sourceEnd, const ArchAndAddr& target)
+{
+ BNArchitectureAndAddress sourceCopy;
+ sourceCopy.arch = source.arch ? source.arch->GetObject() : nullptr;
+ sourceCopy.address = source.address;
+ BNArchitectureAndAddress targetCopy;
+ targetCopy.address = target.address;
+ targetCopy.arch = target.arch ? target.arch->GetObject() : nullptr;
+ auto func = sourceFunc ? sourceFunc->GetObject() : nullptr;
+ return BNShouldSkipTargetAnalysis(m_object, &sourceCopy, func, sourceEnd, &targetCopy);
+}
+
+
set<NameSpace> BinaryView::GetNameSpaces() const
{
set<NameSpace> nameSpaces;