Last active
June 26, 2019 16:27
-
-
Save Mic92/93a57e2c59f3b52a092e820651741f5d to your computer and use it in GitHub Desktop.
Don't ask, why one need this... :(
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static long syscall3(long n, long a1, long a2, long a3) { | |
unsigned long ret; | |
__asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2), | |
"d"(a3) : "rcx", "r11", "memory"); | |
return ret; | |
} | |
static void desperate_print(const char* format, ...) { | |
char buf[1024]; // enough !1! | |
va_list args; | |
va_start (args, format); | |
vsnprintf(buf, sizeof(buf), format, args); | |
va_end (args); | |
syscall3(1, 1, buf, strlen(buf)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment