class FlowGraphimplements a directed flow graph to be shown in the UI. This class allows plugins to create custom flow graphs and render them in the UI using the flow graph report API.
An example of creating a flow graph and presenting it in the UI:
>>> graph = FlowGraph() >>> node_a = FlowGraphNode(graph) >>> node_a.lines = ["Node A"] >>> node_b = FlowGraphNode(graph) >>> node_b.lines = ["Node B"] >>> node_c = FlowGraphNode(graph) >>> node_c.lines = ["Node C"] >>> graph.append(node_a) 0 >>> graph.append(node_b) 1 >>> graph.append(node_c) 2 >>> edge = EdgeStyle(EdgePenStyle.DashDotDotLine, 2, ThemeColor.AddressColor) >>> node_a.add_outgoing_edge(BranchType.UserDefinedBranch, node_b, edge) >>> node_a.add_outgoing_edge(BranchType.UnconditionalBranch, node_c) >>> show_graph_report("Custom Graph", graph)
In the current implementation, only graphs that have a single start node where all other nodes are reachable from outgoing edges can be rendered correctly. This describes the natural limitations of a control flow graph, which is what the rendering logic was designed for. Graphs that have nodes that are only reachable from incoming edges, or graphs that have disjoint subgraphs will not render correctly. This will be fixed in a future version.
Initialize self. See help(type(self)) for accurate signature.
appendadds a node to a flow graph.
complete_layoutcan be overridden by subclasses and is called when a graph layout is completed.
finish_prepare_for_layoutsignals that preparations for rendering a graph are complete.
get_nodes_in_region(left, top, right, bottom)
layoutstarts rendering a graph for display.
layout_and_waitstarts rendering a graph for display, and waits for the graph to be ready to display.
prepare_for_layoutcan be overridden by subclasses to create nodes in a graph when a flow graph needs to be rendered.
prepare_for_layoutcan be overridden by subclasses to handling preparations that must take place before a flow graph is rendered, such as waiting for a function to finish analysis.
showdisplays the graph in a new tab in the UI.
updatecan be overridden by subclasses to allow a graph to be updated after it has been presented in the UI.
Set if flow graph should allow inline instruction editing (assembly only)
Set if flow graph should allow modification of code from within the graph view
Whether flow graph layout is complete (read-only)
Function for a flow graph
Whether the flow graph has at least one node (read-only)
Flow graph height (read-only)
Set if flow graph includes comments made by the user
List of nodes in graph (read-only)
Set if flow graph should highlight associated registers in the UI
Set if flow graph uses the standard basic block highlighting settings
Set if flow graph uses the standard instruction highlighting settings
Binary view for a flow graph
Flow graph width (read-only)