From ba6d08199b0067adf3222559363a819f4b11c502 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Wed, 18 Jun 2025 00:14:48 -0400 Subject: Add PluginCommand for projects and hide non-contextual commands in linear/graph view --- binaryninjacore.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'binaryninjacore.h') diff --git a/binaryninjacore.h b/binaryninjacore.h index 48b767f8..deca98e5 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -2593,7 +2593,8 @@ extern "C" MediumLevelILFunctionPluginCommand, MediumLevelILInstructionPluginCommand, HighLevelILFunctionPluginCommand, - HighLevelILInstructionPluginCommand + HighLevelILInstructionPluginCommand, + ProjectPluginCommand } BNPluginCommandType; typedef struct BNPluginCommand @@ -2615,6 +2616,7 @@ extern "C" void (*highLevelILFunctionCommand)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func); void (*highLevelILInstructionCommand)( void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func, size_t instr); + void (*projectCommand)(void* ctxt, BNProject* view); bool (*defaultIsValid)(void* ctxt, BNBinaryView* view); bool (*addressIsValid)(void* ctxt, BNBinaryView* view, uint64_t addr); @@ -2628,6 +2630,7 @@ extern "C" bool (*highLevelILFunctionIsValid)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func); bool (*highLevelILInstructionIsValid)( void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func, size_t instr); + bool (*projectIsValid)(void* ctxt, BNProject* view); } BNPluginCommand; typedef struct BNCustomCallingConvention @@ -6987,6 +6990,8 @@ extern "C" BINARYNINJACOREAPI void BNRegisterPluginCommandForHighLevelILInstruction(const char* name, const char* description, void (*action)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func, size_t instr), bool (*isValid)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func, size_t instr), void* context); + BINARYNINJACOREAPI void BNRegisterPluginCommandForProject(const char* name, const char* description, + void (*action)(void* ctxt, BNProject* project), bool (*isValid)(void* ctxt, BNProject* project), void* context); BINARYNINJACOREAPI BNPluginCommand* BNGetAllPluginCommands(size_t* count); BINARYNINJACOREAPI BNPluginCommand* BNGetValidPluginCommands(BNBinaryView* view, size_t* count); @@ -7008,6 +7013,7 @@ extern "C" BNBinaryView* view, BNHighLevelILFunction* func, size_t* count); BINARYNINJACOREAPI BNPluginCommand* BNGetValidPluginCommandsForHighLevelILInstruction( BNBinaryView* view, BNHighLevelILFunction* func, size_t instr, size_t* count); + BINARYNINJACOREAPI BNPluginCommand* BNGetValidPluginCommandsForProject(BNProject* project, size_t* count); BINARYNINJACOREAPI void BNFreePluginCommandList(BNPluginCommand* commands); // Calling conventions -- cgit v1.3.1