MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / main

Function main

rust/examples/decompile.rs:29–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29pub 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}

Callers

nothing calls this directly

Calls 4

decompile_to_cFunction · 0.85
loadMethod · 0.45
functionsMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected