Closed JohnScience closed 6 months ago
Doing this:
if instr.code() == iced_x86::Code::Call_rm64 {
let target = (fn_ptr as u64).wrapping_add(instr.memory_displacement64());
println!("\t; Target: {:#x}", target);
}
Seems to work properly at least for one case.
It shows the absolute address by default. If you wnat to see rip+xxx, there's a formatter option you can enable/disable.
It shows the absolute address by default. If you wnat to see rip+xxx, there's a formatter option you can enable/disable.
It's probably a poor default because if we don't specify the instruction pointer, it displays the incorrect value.
P.S.
Thank you for mentioning the option!
It's an offset relative to the current IP so make sure you set the correct IP when decoding and it should decode and format correctly.
I have little knowledge of assembly but I got confused when I saw a small hardcoded value in brackets, which is meant to be an address in
0x1800....
forx86_64
DLl.The address seems to be RIP-relative.