From bef4772cfb414ff2e466f541d65c77a6b02b1eb5 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Thu, 13 Feb 2025 17:07:25 -0500 Subject: Associate a RemoteProject to a Project when applicable --- binaryninjaapi.h | 6 ++++++ binaryninjacore.h | 4 +++- project.cpp | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 81c0c4a8..78843a48 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -2776,6 +2776,10 @@ namespace BinaryNinja { }; + namespace Collaboration + { + class RemoteProject; + } /*! \ingroup project @@ -2827,6 +2831,8 @@ namespace BinaryNinja { void BeginBulkOperation(); void EndBulkOperation(); + + Ref GetRemoteProject(); }; /*! diff --git a/binaryninjacore.h b/binaryninjacore.h index 8e1e6141..aeefea09 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 94 +#define BN_CURRENT_CORE_ABI_VERSION 95 // 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 @@ -3891,6 +3891,8 @@ extern "C" BINARYNINJACOREAPI void BNProjectBeginBulkOperation(BNProject* project); BINARYNINJACOREAPI void BNProjectEndBulkOperation(BNProject* project); + BINARYNINJACOREAPI BNRemoteProject* BNProjectGetRemoteProject(BNProject* project); + // ProjectFile object BINARYNINJACOREAPI BNProjectFile* BNNewProjectFileReference(BNProjectFile* file); BINARYNINJACOREAPI void BNFreeProjectFile(BNProjectFile* file); diff --git a/project.cpp b/project.cpp index 54e873dc..6072054f 100644 --- a/project.cpp +++ b/project.cpp @@ -522,6 +522,16 @@ void Project::EndBulkOperation() } +Ref Project::GetRemoteProject() +{ + + BNRemoteProject* project = BNProjectGetRemoteProject(m_object); + if (project == nullptr) + return nullptr; + return new Collaboration::RemoteProject(project); +} + + ProjectFile::ProjectFile(BNProjectFile* file) { m_object = file; -- cgit v1.3.1