()
| 27 | } |
| 28 | |
| 29 | pub fn main() { |
| 30 | let filename = std::env::args().nth(1).expect("No filename provided"); |
| 31 | |
| 32 | println!("Starting session..."); |
| 33 | // This loads all the core architecture, platform, etc plugins |
| 34 | let headless_session = |
| 35 | binaryninja::headless::Session::new().expect("Failed to initialize session"); |
| 36 | |
| 37 | println!("Loading binary..."); |
| 38 | let bv = headless_session |
| 39 | .load(&filename) |
| 40 | .expect("Couldn't open file!"); |
| 41 | |
| 42 | println!("Filename: `{}`", bv.file().filename()); |
| 43 | println!("File size: `{:#x}`", bv.len()); |
| 44 | println!("Function count: {}", bv.functions().len()); |
| 45 | |
| 46 | for func in &bv.functions() { |
| 47 | decompile_to_c(bv.as_ref(), func.as_ref()); |
| 48 | } |
| 49 | } |
nothing calls this directly
no test coverage detected