{"type": "func", "start": 6443365360, "end": 6443366301, "name": "sub_1800DF3F0", "pseudocode": "// \n// sub_1800DF3F0 from 0x1800df3f0 to 0x1800df79d (941 bytes)\n// \n// 4 xrefs:\n// > sub_1800D7E10 @ 0x1800d7e53\n// > <???> @ 0x18014c640\n// > <???> @ 0x18014c678\n// > <???> @ 0x1801c5034\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:22:36 +0000\n// \n\n__int64 sub_1800DF3F0()\n{\n  HMODULE LibraryA; // rax\n  HDC DC; // rsi\n  int v3; // eax\n  __int64 v4; // rbx\n  HDC CurrentDC; // rbp\n  HGLRC CurrentContext; // r14\n  PIXELFORMATDESCRIPTOR ppfd; // [rsp+20h] [rbp-38h] BYREF\n\n  if ( hModule )\n    return 1;\n  LibraryA = LoadLibraryA(\"opengl32.dll\");\n  hModule = LibraryA;\n  if ( LibraryA )\n  {\n    wglCreateContext = (HGLRC (__stdcall *)(HDC))GetProcAddress(LibraryA, \"wglCreateContext\");\n    wglDeleteContext = (BOOL (__stdcall *)(HGLRC))GetProcAddress(hModule, \"wglDeleteContext\");\n    wglGetProcAddress_0 = (PROC (__stdcall *)(LPCSTR))GetProcAddress(hModule, \"wglGetProcAddress\");\n    wglGetCurrentDC = (HDC (__stdcall *)())GetProcAddress(hModule, \"wglGetCurrentDC\");\n    wglGetCurrentContext = (HGLRC (__stdcall *)())GetProcAddress(hModule, \"wglGetCurrentContext\");\n    wglMakeCurrent = (BOOL (__stdcall *)(HDC, HGLRC))GetProcAddress(hModule, \"wglMakeCurrent\");\n    wglShareLists = (BOOL (__stdcall *)(HGLRC, HGLRC))GetProcAddress(hModule, \"wglShareLists\");\n    *(_QWORD *)&ppfd.iPixelType = 6144;\n    DC = GetDC(hRecipient);\n    *(_DWORD *)&ppfd.nSize = 65576;\n    ppfd.dwFlags = 37;\n    memset(&ppfd.cAlphaBits, 0, 24);\n    v3 = ChoosePixelFormat(DC, &ppfd);\n    if ( SetPixelFormat(DC, v3, &ppfd) )\n    {\n      v4 = ((__int64 (__fastcall *)(HDC))wglCreateContext)(DC);\n      if ( v4 )\n      {\n        CurrentDC = wglGetCurrentDC();\n        CurrentContext = wglGetCurrentContext();\n        if ( (unsigned int)((__int64 (__fastcall *)(HDC, __int64))wglMakeCurrent)(DC, v4) )\n        {\n          qword_1801B6198 = ((__int64 (__fastcall *)(const CHAR *))wglGetProcAddress_0)(\"wglGetExtensionsStringEXT\");\n          qword_1801B61A0 = ((__int64 (__fastcall *)(const char *))wglGetProcAddress_0)(\"wglGetExtensionsStringARB\");\n          qword_1801B61A8 = (__int64 (__fastcall *)(_QWORD, _QWORD, _QWORD))((__int64 (__fastcall *)(const char *))wglGetProcAddress_0)(\"wglCreateContextAttribsARB\");\n          qword_1801B6188 = ((__int64 (__fastcall *)(const CHAR *))wglGetProcAddress_0)(\"wglSwapIntervalEXT\");\n          qword_1801B6190 = ((__int64 (__fastcall *)(const char *))wglGetProcAddress_0)(\"wglGetPixelFormatAttribivARB\");\n          dword_1801B61B8 = sub_1800E0080(\"WGL_ARB_multisample\");\n          dword_1801B61BC = sub_1800E0080(\"WGL_ARB_framebuffer_sRGB\");\n          dword_1801B61C0 = sub_1800E0080(\"WGL_EXT_framebuffer_sRGB\");\n          dword_1801B61C8 = sub_1800E0080(\"WGL_ARB_create_context\");\n          dword_1801B61CC = sub_1800E0080(\"WGL_ARB_create_context_profile\");\n          dword_1801B61D0 = sub_1800E0080(\"WGL_EXT_create_context_es2_profile\");\n          dword_1801B61D4 = sub_1800E0080(\"WGL_ARB_create_context_robustness\");\n          dword_1801B61D8 = sub_1800E0080(\"WGL_ARB_create_context_no_error\");\n          dword_1801B61B0 = sub_1800E0080(\"WGL_EXT_swap_control\");\n          dword_1801B61B4 = sub_1800E0080(\"WGL_EXT_colorspace\");\n          dword_1801B61C4 = sub_1800E0080(\"WGL_ARB_pixel_format\");\n          dword_1801B61DC = sub_1800E0080(\"WGL_ARB_context_flush_control\");\n          ((void (__fastcall *)(HDC, HGLRC))wglMakeCurrent)(CurrentDC, CurrentContext);\n          ((void (__fastcall *)(__int64))wglDeleteContext)(v4);\n          return 1;\n        }\n        else\n        {\n          sub_1800E1AF0(65544, \"WGL: Failed to make dummy context current\");\n          ((void (__fastcall *)(HDC, HGLRC))wglMakeCurrent)(CurrentDC, CurrentContext);\n          ((void (__fastcall *)(__int64))wglDeleteContext)(v4);\n          return 0;\n        }\n      }\n      else\n      {\n        sub_1800E1AF0(65544, \"WGL: Failed to create dummy context\");\n        return 0;\n      }\n    }\n    else\n    {\n      sub_1800E1AF0(65544, \"WGL: Failed to set pixel format for dummy context\");\n      return 0;\n    }\n  }\n  else\n  {\n    sub_1800E1AF0(65544, \"WGL: Failed to load opengl32.dll\");\n    return 0;\n  }\n}", "assembly": "; \n; sub_1800DF3F0 from 0x1800df3f0 to 0x1800df79d (941 bytes)\n; \n; 4 xrefs:\n; > sub_1800D7E10 @ 0x1800d7e53\n; > <???> @ 0x18014c640\n; > <???> @ 0x18014c678\n; > <???> @ 0x1801c5034\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:22:36 +0000\n; \npush    rdi                                                            ; +0x0, 0x1800df3f0\nsub     rsp, 50h                                                       ; +0x2, 0x1800df3f2\nmov     rax, cs:__security_cookie                                      ; +0x6, 0x1800df3f6\nxor     rax, rsp                                                       ; +0xd, 0x1800df3fd\nmov     [rsp+58h+var_10], rax                                          ; +0x10, 0x1800df400\ncmp     cs:hModule, 0                                                  ; +0x15, 0x1800df405\njz      short loc_1800DF427                                            ; +0x1d, 0x1800df40d\nmov     eax, 1                                                         ; +0x1f, 0x1800df40f\nmov     rcx, [rsp+58h+var_10]                                          ; +0x24, 0x1800df414\nxor     rcx, rsp; StackCookie                                          ; +0x29, 0x1800df419\ncall    __security_check_cookie                                        ; +0x2c, 0x1800df41c\nadd     rsp, 50h                                                       ; +0x31, 0x1800df421\npop     rdi                                                            ; +0x35, 0x1800df425\nretn                                                                   ; +0x36, 0x1800df426\nlea     rcx, LibFileName; \"opengl32.dll\"                               ; +0x37, 0x1800df427\ncall    cs:LoadLibraryA                                                ; +0x3e, 0x1800df42e\nmov     cs:hModule, rax                                                ; +0x44, 0x1800df434\ntest    rax, rax                                                       ; +0x4b, 0x1800df43b\njnz     short loc_1800DF466                                            ; +0x4e, 0x1800df43e\nlea     rdx, aWglFailedToLoa; \"WGL: Failed to load opengl32.dll\"       ; +0x50, 0x1800df440\nmov     ecx, 10008h                                                    ; +0x57, 0x1800df447\ncall    sub_1800E1AF0                                                  ; +0x5c, 0x1800df44c\nxor     eax, eax                                                       ; +0x61, 0x1800df451\nmov     rcx, [rsp+58h+var_10]                                          ; +0x63, 0x1800df453\nxor     rcx, rsp; StackCookie                                          ; +0x68, 0x1800df458\ncall    __security_check_cookie                                        ; +0x6b, 0x1800df45b\nadd     rsp, 50h                                                       ; +0x70, 0x1800df460\npop     rdi                                                            ; +0x74, 0x1800df464\nretn                                                                   ; +0x75, 0x1800df465\nlea     rdx, ProcName; \"wglCreateContext\"                              ; +0x76, 0x1800df466\nmov     [rsp+58h+arg_10], rsi                                          ; +0x7d, 0x1800df46d\nmov     rcx, rax; hModule                                              ; +0x82, 0x1800df472\ncall    cs:GetProcAddress                                              ; +0x85, 0x1800df475\nmov     rcx, cs:hModule; hModule                                       ; +0x8b, 0x1800df47b\nlea     rdx, aWgldeleteconte; \"wglDeleteContext\"                       ; +0x92, 0x1800df482\nmov     cs:wglCreateContext, rax                                       ; +0x99, 0x1800df489\ncall    cs:GetProcAddress                                              ; +0xa0, 0x1800df490\nmov     rcx, cs:hModule; hModule                                       ; +0xa6, 0x1800df496\nlea     rdx, aWglgetprocaddr; \"wglGetProcAddress\"                      ; +0xad, 0x1800df49d\nmov     cs:wglDeleteContext, rax                                       ; +0xb4, 0x1800df4a4\ncall    cs:GetProcAddress                                              ; +0xbb, 0x1800df4ab\nmov     rcx, cs:hModule; hModule                                       ; +0xc1, 0x1800df4b1\nlea     rdx, aWglgetcurrentd; \"wglGetCurrentDC\"                        ; +0xc8, 0x1800df4b8\nmov     cs:wglGetProcAddress_0, rax                                    ; +0xcf, 0x1800df4bf\ncall    cs:GetProcAddress                                              ; +0xd6, 0x1800df4c6\nmov     rcx, cs:hModule; hModule                                       ; +0xdc, 0x1800df4cc\nlea     rdx, aWglgetcurrentc; \"wglGetCurrentContext\"                   ; +0xe3, 0x1800df4d3\nmov     cs:wglGetCurrentDC, rax                                        ; +0xea, 0x1800df4da\ncall    cs:GetProcAddress                                              ; +0xf1, 0x1800df4e1\nmov     rcx, cs:hModule; hModule                                       ; +0xf7, 0x1800df4e7\nlea     rdx, aWglmakecurrent; \"wglMakeCurrent\"                         ; +0xfe, 0x1800df4ee\nmov     cs:wglGetCurrentContext, rax                                   ; +0x105, 0x1800df4f5\ncall    cs:GetProcAddress                                              ; +0x10c, 0x1800df4fc\nmov     rcx, cs:hModule; hModule                                       ; +0x112, 0x1800df502\nlea     rdx, aWglsharelists; \"wglShareLists\"                           ; +0x119, 0x1800df509\nmov     cs:wglMakeCurrent, rax                                         ; +0x120, 0x1800df510\ncall    cs:GetProcAddress                                              ; +0x127, 0x1800df517\nmov     rcx, cs:hRecipient; hWnd                                       ; +0x12d, 0x1800df51d\nmov     cs:wglShareLists, rax                                          ; +0x134, 0x1800df524\ncall    cs:GetDC                                                       ; +0x13b, 0x1800df52b\nxorps   xmm0, xmm0                                                     ; +0x141, 0x1800df531\nlea     rdx, [rsp+58h+ppfd]; ppfd                                      ; +0x144, 0x1800df534\nmovups  xmmword ptr [rsp+58h+ppfd.nSize], xmm0                         ; +0x149, 0x1800df539\nmov     rsi, rax                                                       ; +0x14e, 0x1800df53e\nmov     dword ptr [rsp+58h+ppfd.nSize], 10028h                         ; +0x151, 0x1800df541\nxor     eax, eax                                                       ; +0x159, 0x1800df549\nmov     [rsp+58h+ppfd.dwFlags], 25h ; '%'                              ; +0x15b, 0x1800df54b\nmov     rcx, rsi; hdc                                                  ; +0x163, 0x1800df553\nmov     qword ptr [rsp+58h+ppfd.dwVisibleMask], rax                    ; +0x166, 0x1800df556\nmovups  xmmword ptr [rsp+58h+ppfd.cAlphaBits], xmm0                    ; +0x16b, 0x1800df55b\nmov     word ptr [rsp+58h+ppfd.iPixelType], 1800h                      ; +0x170, 0x1800df560\nlea     edi, [rax+1]                                                   ; +0x177, 0x1800df567\ncall    cs:ChoosePixelFormat                                           ; +0x17a, 0x1800df56a\nlea     r8, [rsp+58h+ppfd]; ppfd                                       ; +0x180, 0x1800df570\nmov     rcx, rsi; hdc                                                  ; +0x185, 0x1800df575\nmov     edx, eax; format                                               ; +0x188, 0x1800df578\ncall    cs:SetPixelFormat                                              ; +0x18a, 0x1800df57a\ntest    eax, eax                                                       ; +0x190, 0x1800df580\njnz     short loc_1800DF59C                                            ; +0x192, 0x1800df582\nlea     rdx, aWglFailedToSet_0; \"WGL: Failed to set pixel format for dum\"... ; +0x194, 0x1800df584\nmov     ecx, 10008h                                                    ; +0x19b, 0x1800df58b\ncall    sub_1800E1AF0                                                  ; +0x1a0, 0x1800df590\nxor     eax, eax                                                       ; +0x1a5, 0x1800df595\njmp     loc_1800DF785                                                  ; +0x1a7, 0x1800df597\nmov     rcx, rsi                                                       ; +0x1ac, 0x1800df59c\nmov     [rsp+58h+arg_0], rbx                                           ; +0x1af, 0x1800df59f\ncall    cs:wglCreateContext                                            ; +0x1b4, 0x1800df5a4\nmov     rbx, rax                                                       ; +0x1ba, 0x1800df5aa\ntest    rax, rax                                                       ; +0x1bd, 0x1800df5ad\njnz     short loc_1800DF5CA                                            ; +0x1c0, 0x1800df5b0\nlea     rdx, aWglFailedToCre_1; \"WGL: Failed to create dummy context\"  ; +0x1c2, 0x1800df5b2\nmov     ecx, 10008h                                                    ; +0x1c9, 0x1800df5b9\ncall    sub_1800E1AF0                                                  ; +0x1ce, 0x1800df5be\nxor     eax, eax                                                       ; +0x1d3, 0x1800df5c3\njmp     loc_1800DF780                                                  ; +0x1d5, 0x1800df5c5\nmov     [rsp+58h+arg_8], rbp                                           ; +0x1da, 0x1800df5ca\nmov     [rsp+58h+arg_18], r14                                          ; +0x1df, 0x1800df5cf\ncall    cs:wglGetCurrentDC                                             ; +0x1e4, 0x1800df5d4\nmov     rbp, rax                                                       ; +0x1ea, 0x1800df5da\ncall    cs:wglGetCurrentContext                                        ; +0x1ed, 0x1800df5dd\nmov     rdx, rbx                                                       ; +0x1f3, 0x1800df5e3\nmov     rcx, rsi                                                       ; +0x1f6, 0x1800df5e6\nmov     r14, rax                                                       ; +0x1f9, 0x1800df5e9\ncall    cs:wglMakeCurrent                                              ; +0x1fc, 0x1800df5ec\ntest    eax, eax                                                       ; +0x202, 0x1800df5f2\njnz     short loc_1800DF623                                            ; +0x204, 0x1800df5f4\nlea     rdx, aWglFailedToMak; \"WGL: Failed to make dummy context curre\"... ; +0x206, 0x1800df5f6\nmov     ecx, 10008h                                                    ; +0x20d, 0x1800df5fd\ncall    sub_1800E1AF0                                                  ; +0x212, 0x1800df602\nmov     rdx, r14                                                       ; +0x217, 0x1800df607\nmov     rcx, rbp                                                       ; +0x21a, 0x1800df60a\ncall    cs:wglMakeCurrent                                              ; +0x21d, 0x1800df60d\nmov     rcx, rbx                                                       ; +0x223, 0x1800df613\ncall    cs:wglDeleteContext                                            ; +0x226, 0x1800df616\nxor     eax, eax                                                       ; +0x22c, 0x1800df61c\njmp     loc_1800DF776                                                  ; +0x22e, 0x1800df61e\nlea     rcx, aWglgetextensio; \"wglGetExtensionsStringEXT\"              ; +0x233, 0x1800df623\ncall    cs:wglGetProcAddress_0                                         ; +0x23a, 0x1800df62a\nlea     rcx, aWglgetextensio_0; \"wglGetExtensionsStringARB\"            ; +0x240, 0x1800df630\nmov     cs:qword_1801B6198, rax                                        ; +0x247, 0x1800df637\ncall    cs:wglGetProcAddress_0                                         ; +0x24e, 0x1800df63e\nlea     rcx, aWglcreateconte_0; \"wglCreateContextAttribsARB\"           ; +0x254, 0x1800df644\nmov     cs:qword_1801B61A0, rax                                        ; +0x25b, 0x1800df64b\ncall    cs:wglGetProcAddress_0                                         ; +0x262, 0x1800df652\nlea     rcx, aWglswapinterva; \"wglSwapIntervalEXT\"                     ; +0x268, 0x1800df658\nmov     cs:qword_1801B61A8, rax                                        ; +0x26f, 0x1800df65f\ncall    cs:wglGetProcAddress_0                                         ; +0x276, 0x1800df666\nlea     rcx, aWglgetpixelfor; \"wglGetPixelFormatAttribivARB\"           ; +0x27c, 0x1800df66c\nmov     cs:qword_1801B6188, rax                                        ; +0x283, 0x1800df673\ncall    cs:wglGetProcAddress_0                                         ; +0x28a, 0x1800df67a\nlea     rcx, aWglArbMultisam; \"WGL_ARB_multisample\"                    ; +0x290, 0x1800df680\nmov     cs:qword_1801B6190, rax                                        ; +0x297, 0x1800df687\ncall    sub_1800E0080                                                  ; +0x29e, 0x1800df68e\nlea     rcx, aWglArbFramebuf; \"WGL_ARB_framebuffer_sRGB\"               ; +0x2a3, 0x1800df693\nmov     cs:dword_1801B61B8, eax                                        ; +0x2aa, 0x1800df69a\ncall    sub_1800E0080                                                  ; +0x2b0, 0x1800df6a0\nlea     rcx, aWglExtFramebuf; \"WGL_EXT_framebuffer_sRGB\"               ; +0x2b5, 0x1800df6a5\nmov     cs:dword_1801B61BC, eax                                        ; +0x2bc, 0x1800df6ac\ncall    sub_1800E0080                                                  ; +0x2c2, 0x1800df6b2\nlea     rcx, aWglArbCreateCo; \"WGL_ARB_create_context\"                 ; +0x2c7, 0x1800df6b7\nmov     cs:dword_1801B61C0, eax                                        ; +0x2ce, 0x1800df6be\ncall    sub_1800E0080                                                  ; +0x2d4, 0x1800df6c4\nlea     rcx, aWglArbCreateCo_0; \"WGL_ARB_create_context_profile\"       ; +0x2d9, 0x1800df6c9\nmov     cs:dword_1801B61C8, eax                                        ; +0x2e0, 0x1800df6d0\ncall    sub_1800E0080                                                  ; +0x2e6, 0x1800df6d6\nlea     rcx, aWglExtCreateCo; \"WGL_EXT_create_context_es2_profile\"     ; +0x2eb, 0x1800df6db\nmov     cs:dword_1801B61CC, eax                                        ; +0x2f2, 0x1800df6e2\ncall    sub_1800E0080                                                  ; +0x2f8, 0x1800df6e8\nlea     rcx, aWglArbCreateCo_1; \"WGL_ARB_create_context_robustness\"    ; +0x2fd, 0x1800df6ed\nmov     cs:dword_1801B61D0, eax                                        ; +0x304, 0x1800df6f4\ncall    sub_1800E0080                                                  ; +0x30a, 0x1800df6fa\nlea     rcx, aWglArbCreateCo_2; \"WGL_ARB_create_context_no_error\"      ; +0x30f, 0x1800df6ff\nmov     cs:dword_1801B61D4, eax                                        ; +0x316, 0x1800df706\ncall    sub_1800E0080                                                  ; +0x31c, 0x1800df70c\nlea     rcx, SubStr; \"WGL_EXT_swap_control\"                            ; +0x321, 0x1800df711\nmov     cs:dword_1801B61D8, eax                                        ; +0x328, 0x1800df718\ncall    sub_1800E0080                                                  ; +0x32e, 0x1800df71e\nlea     rcx, aWglExtColorspa; \"WGL_EXT_colorspace\"                     ; +0x333, 0x1800df723\nmov     cs:dword_1801B61B0, eax                                        ; +0x33a, 0x1800df72a\ncall    sub_1800E0080                                                  ; +0x340, 0x1800df730\nlea     rcx, aWglArbPixelFor; \"WGL_ARB_pixel_format\"                   ; +0x345, 0x1800df735\nmov     cs:dword_1801B61B4, eax                                        ; +0x34c, 0x1800df73c\ncall    sub_1800E0080                                                  ; +0x352, 0x1800df742\nlea     rcx, aWglArbContextF; \"WGL_ARB_context_flush_control\"          ; +0x357, 0x1800df747\nmov     cs:dword_1801B61C4, eax                                        ; +0x35e, 0x1800df74e\ncall    sub_1800E0080                                                  ; +0x364, 0x1800df754\nmov     rdx, r14                                                       ; +0x369, 0x1800df759\nmov     cs:dword_1801B61DC, eax                                        ; +0x36c, 0x1800df75c\nmov     rcx, rbp                                                       ; +0x372, 0x1800df762\ncall    cs:wglMakeCurrent                                              ; +0x375, 0x1800df765\nmov     rcx, rbx                                                       ; +0x37b, 0x1800df76b\ncall    cs:wglDeleteContext                                            ; +0x37e, 0x1800df76e\nmov     eax, edi                                                       ; +0x384, 0x1800df774\nmov     rbp, [rsp+58h+arg_8]                                           ; +0x386, 0x1800df776\nmov     r14, [rsp+58h+arg_18]                                          ; +0x38b, 0x1800df77b\nmov     rbx, [rsp+58h+arg_0]                                           ; +0x390, 0x1800df780\nmov     rsi, [rsp+58h+arg_10]                                          ; +0x395, 0x1800df785\nmov     rcx, [rsp+58h+var_10]                                          ; +0x39a, 0x1800df78a\nxor     rcx, rsp; StackCookie                                          ; +0x39f, 0x1800df78f\ncall    __security_check_cookie                                        ; +0x3a2, 0x1800df792\nadd     rsp, 50h                                                       ; +0x3a7, 0x1800df797\npop     rdi                                                            ; +0x3ab, 0x1800df79b\nretn                                                                   ; +0x3ac, 0x1800df79c", "xrefs": ["sub_1800D7E10 @ 0x1800d7e53", "<???> @ 0x18014c640", "<???> @ 0x18014c678", "<???> @ 0x1801c5034"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}