Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.40 KB | None | 0 0
  1. int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
  2. {
  3.   HMODULE v4; // eax
  4.   HMODULE v5; // edi
  5.   void (*v6)(void); // eax
  6.   bool v7; // bl
  7.   char pnbuf; // [esp+10h] [ebp-104h]
  8.  
  9.   v4 = LoadLibraryA("user32.dll");
  10.   v5 = v4;
  11.   if ( v4 )
  12.   {
  13.     v6 = (void (*)(void))GetProcAddress(v4, "SetProcessDPIAware");
  14.     if ( v6 )
  15.       v6();
  16.     FreeLibrary(v5);
  17.   }
  18.   InitMiniDumper(lpCmdLine);
  19.   Sys_CreateConsole(hInstance);
  20.   Sys_ShowConsole();
  21.   if ( I_stristr(lpCmdLine, "usedevlsg") )
  22.   {
  23.     g_dwUseDevLSG = 1;
  24.   }
  25.   else if ( I_stristr(lpCmdLine, "useprodlsg") )
  26.   {
  27.     g_dwUseDevLSG = 0;
  28.   }
  29.   Sys_InitializeCriticalSections();
  30.   Sys_InitMainThread();
  31.   g_quitRequested = 0;
  32.   Com_InitParse();
  33.   DedicatedInit(lpCmdLine);
  34.   PMem_Init();
  35.   track_init();
  36.   v7 = Win_CheckForZombieMode(lpCmdLine);
  37.   R_SetIsMultiplayer(1);
  38.   R_SetIsZombie(v7);
  39.   Win_InitLocalization(v7);
  40.   if ( G_ExitAfterConnectPaths() || GetSystemMetrics(4096) || I_stristr(lpCmdLine, "nosnd") )
  41.     g_pc_nosnd = 1;
  42.   if ( !hPrevInstance )
  43.   {
  44.     SL_Init();
  45.     Dvar_Init();
  46.     InitTiming();
  47.     Sys_FindInfo();
  48.     I_strncpyz(sys_cmdline, lpCmdLine, 1024);
  49.     SetErrorMode(1u);
  50.     Sys_Milliseconds();
  51.     tlPrintf("Hello from the wonderful world of TL\n");
  52.     Sys_SetupTLCallbacks((int)&off_900000);
  53.     Con_InitChannels();
  54.     TaskManager2_Init();
  55.     if ( v7 )
  56.     {
  57.       Com_Printf(10, "----> Zombie Session Mode Set! <----\n");
  58.       Com_SessionMode_SetMode(SESSIONMODE_ZOMBIES, 1);
  59.     }
  60.     Win_CheckForEnv(lpCmdLine);
  61.     Live_Base_Init();
  62.     Live_Base_Pump();
  63.     if ( !Sys_IsMainThread()
  64.       && !Assert_MyHandler(
  65.             "c:\\t6\\code\\src\\win32\\win_main.cpp",
  66.             2088,
  67.             0,
  68.             "(Sys_IsMainThread())",
  69.             (const char *)&pBlock) )
  70.     {
  71.       __debugbreak();
  72.     }
  73.     Com_Init(sys_cmdline, 0);
  74.     Live_Base_Pump();
  75.     _getcwd(&pnbuf, 256);
  76.     Com_Printf(10, "Working directory: %s\n", &pnbuf);
  77.     if ( Dvar_GetBool(com_script_debugger_smoke_test) )
  78.       exit(31415);
  79.     while ( 1 )
  80.     {
  81.       Sleep(5u);
  82.       if ( g_quitRequested && Sys_IsMainThread() )
  83.         break;
  84.       Com_Frame();
  85.     }
  86.     if ( errPtr[0] )
  87.       Sys_Error(errPtr);
  88.     Sys_Error("Error quit was not requested in the main thread\n");
  89.   }
  90.   Win_ShutdownLocalization();
  91.   track_shutdown(0);
  92.   return 0;
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement