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

Function test_base_detection

rust/tests/base_detection.rs:7–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6#[test]
7fn test_base_detection() {
8 let _session = Session::new().expect("Failed to initialize session");
9 let out_dir = env!("OUT_DIR").parse::<PathBuf>().unwrap();
10 let view = binaryninja::load(out_dir.join("raw_base_detection_aarch64"))
11 .expect("Failed to create view");
12 let bad = view
13 .base_address_detection()
14 .expect("Failed to create base address detection");
15 assert!(
16 bad.detect(&BaseAddressDetectionSettings::default()),
17 "Detection should succeed on this view"
18 );
19 let result = bad.scores(10);
20 assert_eq!(result.scores.len(), 3);
21 assert_eq!(
22 result.confidence,
23 BaseAddressDetectionConfidence::HighConfidence
24 );
25}

Callers

nothing calls this directly

Calls 4

joinMethod · 0.80
loadFunction · 0.50
scoresMethod · 0.45

Tested by

no test coverage detected