diff options
Diffstat (limited to 'malware.c')
-rw-r--r-- | malware.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/malware.c b/malware.c new file mode 100644 index 0000000..6d9e981 --- /dev/null +++ b/malware.c @@ -0,0 +1,44 @@ +#if defined(plat_windows) + +/* Because Windows is made by retards and + * windows.h overlaps with some of my shit. */ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +#include <stdio.h> +#include <stdlib.h> + +void platform_log(const char* message, ...) { + va_list args; + va_start(args, message); + vfprintf(stdout, message, args); + va_end(args); +} + +void platform_err(const char* message, ...) { + va_list args; + HANDLE console; + + console = GetStdHandle(STD_OUTPUT_HANDLE); + + va_start(args, message); + + SetConsoleTextAttribute(console, 4); + vfprintf(stderr, message, args); + SetConsoleTextAttribute(console, 7); + + va_end(args); +} + +void platform_abort(int code) { +#if defined(DEBUG) && defined(plat_x86) + __asm__("int3;"); +#else + exit(code); +#endif +} +#endif + +/* Because empty translation units aren't allowed. */ +void malware_dummy_() {} |