From b079d1a1e19151f5c39de84c2e1e6cc6a91abc74 Mon Sep 17 00:00:00 2001 From: Brandon Miller Date: Fri, 25 Apr 2025 13:30:45 -0400 Subject: 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 --- defaultabb/plugin.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 defaultabb/plugin.cpp (limited to 'defaultabb/plugin.cpp') diff --git a/defaultabb/plugin.cpp b/defaultabb/plugin.cpp new file mode 100644 index 00000000..917a03ee --- /dev/null +++ b/defaultabb/plugin.cpp @@ -0,0 +1,12 @@ +#include "binaryninjaapi.h" +#include "binaryninjacore.h" + +using namespace BinaryNinja; + +extern "C" { + BN_DECLARE_CORE_ABI_VERSION + BINARYNINJAPLUGIN bool CorePluginInit() + { + return BNArchitectureSetDefaultAnalyzeBasicBlocksCallback((void *)Architecture::DefaultAnalyzeBasicBlocksCallback); + } +} -- cgit v1.3.1