Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __fastcall Sys_CreateConsole(HINSTANCE__ *hInstance)
- {
- const char *CommandLine; // rax
- HICON__ *CursorA; // rax
- HWND DesktopWindow; // rax
- HDC DC; // rbx
- int DeviceCaps; // esi
- int v7; // edi
- HWND v8; // rax
- HWND__ *Window; // rax
- HDC v10; // rbx
- int v11; // eax
- int v12; // eax
- HANDLE ImageA; // rbx
- tagRECT Rect; // [rsp+70h] [rbp-19h] BYREF
- WNDCLASSA WndClass; // [rsp+80h] [rbp-9h] BYREF
- CommandLine = Com_GetCommandLine();
- if ( I_stristr(CommandLine, "+nowindow") )
- {
- s_suppressConsoleWindow = 1;
- }
- else
- {
- *(&WndClass.style + 1) = 0;
- WndClass.style = 0;
- *(_QWORD *)&WndClass.cbClsExtra = 0i64;
- WndClass.lpfnWndProc = ConWndProc;
- WndClass.hInstance = hInstance;
- WndClass.hIcon = LoadIconA(hInstance, (LPCSTR)2);
- CursorA = LoadCursorA(0i64, (LPCSTR)0x7F00);
- *(__m128i *)&WndClass.hbrBackground = _mm_load_si128((const __m128i *)&_xmm);
- WndClass.hCursor = CursorA;
- WndClass.lpszClassName = "IW6 WinConsole";
- if ( RegisterClassA(&WndClass) )
- {
- *(_QWORD *)&Rect.left = 0i64;
- Rect.right = 620;
- Rect.bottom = 450;
- AdjustWindowRect(&Rect, 0x80CA0000, 0);
- DesktopWindow = GetDesktopWindow();
- DC = GetDC(DesktopWindow);
- DeviceCaps = GetDeviceCaps(DC, 8);
- v7 = GetDeviceCaps(DC, 10);
- v8 = GetDesktopWindow();
- ReleaseDC(v8, DC);
- s_wcd.windowHeight = Rect.bottom - Rect.top + 1;
- s_wcd.windowWidth = Rect.right - Rect.left + 1;
- *(_QWORD *)&s_wcd.consoleHistoryPos = 0i64;
- Window = CreateWindowExA(
- 0,
- "IW6 WinConsole",
- "IW6 Console",
- 0x80CA0000,
- (DeviceCaps - 600) / 2,
- (v7 - 450) / 2,
- Rect.right - Rect.left + 1,
- Rect.bottom - Rect.top + 1,
- 0i64,
- 0i64,
- hInstance,
- 0i64);
- s_wcd.hWnd = Window;
- if ( Window )
- {
- v10 = GetDC(Window);
- v11 = GetDeviceCaps(v10, 90);
- v12 = MulDiv(8, v11, 72);
- s_wcd.hfBufferFont = CreateFontA(-v12, 0, 0, 0, 300, 0, 0, 0, 1u, 0, 0, 0, 0x31u, "Courier New");
- ReleaseDC(s_wcd.hWnd, v10);
- ImageA = LoadImageA(0i64, "logo.bmp", 0, 0, 0, 0x10u);
- if ( ImageA )
- {
- s_wcd.codLogo = CreateWindowExA(
- 0,
- "Static",
- 0i64,
- 0x5000000Eu,
- 5,
- 5,
- 0,
- 0,
- s_wcd.hWnd,
- (HMENU)1,
- hInstance,
- 0i64);
- SendMessageA(s_wcd.codLogo, 0x172u, 0i64, (LPARAM)ImageA);
- }
- s_wcd.hwndInputLine = CreateWindowExA(
- 0,
- "edit",
- 0i64,
- 0x50800080u,
- 6,
- 400,
- 608,
- 20,
- s_wcd.hWnd,
- (HMENU)0x65,
- hInstance,
- 0i64);
- s_wcd.hwndBuffer = CreateWindowExA(
- 0,
- "edit",
- 0i64,
- 0x50A00844u,
- 6,
- 70,
- 606,
- 324,
- s_wcd.hWnd,
- (HMENU)0x64,
- hInstance,
- 0i64);
- SendMessageA(s_wcd.hwndBuffer, 0x30u, (WPARAM)s_wcd.hfBufferFont, 0i64);
- SendMessageA(s_wcd.hwndBuffer, 0xC5u, 0x8000ui64, 0i64);
- s_wcd.SysInputLineWndProc = (__int64 (__fastcall *)(HWND__ *, unsigned int, unsigned __int64, __int64))SetWindowLongPtrA(s_wcd.hwndInputLine, -4, (LONG_PTR)InputLineWndProc);
- SendMessageA(s_wcd.hwndInputLine, 0x30u, (WPARAM)s_wcd.hfBufferFont, 0i64);
- SetFocus(s_wcd.hwndInputLine);
- s_wcd.buffer[0] = 0;
- s_wcd.cleanBuffer[0] = 0;
- SetWindowTextA(s_wcd.hwndBuffer, s_wcd.cleanBuffer);
- s_wcd.bufferLen = 0i64;
- InitializeCriticalSection(&s_wcd.critSect);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement