mirror of
https://github.com/paranoidninja/PIC-Get-Privileges
synced 2026-06-08 16:38:12 +00:00
14 lines
559 B
NASM
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 |