Advertisement
evandrix

Binja Script

Oct 9th, 2022 (edited)
1,244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement