typedef unsigned char BYTE; typedef char CHAR; typedef unsigned long DWORD; typedef long LONG; typedef void *PVOID; typedef unsigned int UINT; typedef unsigned long ULONG_PTR; typedef unsigned short WORD; __cdecl void _cexit(void) __attribute__((noreturn)); typedef __cdecl int (*_onexit_t)(void); __cdecl int _setmode(int _FileHandle, int _Mode); __cdecl void abort(void) __attribute__((noreturn)); __cdecl int atexit(__cdecl void(*)(void)); __cdecl void exit __attribute__((noreturn))(int _Code); __cdecl void free(void *_Memory); __cdecl int printf(const char *_Format, ...); __cdecl int puts(const char *_Str); __cdecl void (*signal(int _SigNum, __cdecl void (*_Func)(int)))(int); typedef unsigned int size_t; typedef WORD ATOM; __stdcall void ExitProcess __attribute__((dllimport)) __attribute__((noreturn))(UINT uExitCode); typedef const CHAR *LPCSTR; typedef CHAR *LPSTR; struct _EXCEPTION_RECORD { DWORD ExceptionCode; DWORD ExceptionFlags; struct _EXCEPTION_RECORD *ExceptionRecord; PVOID ExceptionAddress; DWORD NumberParameters; ULONG_PTR ExceptionInformation[15]; } __attribute__((pack(8))); struct _FLOATING_SAVE_AREA { DWORD ControlWord; DWORD StatusWord; DWORD TagWord; DWORD ErrorOffset; DWORD ErrorSelector; DWORD DataOffset; DWORD DataSelector; BYTE RegisterArea[80]; DWORD Cr0NpxState; }; __cdecl _onexit_t _onexit(_onexit_t _Func); __cdecl void *malloc(size_t _Size); __cdecl void *memset(void *_Dst, int _Val, size_t _Size); __cdecl size_t strlen(const char *_Str); __stdcall ATOM AddAtomA __attribute__((dllimport))(LPCSTR lpString); typedef struct _EXCEPTION_RECORD EXCEPTION_RECORD; typedef struct _FLOATING_SAVE_AREA FLOATING_SAVE_AREA; __stdcall ATOM FindAtomA __attribute__((dllimport))(LPCSTR lpString); __stdcall UINT GetAtomNameA __attribute__((dllimport))(ATOM nAtom, LPSTR lpBuffer, int nSize); typedef EXCEPTION_RECORD *PEXCEPTION_RECORD; struct _CONTEXT { DWORD ContextFlags; DWORD Dr0; DWORD Dr1; DWORD Dr2; DWORD Dr3; DWORD Dr6; DWORD Dr7; FLOATING_SAVE_AREA FloatSave; DWORD SegGs; DWORD SegFs; DWORD SegEs; DWORD SegDs; DWORD Edi; DWORD Esi; DWORD Ebx; DWORD Edx; DWORD Ecx; DWORD Eax; DWORD Ebp; DWORD Eip; DWORD SegCs; DWORD EFlags; DWORD Esp; DWORD SegSs; BYTE ExtendedRegisters[512]; } __attribute__((pack(8))); typedef struct _CONTEXT CONTEXT; typedef CONTEXT *PCONTEXT; struct _EXCEPTION_POINTERS { PEXCEPTION_RECORD ExceptionRecord; PCONTEXT ContextRecord; }; typedef __stdcall LONG (*PTOP_LEVEL_EXCEPTION_FILTER)(struct _EXCEPTION_POINTERS *ExceptionInfo); typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER; __stdcall LPTOP_LEVEL_EXCEPTION_FILTER SetUnhandledExceptionFilter __attribute__((dllimport))(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);