extern "C" void OOOOOOOOOOO(PARM64_REGISTERS regs)
{
void* buffer;
regs->x22 = (intptr_t)buffer;
*(intptr_t *)regs->x24 = regs->x22;
regs->returnAddress = FUCK;
}
__attribute__((naked)) int nakedXXXXXXXXXX()
{
__asm__ volatile("\n\
sub sp, sp, #0x120 \n\
stp x0, x1, [sp, #0x00] \n\
stp x2, x3, [sp, #0x10] \n\
stp x4, x5, [sp, #0x20] \n\
stp x6, x7, [sp, #0x30] \n\
stp x8, x9, [sp, #0x40] \n\
stp x10, x11, [sp, #0x50] \n\
stp x12, x13, [sp, #0x60] \n\
stp x14, x15, [sp, #0x70] \n\
stp x16, x17, [sp, #0x80] \n\
stp x18, x19, [sp, #0x90] \n\
stp x20, x21, [sp, #0xA0] \n\
stp x22, x23, [sp, #0xB0] \n\
stp x24, x25, [sp, #0xC0] \n\
stp x26, x27, [sp, #0xD0] \n\
stp x28, x29, [sp, #0xE0] \n\
str x30, [sp, #0xF0] \n\
\
mov x0, sp \n\
bl _OOOOOOOOOO \n\
\
ldp x0, x1, [sp, #0x00] \n\
ldp x2, x3, [sp, #0x10] \n\
ldp x4, x5, [sp, #0x20] \n\
ldp x6, x7, [sp, #0x30] \n\
ldp x8, x9, [sp, #0x40] \n\
ldp x10, x11, [sp, #0x50] \n\
ldp x12, x13, [sp, #0x60] \n\
ldp x14, x15, [sp, #0x70] \n\
ldp x16, x17, [sp, #0x80] \n\
ldp x18, x19, [sp, #0x90] \n\
ldp x20, x21, [sp, #0xA0] \n\
ldp x22, x23, [sp, #0xB0] \n\
ldp x24, x25, [sp, #0xC0] \n\
ldp x26, x27, [sp, #0xD0] \n\
ldp x28, x29, [sp, #0xE0] \n\
ldr x30, [sp, #0xF0] \n\
\
ldr x10, [sp, #0xF8] \n\
add sp, sp, #0x120 \n\
\
cmp x22, #0 \n\
cset w8, ne \n\
add w9, w28, #0xd4 \n\
madd w8, w8, w9, w2 \n\
\
br x10 \n\
");
}
我是这样简单手写的