summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2024-10-19 11:13:54 -0400
committerBrian Potchik <brian@vector35.com>2024-10-19 11:13:54 -0400
commitf5273b29f60826b693b45404a8a428d3f1d1bda5 (patch)
tree98a235307b21266355f328197bfb8389c75e3ba5
parentc9793998fcfa0ebf04cccb3937229b745ccb8bfd (diff)
Improved support for interactive flowgraphs.
-rw-r--r--binaryninjaapi.h2
-rw-r--r--binaryninjacore.h4
-rw-r--r--python/flowgraph.py18
-rw-r--r--ui/flowgraphwidget.h6
4 files changed, 26 insertions, 4 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 1a59a58b..0223757c 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -11401,6 +11401,8 @@ namespace BinaryNinja {
*/
void Show(const std::string& title);
+ bool IsQueryModeEnabled() const { return m_queryMode; }
+
virtual bool HasUpdates() const;
virtual Ref<FlowGraph> Update();
diff --git a/binaryninjacore.h b/binaryninjacore.h
index e08633b1..aaf61c6d 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -960,7 +960,9 @@ extern "C"
FlowGraphIncludesUserComments,
FlowGraphAllowsPatching,
FlowGraphAllowsInlineInstructionEditing,
- FlowGraphShowsSecondaryRegisterHighlighting
+ FlowGraphShowsSecondaryRegisterHighlighting,
+ FlowGraphIsAddressable,
+ FlowGraphIsWorkflowGraph
} BNFlowGraphOption;
typedef enum BNILInstructionAttribute
diff --git a/python/flowgraph.py b/python/flowgraph.py
index c26b20a7..e661fff8 100644
--- a/python/flowgraph.py
+++ b/python/flowgraph.py
@@ -770,6 +770,24 @@ class FlowGraph:
def shows_secondary_reg_highlighting(self, value):
self.set_option(FlowGraphOption.FlowGraphShowsSecondaryRegisterHighlighting, value)
+ @property
+ def is_addressable(self):
+ """Set if flow graph should make use of address information"""
+ return self.is_option_set(FlowGraphOption.FlowGraphIsAddressable)
+
+ @is_addressable.setter
+ def is_addressable(self, value):
+ self.set_option(FlowGraphOption.FlowGraphIsAddressable, value)
+
+ @property
+ def is_workflow_graph(self):
+ """Set if flow graph should be treated as a workflow graph"""
+ return self.is_option_set(FlowGraphOption.FlowGraphIsWorkflowGraph)
+
+ @is_workflow_graph.setter
+ def is_workflow_graph(self, value):
+ self.set_option(FlowGraphOption.FlowGraphIsWorkflowGraph, value)
+
def layout(self, callback=None):
"""
``layout`` starts rendering a graph for display. Once a layout is complete, each node will contain
diff --git a/ui/flowgraphwidget.h b/ui/flowgraphwidget.h
index 321a8480..e41c8586 100644
--- a/ui/flowgraphwidget.h
+++ b/ui/flowgraphwidget.h
@@ -262,6 +262,7 @@ class BINARYNINJAUIAPI FlowGraphWidget :
virtual bool canCopyWithTransform() override;
virtual bool canCut() override;
virtual bool canCopy() override;
+ virtual bool canCopyAddress() override;
virtual bool canPaste() override;
virtual void cut() override;
virtual void copy(TransformRef xform) override;
@@ -312,7 +313,7 @@ class BINARYNINJAUIAPI FlowGraphWidget :
virtual bool goToReference(FunctionRef func, uint64_t source, uint64_t target) override;
- void setHighlightToken(const HighlightTokenState& state, bool notify = true);
+ void setHighlightToken(const HighlightTokenState& state, bool notify = true, bool update = false);
virtual void notifyUpdateInProgress(FunctionRef func);
virtual void onFunctionSelected(FunctionRef func);
@@ -323,8 +324,7 @@ class BINARYNINJAUIAPI FlowGraphWidget :
// and they have out parameters (and thus need to be re-implemented) they must be public
bool getNodeForMouseEvent(QMouseEvent* event, FlowGraphNodeRef& node);
bool getLineForMouseEvent(QMouseEvent* event, CursorPosition& pos);
- bool getEdgeForMouseEvent(
- QMouseEvent* event, FlowGraphNodeRef& source, BinaryNinja::FlowGraphEdge& edge, bool& incoming);
+ bool getEdgeForMouseEvent(QMouseEvent* event, FlowGraphNodeRef& source, BinaryNinja::FlowGraphEdge& edge, bool& incoming);
FlowGraphWidget* duplicate();