From f9b8762d49ef16bf2dd7b814d6f1ef06594b2951 Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Fri, 21 Mar 2025 11:00:15 -0400 Subject: Add some workflow machine control commands to the C++ API. --- binaryninjaapi.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 5fc2f5a6..c83e8ee8 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -10077,10 +10077,33 @@ namespace BinaryNinja { Ref m_view; Ref m_function; + bool PostRequest(const std::string& command); + public: WorkflowMachine(Ref view); WorkflowMachine(Ref function); + /*! Start the workflow WorkflowMachine + Starts the workflow machine for the given BinaryView or Function. + \return true if the command is accepted, false otherwise. + */ + bool Run(); + + /*! Halt the workflow machine + + Halts analysis at a resumable point. + \return true if the command is accepted, false otherwise. + */ + bool Halt(); + + /*! Reset the workflow machine + + Resets the workflow machine to its initial state. + \return true if the command is accepted, false otherwise. + */ + bool Reset(); + + /*! Enable the workflow machine Re-enables the workflow machine if it is in the Suspend state. @@ -10096,6 +10119,19 @@ namespace BinaryNinja { */ bool Disable(); + /*! Step the workflow machine + + Steps the workflow machine through a single activity. + \return true if the command is accepted, false otherwise. + */ + bool Step(); + + /*! Get the current state of the workflow machine + + Returns the current state of the workflow machine. + \return The current state of the workflow machine + */ + std::string GetState(); std::optional QueryOverride(const std::string& activity); bool SetOverride(const std::string& activity, bool enable); -- cgit v1.3.1