Add get_rip/get_rsp helpers

This commit is contained in:
Justin C. Miller
2018-05-21 00:56:35 -07:00
parent c5761cc51e
commit 0c8bcb2400

View File

@@ -1,10 +1,12 @@
global get_rsp
get_rsp:
mov rax, rsp
ret
section .text global get_rip
global do_the_set_registers get_rip:
do_the_set_registers: pop rax ; do the same thing as 'ret', except with 'jmp'
mov rax, 0xdeadbeef0badc0de jmp rax ; with the return address still in rax
mov r8, rcx
mov r9, rdi
global _halt global _halt
_halt: _halt: