diff options
| author | Mason Reed <mason@vector35.com> | 2025-05-10 23:09:22 -0400 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2025-05-12 17:45:24 -0400 |
| commit | e901a6a4ce4aff281b46ef87363b8c56d35f70af (patch) | |
| tree | 6c6d8300ba0709abf69745ac5310e683607695c7 /rust/examples | |
| parent | 5ebbd0620903403fb30a61157b16f33c89afb584 (diff) | |
[Rust] Flowgraph API improvements
Diffstat (limited to 'rust/examples')
| -rw-r--r-- | rust/examples/flowgraph.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/rust/examples/flowgraph.rs b/rust/examples/flowgraph.rs index 515d52fe..ce91d62f 100644 --- a/rust/examples/flowgraph.rs +++ b/rust/examples/flowgraph.rs @@ -15,7 +15,7 @@ use binaryninja::{ pub struct GraphPrinter; impl GraphPrinter { - pub fn print_graph(&self, _view: &BinaryView, graph: &FlowGraph) { + pub fn print_graph(&self, graph: &FlowGraph) { println!("Printing flow graph:"); for node in &graph.nodes() { // Print all disassembly lines in the node @@ -60,16 +60,16 @@ impl InteractionHandler for GraphPrinter { false } - fn show_plain_text_report(&mut self, _view: &BinaryView, title: &str, contents: &str) { + fn show_plain_text_report(&mut self, _view: Option<&BinaryView>, title: &str, contents: &str) { println!("Plain text report"); println!("Title: {}", title); println!("Contents: {}", contents); } - fn show_graph_report(&mut self, view: &BinaryView, title: &str, graph: &FlowGraph) { + fn show_graph_report(&mut self, _view: Option<&BinaryView>, title: &str, graph: &FlowGraph) { println!("Graph report"); println!("Title: {}", title); - self.print_graph(view, graph); + self.print_graph(graph); } fn get_form_input(&mut self, _form: &mut Form) -> bool { @@ -77,7 +77,7 @@ impl InteractionHandler for GraphPrinter { } } -fn test_graph(view: &BinaryView) { +fn test_graph() { let graph = FlowGraph::new(); let disassembly_lines_a = vec