From 5c96fb77878e16fafa43512c80209d03d50729c0 Mon Sep 17 00:00:00 2001 From: ChrisMiuchiz Date: Sun, 27 Oct 2019 13:51:45 -0400 Subject: [PATCH] explain my sins --- CubeModLoader/main.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CubeModLoader/main.h b/CubeModLoader/main.h index f7ed1e6..2471e8c 100644 --- a/CubeModLoader/main.h +++ b/CubeModLoader/main.h @@ -28,10 +28,11 @@ dllname->name = GetProcAddress(dllname->handle, #name); #define PREPARE_STACK "mov rax, rsp \n and rsp, 0xFFFFFFFFFFFFFFF0 \n push rax \n sub rsp, 0x28 \n" #define RESTORE_STACK "add rsp, 0x28 \n pop rsp \n" + +// These macros exist because "jmp [var]" or "jmp ds:[var]" any any other variants I have tried do not properly compile #define GETTER_VAR(vartype, varname)\ static __attribute__((used)) vartype varname;\ extern "C" vartype Get_##varname(){return varname;} - #define DEREF_JMP(varname)\ "sub rsp, 8 \n"\ "push rax \n"\