From 910c34c245d367b75e156e83961a24d7ac0682b0 Mon Sep 17 00:00:00 2001 From: Bradley Fernandez Date: Sat, 12 Sep 2026 13:30:46 -0400 Subject: [PATCH 1/2] Add InstallForMigration bypass for deprecated plugin migration Legacy extension migration reused Extension::Install, which rejects deprecated plugins. That's correct for fresh installs from the marketplace, but it also blocked migrating a plugin the user already had installed under the previous extension manager -- if the plugin had since been deprecated, it could never be registered as installed again, and so could never be uninstalled either. InstallForMigration is the same call with only the deprecation guard lifted, intended for use by the migration path only. Co-Authored-By: Claude Sonnet 5 --- binaryninjaapi.h | 5 +++++ binaryninjacore.h | 1 + pluginmanager.cpp | 9 +++++++++ 3 files changed, 15 insertions(+) diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 29f6cb912..4a9429559 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -20915,6 +20915,11 @@ namespace BinaryNinja { bool Uninstall(); bool CancelUninstall(); bool Install(std::string versionID); + // Like Install, but also permits installing a version of a plugin that has since been marked + // deprecated. Intended only for migrating a plugin the user already had installed under a previous + // extension manager: deprecation should block fresh installs, but must never strand a + // previously-installed plugin where it can't be registered as installed (and so can't be uninstalled). + bool InstallForMigration(std::string versionID); bool InstallDependencies(); bool InstallDependencies(const std::string& versionID); bool InstallDependencies(const std::vector& excludedPackageNames); diff --git a/binaryninjacore.h b/binaryninjacore.h index 446fdacca..eeb0a0f9d 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -8910,6 +8910,7 @@ extern "C" BINARYNINJACOREAPI bool BNPluginEnable(BNPlugin* p, bool force); BINARYNINJACOREAPI bool BNPluginDisable(BNPlugin* p); BINARYNINJACOREAPI bool BNPluginInstall(BNPlugin* p, const char* versionID); + BINARYNINJACOREAPI bool BNPluginInstallForMigration(BNPlugin* p, const char* versionID); BINARYNINJACOREAPI bool BNPluginInstallDependencies(BNPlugin* p); BINARYNINJACOREAPI bool BNPluginInstallDependenciesForVersion(BNPlugin* p, const char* versionID); BINARYNINJACOREAPI bool BNPluginInstallDependenciesWithExclusions(BNPlugin* p, diff --git a/pluginmanager.cpp b/pluginmanager.cpp index bfe0d9fee..6347c524f 100644 --- a/pluginmanager.cpp +++ b/pluginmanager.cpp @@ -375,6 +375,15 @@ bool Extension::Install(std::string versionID) } +bool Extension::InstallForMigration(std::string versionID) +{ + char* versionIDStr = BNAllocString(versionID.c_str()); + auto success = BNPluginInstallForMigration(m_object, versionIDStr); + BNFreeString(versionIDStr); + return success; +} + + bool Extension::InstallDependencies() { return InstallDependencies(""); From 6ff5f540e5cef8835ef42035bddf272199ef1ad3 Mon Sep 17 00:00:00 2001 From: Bradley Fernandez Date: Sat, 12 Sep 2026 13:39:09 -0400 Subject: [PATCH 2/2] Bump core ABI version for BNPluginInstallForMigration New C API function affects linking, per the project's own convention for BN_CURRENT_CORE_ABI_VERSION. Not a breaking change, so BN_MINIMUM_CORE_ABI_VERSION is unchanged. Co-Authored-By: Claude Sonnet 5 --- binaryninjacore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binaryninjacore.h b/binaryninjacore.h index eeb0a0f9d..9bdbe4814 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -37,7 +37,7 @@ // Current ABI version for linking to the core. This is incremented any time // there are changes to the API that affect linking, including new functions, // new types, or modifications to existing functions or types. -#define BN_CURRENT_CORE_ABI_VERSION 188 +#define BN_CURRENT_CORE_ABI_VERSION 189 // Minimum ABI version that is supported for loading of plugins. Plugins that // are linked to an ABI version less than this will not be able to load and