save return address to patch

This commit is contained in:
2025-12-15 11:32:28 +01:00
parent d0c227faa8
commit 1b109ab5aa

View File

@@ -21,6 +21,9 @@ pub const UserRegs = extern struct {
r13: u64, r13: u64,
r14: u64, r14: u64,
r15: u64, r15: u64,
/// This one isn't pushed on the stack by `syscall_entry`. It's pushed by the `call r11` to get
/// to the `syscall_entry`
return_address: u64,
}; };
/// The main entry point for intercepted syscalls. /// The main entry point for intercepted syscalls.
@@ -124,7 +127,6 @@ pub fn syscall_entry() callconv(.naked) void {
\\ push %rbx \\ push %rbx
\\ push %rax \\ push %rax
\\ pushfq # Save Flags \\ pushfq # Save Flags
\\ # TODO: save return_address
\\ \\
\\ # Align stack \\ # Align stack
\\ # Current pushes: 16 * 8 = 128 bytes. \\ # Current pushes: 16 * 8 = 128 bytes.