diff --git a/crates/vestal/src/main.rs b/crates/vestal/src/main.rs index d8e7fbe..85c7574 100644 --- a/crates/vestal/src/main.rs +++ b/crates/vestal/src/main.rs @@ -106,7 +106,7 @@ impl Rebuilder { //Show::call(&dll, addr, Some(call)); //Show::call_target_addrs(Some(call)); Show::call_site(&dll, addr, call.length, 1); - Show::call_dasm(&dll.code[addr..addr+call.length]); + Show::call_dasm(&dll.code[addr..], addr); Show::call_module_method(Some(call)); if let Some(method) = dll.parse_call(call) { let module_name = call.module.as_ref().unwrap(); @@ -135,7 +135,7 @@ impl Rebuilder { let target = Call::target(opcodes, 0); Show::call_site(&dll, addr, instruction.len(), 1); //println!(" ╰-------> (target {:?}) (offset {offset:?}) (rva {offset_rva:?})", target); - Show::call_dasm(&dll.code[addr..addr+call.length]); + Show::call_dasm(&dll.code[addr..], addr); Show::call_module_method(dll.calls_by_source.get(&(addr as u32))); //Show::call(&dll, addr + position, None); } diff --git a/crates/vestal/src/show.rs b/crates/vestal/src/show.rs index 5c87ad0..629b108 100644 --- a/crates/vestal/src/show.rs +++ b/crates/vestal/src/show.rs @@ -90,7 +90,7 @@ impl Show { write!(&mut output, "{RESET}"); if byte % line == line - 1 { if snap(byte) == snap(addr) { - let dasm = Self::call_dasm(&dll.code[addr..addr+length]); + let dasm = Self::call_dasm(&dll.code[addr..addr+length], addr); write!(&mut output, " -> {dasm}"); } write!(&mut output, " \n"); @@ -99,8 +99,8 @@ impl Show { print!("{output}"); } - pub fn call_dasm (bytes: &[u8]) -> Arc { - let mut decoder = Decoder::with_ip(64, bytes, 0x0, DecoderOptions::NONE); + pub fn call_dasm (bytes: &[u8], rip: usize) -> Arc { + let mut decoder = Decoder::with_ip(64, bytes, 0x1000 + rip as u64, DecoderOptions::NONE); while decoder.can_decode() { let position = decoder.position(); let instruction = decoder.decode();