From 910c34c245d367b75e156e83961a24d7ac0682b0 Mon Sep 17 00:00:00 2001 From: Bradley Fernandez Date: Sat, 12 Sep 2026 13:30:46 -0400 Subject: [PATCH 1/3] 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 29f6cb9121..4a94295595 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 446fdaccad..eeb0a0f9df 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 bfe0d9fee6..6347c524f2 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/3] 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 eeb0a0f9df..9bdbe4814c 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 From ef31dc4cf179bf5e94484ec9c7cbf64a2781f707 Mon Sep 17 00:00:00 2001 From: Bradley Fernandez Date: Wed, 16 Sep 2026 10:59:18 -0400 Subject: [PATCH 3/3] Fixed code quality of plugin uninstall --- binaryninjaapi.h | 4 ---- pluginmanager.cpp | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 4a94295595..6a48daf1d8 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -20915,10 +20915,6 @@ 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); diff --git a/pluginmanager.cpp b/pluginmanager.cpp index 6347c524f2..ead4f14b4d 100644 --- a/pluginmanager.cpp +++ b/pluginmanager.cpp @@ -375,6 +375,10 @@ bool Extension::Install(std::string versionID) } +/* Like Install, but also allows you to install previously installed deprecated plugin. + Intended only for plugin migration: 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). + UNNECESSARY FOR USERS. */ bool Extension::InstallForMigration(std::string versionID) { char* versionIDStr = BNAllocString(versionID.c_str());