Skip to content

Why to set uint64_t curr_user_panic_rip = 0; ? #3

@EFTNice

Description

@EFTNice

When an NMI occurs, the CPU automatically pushes:

RSP_0 → RIP
CS
RFLAGS
RSP
SS

After executing push rax...r15:

RSP_1 → r15 ← mov rcx, rsp (trap_frame pointer points here)

          r14
          rax
          RIP ← Offset +0x78
          CS ← Offset +0x80
          RFLAGS ← Offset +0x88
          RSP ← Offset +0x90       
          SS ← Offset +0x98

After executing pop r15...rax:

RSP_2 → RIP ← RSP returns here (modified to 0)
CS ← Modified to user mode
RFLAGS
RSP ← Modified to UserRsp
SS
jmp to Windows NMI handler:

Am I understanding correctly, bro?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions