diff options
| author | Mason Reed <mason@vector35.com> | 2025-06-18 00:14:48 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-07-02 01:56:54 -0400 |
| commit | ba6d08199b0067adf3222559363a819f4b11c502 (patch) | |
| tree | 7cf917dfbc757d757a9bc4b48c0a5aa6d80b6d3e /binaryninjaapi.h | |
| parent | 00686dfc68ee40b9b7378febadf3c27eb657dff9 (diff) | |
Add PluginCommand for projects and hide non-contextual commands in linear/graph view
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 5b435cf8..bab743d3 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -14757,6 +14757,7 @@ namespace BinaryNinja { Ref<LowLevelILFunction> lowLevelILFunction; Ref<MediumLevelILFunction> mediumLevelILFunction; Ref<HighLevelILFunction> highLevelILFunction; + Ref<Project> project; PluginCommandContext(); }; @@ -14833,6 +14834,12 @@ namespace BinaryNinja { std::function<bool(BinaryView*, const HighLevelILInstruction&)> isValid; }; + struct RegisteredProjectCommand + { + std::function<void(Project*)> action; + std::function<bool(Project*)> isValid; + }; + static void DefaultPluginCommandActionCallback(void* ctxt, BNBinaryView* view); static void AddressPluginCommandActionCallback(void* ctxt, BNBinaryView* view, uint64_t addr); static void RangePluginCommandActionCallback(void* ctxt, BNBinaryView* view, uint64_t addr, uint64_t len); @@ -14849,6 +14856,7 @@ namespace BinaryNinja { void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func); static void HighLevelILInstructionPluginCommandActionCallback( void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func, size_t instr); + static void ProjectPluginCommandActionCallback(void* ctxt, BNProject* project); static bool DefaultPluginCommandIsValidCallback(void* ctxt, BNBinaryView* view); static bool AddressPluginCommandIsValidCallback(void* ctxt, BNBinaryView* view, uint64_t addr); @@ -14866,6 +14874,7 @@ namespace BinaryNinja { void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func); static bool HighLevelILInstructionPluginCommandIsValidCallback( void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func, size_t instr); + static bool ProjectPluginCommandIsValidCallback(void* ctxt, BNProject* project); public: PluginCommand(const BNPluginCommand& cmd); @@ -15692,6 +15701,13 @@ namespace BinaryNinja { const std::function<void(BinaryView* view, const HighLevelILInstruction& instr)>& action, const std::function<bool(BinaryView* view, const HighLevelILInstruction& instr)>& isValid); + static void RegisterForProject(const std::string& name, const std::string& description, + const std::function<void(Project* project)>& action); + + static void RegisterForProject(const std::string& name, const std::string& description, + const std::function<void(Project* project)>& action, + const std::function<bool(Project* project)>& isValid); + /*! Get the list of registered PluginCommands \return The list of registered PluginCommands |
