Files
paranoidninja e5c0472cc6 Initial Commit
2021-01-30 19:39:51 +05:30

14 lines
559 B
NASM

extern getprivs
global alignstack
segment .text
alignstack:
push rdi ; backup rdi since we will be using this as our main register
mov rdi, rsp ; save stack pointer to rdi
and rsp, byte -0x10 ; align stack with 16 bytes
sub rsp, byte +0x20 ; allocate some space for our C function
call getprivs ; call the C function
mov rsp, rdi ; restore stack pointer
pop rdi ; restore rdi
ret ; return where we left