summaryrefslogtreecommitdiff
path: root/rust/tests/high_level_il.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-02-06 23:59:12 -0500
committerMason Reed <mason@vector35.com>2025-02-06 23:59:12 -0500
commitb451efd609f94152fbca97cb944467234dcc74d7 (patch)
tree7b4100ca9a7feaadadc7201cc54981ee7f2a073a /rust/tests/high_level_il.rs
parentf9bd8eb2a8aa8b492d4145624d12e7014c7ee65c (diff)
Update Rust tests to respect image base
Diffstat (limited to 'rust/tests/high_level_il.rs')
-rw-r--r--rust/tests/high_level_il.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/rust/tests/high_level_il.rs b/rust/tests/high_level_il.rs
index 3a2b7209..bec1d67c 100644
--- a/rust/tests/high_level_il.rs
+++ b/rust/tests/high_level_il.rs
@@ -14,6 +14,7 @@ fn session() -> Session {
fn test_hlil_info(_session: &Session) {
let out_dir = env!("OUT_DIR").parse::<PathBuf>().unwrap();
let view = binaryninja::load(out_dir.join("atox.obj")).expect("Failed to create view");
+ let image_base = view.original_image_base();
let entry_function = view.entry_point_function().unwrap();
let hlil_function = entry_function.high_level_il(false).unwrap();
@@ -29,7 +30,7 @@ fn test_hlil_info(_session: &Session) {
// 00025f10 )
let instr_0 = hlil_instr_iter.next().unwrap();
assert_eq!(instr_0.expr_index, HighLevelInstructionIndex(5));
- assert_eq!(instr_0.address, 0x00025f22);
+ assert_eq!(instr_0.address, image_base + 0x00025f22);
println!("{:?}", instr_0.kind);
match instr_0.kind {
HighLevelILInstructionKind::Ret(op) => {