Skip to content

Commit 659f288

Browse files
committed
Render indirect edges in butterfly and scatter slices as dashed lines; Resolves #7
1 parent f457bd3 commit 659f288

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

slice_types/butterfly_slice.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
import tanto
2222
from tanto.tanto_view import TantoView
2323

24-
from binaryninja import FlowGraph, FlowGraphNode
24+
from binaryninja import FlowGraph, FlowGraphNode, EdgeStyle
2525
from binaryninja.function import Function, DisassemblyTextLine
26-
from binaryninja.enums import BranchType
26+
from binaryninja.enums import BranchType, EdgePenStyle, ThemeColor
2727

2828

2929
class ButterflySlice(tanto.slices.Slice):
@@ -89,7 +89,7 @@ def add_callees(function: Function, level: int, max_level: int):
8989
callee_node = nodes[callee]
9090
edge = (function, callee)
9191
if edge not in added_edges:
92-
node.add_outgoing_edge(BranchType.CallDestination, callee_node)
92+
node.add_outgoing_edge(BranchType.UserDefinedBranch, callee_node, EdgeStyle(EdgePenStyle.DashLine, 2, ThemeColor.UnconditionalBranchColor))
9393
added_edges.add(edge)
9494

9595
return new_graph

slice_types/scatter_slice.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
import tanto
2222
from tanto.tanto_view import TantoView
2323

24-
from binaryninja import FlowGraph, FlowGraphNode
24+
from binaryninja import FlowGraph, FlowGraphNode, EdgeStyle
2525
from binaryninja.function import Function, DisassemblyTextLine
26-
from binaryninja.enums import BranchType
26+
from binaryninja.enums import BranchType, EdgePenStyle, ThemeColor
2727

2828

2929
class ScatterSlice(tanto.slices.Slice):
@@ -96,7 +96,7 @@ def add_callees(function: Function, level: int, max_level: int):
9696
callee_node = nodes[callee]
9797
edge = (function, callee)
9898
if edge not in added_edges:
99-
node.add_outgoing_edge(BranchType.CallDestination, callee_node)
99+
node.add_outgoing_edge(BranchType.UserDefinedBranch, callee_node, EdgeStyle(EdgePenStyle.DashLine, 2, ThemeColor.UnconditionalBranchColor))
100100
added_edges.add(edge)
101101

102102
return new_graph

0 commit comments

Comments
 (0)