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 do_the_set_registers
do_the_set_registers:
mov rax, 0xdeadbeef0badc0de
mov r8, rcx
mov r9, rdi
global get_rip
get_rip:
pop rax ; do the same thing as 'ret', except with 'jmp'
jmp rax ; with the return address still in rax
global _halt
_halt: