Skip to content

Commit ae2e40c

Browse files
committed
Adjust asm (int 3) position
1 parent b8414b2 commit ae2e40c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ fn main() {
7373
unsafe { std::ptr::copy_nonoverlapping(contents.as_ptr(), new_buf_ptr, flen) };
7474
println!("[*] Starting jmp to shellcode at offset 0x{:x}", offset);
7575
unsafe {
76+
let jmp_target = new_buf.offset(offset as isize);
7677
if set_breakpoint {
7778
asm!("int 3");
7879
}
79-
asm!("jmp {}",in(reg) new_buf.offset(offset as isize))
80+
asm!("jmp {}",in(reg) jmp_target)
8081
};
8182
}

0 commit comments

Comments
 (0)