// AUTO-GENERATED FILE, MOVE TO 'gh_fix' FOLDER PREVENT OVERWRITING!!!!! #include #include #include #include extern "C" { undefined4 crt_createProgramHeap(undefined4 param_1) { return gh_stub_impl_cdecl<0x00404902, undefined4>(param_1); } undefined4 ioinit(void) { return gh_stub_impl_cdecl<0x004046bf, undefined4>(); } void crt_initConsole(void) { return gh_stub_impl_cdecl<0x00404503, void>(); } LPSTR crt_setupEnv(void) { return gh_stub_impl_cdecl<0x004043d1, LPSTR>(); } undefined4 crt_main2(void) { return gh_stub_impl_cdecl<0x00404184, undefined4>(); } undefined4 crt_main1(void) { return gh_stub_impl_cdecl<0x004040cb, undefined4>(); } void crt_static_init(void) { return gh_stub_impl_cdecl<0x004027be, void>(); } char *crt_0(void) { return gh_stub_impl_cdecl<0x00404073, char *>(); } void gh_pre_main(void) { DWORD DVar1; int iVar2; LPSTR *cmdline; uint showCmd; HMODULE hInstance; HINSTANCE hPrevInstance; _STARTUPINFOA local_60; undefined1 *local_1c; void *pvStack_14; undefined1 *puStack_10; undefined *puStack_c; undefined4 local_8; local_8 = 0xffffffff; // This sets up the unhandled exception handler i think? // puStack_c = &DAT_00597ca0; // puStack_10 = &LAB_00404a58; // pvStack_14 = ExceptionList; // local_1c = &stack0xffffff88; // ExceptionList = &pvStack_14; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" DVar1 = GetVersion(); #pragma clang diagnostic pop DWORD_005cf980 = DVar1 >> 8 & 0xff; DWORD_005cf97c = DVar1 & 0xff; DWORD_005cf978 = DWORD_005cf97c * 0x100 + DWORD_005cf980; DWORD_005cf974 = DVar1 >> 0x10; iVar2 = crt_createProgramHeap(1); if (iVar2 == 0) { SPDLOG_ERROR("crt_createProgramHeap failed"); exit(0); } iVar2 = ioinit(); if (iVar2 == 0) { SPDLOG_ERROR("_ioinit failed"); exit(0); } local_8 = 0; crt_initConsole(); g_crt_cmdLine = GetCommandLineA(); PTR_005cf9b4 = crt_setupEnv(); crt_main2(); crt_main1(); crt_static_init(); local_60.dwFlags = 0; GetStartupInfoA(&local_60); cmdline = (LPSTR *)crt_0(); if ((local_60.dwFlags & 1) == 0) { showCmd = 10; } else { showCmd = (uint)local_60.wShowWindow; } hPrevInstance = (HINSTANCE)0x0; hInstance = GetModuleHandleA((LPCSTR)0x0); } }