(view: &BinaryView)
| 5 | }; |
| 6 | |
| 7 | fn test_graph(view: &BinaryView) { |
| 8 | let graph = FlowGraph::new(); |
| 9 | |
| 10 | let disassembly_lines_a = vec![DisassemblyTextLine::new(vec![ |
| 11 | InstructionTextToken::new("Li", InstructionTextTokenKind::Text), |
| 12 | InstructionTextToken::new("ne", InstructionTextTokenKind::Text), |
| 13 | InstructionTextToken::new(" 1", InstructionTextTokenKind::Text), |
| 14 | ])]; |
| 15 | |
| 16 | let node_a = FlowGraphNode::new(&graph); |
| 17 | node_a.set_lines(disassembly_lines_a); |
| 18 | |
| 19 | let node_b = FlowGraphNode::new(&graph); |
| 20 | let disassembly_lines_b = vec![DisassemblyTextLine::new(vec![ |
| 21 | InstructionTextToken::new("Li", InstructionTextTokenKind::Text), |
| 22 | InstructionTextToken::new("ne", InstructionTextTokenKind::Text), |
| 23 | InstructionTextToken::new(" 2", InstructionTextTokenKind::Text), |
| 24 | ])]; |
| 25 | node_b.set_lines(disassembly_lines_b); |
| 26 | |
| 27 | graph.append(&node_a); |
| 28 | graph.append(&node_b); |
| 29 | |
| 30 | let edge = EdgeStyle::new(EdgePenStyle::DashDotDotLine, 2, ThemeColor::AddressColor); |
| 31 | node_a.add_outgoing_edge(BranchType::UserDefinedBranch, &node_b, edge); |
| 32 | node_b.add_outgoing_edge( |
| 33 | BranchType::UnconditionalBranch, |
| 34 | &node_a, |
| 35 | EdgeStyle::default(), |
| 36 | ); |
| 37 | |
| 38 | view.show_graph_report("Rust Graph Title", &graph); |
| 39 | } |
| 40 | |
| 41 | fn main() { |
| 42 | println!("Starting session..."); |
no test coverage detected