diff options
| author | kat <kat@vector35.com> | 2023-01-03 14:29:32 -0500 |
|---|---|---|
| committer | kat <kat@vector35.com> | 2023-02-20 13:23:31 -0500 |
| commit | fcfa33a14fc309984880b535b9f9b4fcfc316466 (patch) | |
| tree | 0d2b1c62e9939d357a508a446f440541709625e4 /binaryninjaapi.h | |
| parent | 982d90f20e400c7fe7b254eee31fe7eca4e11c2c (diff) | |
Allow DataVariables to be added to Components
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 34a45160..a364e5d9 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -2017,7 +2017,8 @@ namespace BinaryNinja { void* ctxt, BNBinaryView* data, BNComponent* formerParent, BNComponent* newParent, BNComponent* component); static void ComponentFunctionAddedCallback(void* ctxt, BNBinaryView* data, BNComponent* component, BNFunction* function); static void ComponentFunctionRemovedCallback(void* ctxt, BNBinaryView* data, BNComponent* component, BNFunction* function); - + static void ComponentDataVariableAddedCallback(void* ctxt, BNBinaryView* data, BNComponent* component, BNDataVariable* var); + static void ComponentDataVariableRemovedCallback(void* ctxt, BNBinaryView* data, BNComponent* component, BNDataVariable* var); public: BinaryDataNotification(); @@ -2271,6 +2272,32 @@ namespace BinaryNinja { (void)component; (void)function; } + + /*! This notification is posted whenever a DataVariable is added to a Component + + \param data BinaryView containing the Component and DataVariable + \param component Component the DataVariable was added to + \param var The DataVariable which was added + */ + virtual void OnComponentDataVariableAdded(BinaryView* data, Component* component, const DataVariable& var) + { + (void)data; + (void)component; + (void)var; + } + + /*! This notification is posted whenever a DataVariable is removed from a Component + + \param data BinaryView containing the Component and DataVariable + \param component Component the DataVariable was removed from + \param var The DataVariable which was removed + */ + virtual void OnComponentDataVariableRemoved(BinaryView* data, Component* component, const DataVariable& var) + { + (void)data; + (void)component; + (void)var; + } }; /*! @@ -4279,6 +4306,9 @@ namespace BinaryNinja { */ bool RemoveComponent(std::string guid); + std::vector<Ref<Component>> GetFunctionParentComponents(Ref<Function> function) const; + std::vector<Ref<Component>> GetDataVariableParentComponents(DataVariable var) const; + /*! Check whether the given architecture supports assembling instructions \param arch Architecture to check @@ -8483,7 +8513,6 @@ namespace BinaryNinja { \return Whether this function needs update */ bool NeedsUpdate() const; - std::vector<Ref<Component>> GetParentComponents() const; /*! Get a list of Basic Blocks for this function @@ -14723,6 +14752,8 @@ namespace BinaryNinja { */ bool AddComponent(Ref<Component> component); + bool AddDataVariable(DataVariable dataVariable); + /*! Remove a Component from this Component, moving it to the root component. This will not remove a component from the tree entirely. @@ -14741,6 +14772,8 @@ namespace BinaryNinja { */ bool RemoveFunction(Ref<Function> func); + bool RemoveDataVariable(DataVariable dataVariable); + /*! Get a list of types referenced by the functions in this Component. \return vector of Type objects @@ -14759,6 +14792,12 @@ namespace BinaryNinja { */ std::vector<Ref<Function>> GetContainedFunctions(); + /*! Get a list of datavariables added to this component + + \return list of DataVariables + */ + std::vector<DataVariable> GetContainedDataVariables(); + /*! Get a list of DataVariables referenced by the functions in this Component. \return vector of DataVariable objects |
