From 8cb9f2eaac76f445a17a39cf40b6c3f59f083347 Mon Sep 17 00:00:00 2001 From: mlokr Date: Thu, 16 May 2024 16:54:12 +0200 Subject: [PATCH] fixing stack to what compiler assumes --- hbxrt/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hbxrt/src/main.rs b/hbxrt/src/main.rs index 156cb253..6f72abec 100644 --- a/hbxrt/src/main.rs +++ b/hbxrt/src/main.rs @@ -52,7 +52,12 @@ fn main() -> Result<(), Box> { eprintln!("[I] Image loaded at {:p}", mmap.as_ptr()); - let mut vm = unsafe { Vm::<_, 0>::new(mem::HostMemory, Address::new(mmap.as_ptr() as u64)) }; + let mut vm = unsafe { + Vm::<_, 0>::new( + mem::HostMemory, + Address::new(mmap.as_ptr().add(stack.len()) as u64), + ) + }; vm.write_reg(254, stack.as_mut_ptr() as u64); // Execute program