SHOW:
|
|
- or go back to the newest paste.
| 1 | // @ https://twitter.com/binpwn/status/1578861528153227264 | |
| 2 | graph = FlowGraph() | |
| 3 | nodes = {}
| |
| 4 | for fcn in bv.functions: | |
| 5 | node = FlowGraphNode(graph) | |
| 6 | node.lines = [fcn.name] | |
| 7 | nodes[fcn.name] = node | |
| 8 | graph.append(node) | |
| 9 | ||
| 10 | edge = EdgeStyle(EdgePenStyle.DashDotDotLine, 2, ThemeColor.AddressColor) | |
| 11 | for fcn in bv.functions: | |
| 12 | xrefs = bv.get_code_refs(fcn.start) | |
| 13 | for xref in xrefs: | |
| 14 | parent = nodes[xref.function.name] | |
| 15 | child = nodes[fcn.name] | |
| 16 | parent.add_outgoing_edge(BranchType.UserDefinedBranch, child, edge) | |
| 17 | print(f"{xref.function.name} -> {fcn.name}")
| |
| 18 | ||
| 19 | bv.show_graph_report("Function Flow", graph) |