{"type": "func", "start": 6443364192, "end": 6443364679, "name": "sub_1800DEF60", "pseudocode": "// \n// sub_1800DEF60 from 0x1800def60 to 0x1800df147 (487 bytes)\n// \n// 5 xrefs:\n// > sub_1800D6480 @ 0x1800d650b\n// > <???> @ 0x1801434f8\n// > <???> @ 0x180143508\n// > <???> @ 0x1801baf38\n// > <???> @ 0x1801baf44\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n__int64 sub_1800DEF60()\n{\n  const CHAR *v0; // rax\n  __int64 v2; // rbx\n  FARPROC OSMesaGetProcAddress; // rax\n  _QWORD v4[2]; // [rsp+28h] [rbp-20h]\n\n  v0 = \"libOSMesa.dll\";\n  v4[0] = \"OSMesa.dll\";\n  v4[1] = 0;\n  if ( qword_1801AC220 )\n    return 1;\n  v2 = 0;\n  do\n  {\n    qword_1801AC220 = LoadLibraryA(v0);\n    if ( qword_1801AC220 )\n      break;\n    v0 = (const CHAR *)v4[v2++];\n  }\n  while ( v0 );\n  if ( qword_1801AC220 )\n  {\n    OSMesaCreateContextExt = (__int64 (__fastcall *)(_QWORD, _QWORD, _QWORD, _QWORD, _QWORD))GetProcAddress(\n                                                                                               qword_1801AC220,\n                                                                                               \"OSMesaCreateContextExt\");\n    OSMesaCreateContextAttribs = (__int64)GetProcAddress(qword_1801AC220, \"OSMesaCreateContextAttribs\");\n    OSMesaDestroyContext = (__int64)GetProcAddress(qword_1801AC220, \"OSMesaDestroyContext\");\n    OSMesaMakeCurrent = (__int64)GetProcAddress(qword_1801AC220, \"OSMesaMakeCurrent\");\n    OSMesaGetColorBuffer = (__int64)GetProcAddress(qword_1801AC220, \"OSMesaGetColorBuffer\");\n    OSMesaGetDepthBuffer = (__int64)GetProcAddress(qword_1801AC220, \"OSMesaGetDepthBuffer\");\n    OSMesaGetProcAddress = GetProcAddress(qword_1801AC220, \"OSMesaGetProcAddress\");\n    qword_1801AC258 = (__int64)OSMesaGetProcAddress;\n    if ( OSMesaCreateContextExt\n      && OSMesaDestroyContext\n      && OSMesaMakeCurrent\n      && OSMesaGetColorBuffer\n      && OSMesaGetDepthBuffer\n      && OSMesaGetProcAddress )\n    {\n      return 1;\n    }\n    sub_1800D3530(0x10008u, \"OSMesa: Failed to load required entry points\");\n    if ( qword_1801AC220 )\n    {\n      FreeLibrary(qword_1801AC220);\n      qword_1801AC220 = nullptr;\n    }\n    return 0;\n  }\n  else\n  {\n    sub_1800D3530(0x10006u, \"OSMesa: Library not found\");\n    return 0;\n  }\n}", "assembly": "; \n; sub_1800DEF60 from 0x1800def60 to 0x1800df147 (487 bytes)\n; \n; 5 xrefs:\n; > sub_1800D6480 @ 0x1800d650b\n; > <???> @ 0x1801434f8\n; > <???> @ 0x180143508\n; > <???> @ 0x1801baf38\n; > <???> @ 0x1801baf44\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nsub     rsp, 48h                                                       ; +0x0, 0x1800def60\nmov     rax, cs:__security_cookie                                      ; +0x4, 0x1800def64\nxor     rax, rsp                                                       ; +0xb, 0x1800def6b\nmov     [rsp+48h+var_10], rax                                          ; +0xe, 0x1800def6e\ncmp     cs:qword_1801AC220, 0                                          ; +0x13, 0x1800def73\nlea     rax, aLibosmesaDll; \"libOSMesa.dll\"                            ; +0x1b, 0x1800def7b\nlea     rcx, aOsmesaDll; \"OSMesa.dll\"                                  ; +0x22, 0x1800def82\nmov     [rsp+48h+var_28], rax                                          ; +0x29, 0x1800def89\nmov     [rsp+48h+var_20], rcx                                          ; +0x2e, 0x1800def8e\nmov     [rsp+48h+var_18], 0                                            ; +0x33, 0x1800def93\njz      short loc_1800DEFB5                                            ; +0x3c, 0x1800def9c\nmov     eax, 1                                                         ; +0x3e, 0x1800def9e\nmov     rcx, [rsp+48h+var_10]                                          ; +0x43, 0x1800defa3\nxor     rcx, rsp; StackCookie                                          ; +0x48, 0x1800defa8\ncall    __security_check_cookie                                        ; +0x4b, 0x1800defab\nadd     rsp, 48h                                                       ; +0x50, 0x1800defb0\nretn                                                                   ; +0x54, 0x1800defb4\nmov     [rsp+48h+var_8], rbx                                           ; +0x55, 0x1800defb5\nxor     ebx, ebx                                                       ; +0x5a, 0x1800defba\nnop     dword ptr [rax+00h]                                            ; +0x5c, 0x1800defbc\nmov     rcx, rax; lpLibFileName                                        ; +0x60, 0x1800defc0\ncall    cs:LoadLibraryA                                                ; +0x63, 0x1800defc3\nmov     cs:qword_1801AC220, rax                                        ; +0x69, 0x1800defc9\nmov     rcx, rax; hModule                                              ; +0x70, 0x1800defd0\ntest    rax, rax                                                       ; +0x73, 0x1800defd3\njnz     short loc_1800DEFE5                                            ; +0x76, 0x1800defd6\nmov     rax, [rsp+rbx*8+48h+var_20]                                    ; +0x78, 0x1800defd8\ninc     rbx                                                            ; +0x7d, 0x1800defdd\ntest    rax, rax                                                       ; +0x80, 0x1800defe0\njnz     short loc_1800DEFC0                                            ; +0x83, 0x1800defe3\nmov     rbx, [rsp+48h+var_8]                                           ; +0x85, 0x1800defe5\ntest    rcx, rcx                                                       ; +0x8a, 0x1800defea\njnz     short loc_1800DF014                                            ; +0x8d, 0x1800defed\nlea     rdx, aOsmesaLibraryN; \"OSMesa: Library not found\"              ; +0x8f, 0x1800defef\nmov     ecx, 10006h                                                    ; +0x96, 0x1800deff6\ncall    sub_1800D3530                                                  ; +0x9b, 0x1800deffb\nxor     eax, eax                                                       ; +0xa0, 0x1800df000\nmov     rcx, [rsp+48h+var_10]                                          ; +0xa2, 0x1800df002\nxor     rcx, rsp; StackCookie                                          ; +0xa7, 0x1800df007\ncall    __security_check_cookie                                        ; +0xaa, 0x1800df00a\nadd     rsp, 48h                                                       ; +0xaf, 0x1800df00f\nretn                                                                   ; +0xb3, 0x1800df013\nlea     rdx, aOsmesacreateco; \"OSMesaCreateContextExt\"                 ; +0xb4, 0x1800df014\ncall    cs:GetProcAddress                                              ; +0xbb, 0x1800df01b\nmov     rcx, cs:qword_1801AC220; hModule                               ; +0xc1, 0x1800df021\nlea     rdx, aOsmesacreateco_0; \"OSMesaCreateContextAttribs\"           ; +0xc8, 0x1800df028\nmov     cs:OSMesaCreateContextExt, rax                                 ; +0xcf, 0x1800df02f\ncall    cs:GetProcAddress                                              ; +0xd6, 0x1800df036\nmov     rcx, cs:qword_1801AC220; hModule                               ; +0xdc, 0x1800df03c\nlea     rdx, aOsmesadestroyc; \"OSMesaDestroyContext\"                   ; +0xe3, 0x1800df043\nmov     cs:OSMesaCreateContextAttribs, rax                             ; +0xea, 0x1800df04a\ncall    cs:GetProcAddress                                              ; +0xf1, 0x1800df051\nmov     rcx, cs:qword_1801AC220; hModule                               ; +0xf7, 0x1800df057\nlea     rdx, aOsmesamakecurr; \"OSMesaMakeCurrent\"                      ; +0xfe, 0x1800df05e\nmov     cs:OSMesaDestroyContext, rax                                   ; +0x105, 0x1800df065\ncall    cs:GetProcAddress                                              ; +0x10c, 0x1800df06c\nmov     rcx, cs:qword_1801AC220; hModule                               ; +0x112, 0x1800df072\nlea     rdx, aOsmesagetcolor; \"OSMesaGetColorBuffer\"                   ; +0x119, 0x1800df079\nmov     cs:OSMesaMakeCurrent, rax                                      ; +0x120, 0x1800df080\ncall    cs:GetProcAddress                                              ; +0x127, 0x1800df087\nmov     rcx, cs:qword_1801AC220; hModule                               ; +0x12d, 0x1800df08d\nlea     rdx, aOsmesagetdepth; \"OSMesaGetDepthBuffer\"                   ; +0x134, 0x1800df094\nmov     cs:OSMesaGetColorBuffer, rax                                   ; +0x13b, 0x1800df09b\ncall    cs:GetProcAddress                                              ; +0x142, 0x1800df0a2\nmov     rcx, cs:qword_1801AC220; hModule                               ; +0x148, 0x1800df0a8\nlea     rdx, aOsmesagetproca; \"OSMesaGetProcAddress\"                   ; +0x14f, 0x1800df0af\nmov     cs:OSMesaGetDepthBuffer, rax                                   ; +0x156, 0x1800df0b6\ncall    cs:GetProcAddress                                              ; +0x15d, 0x1800df0bd\ncmp     cs:OSMesaCreateContextExt, 0                                   ; +0x163, 0x1800df0c3\nmov     cs:qword_1801AC258, rax                                        ; +0x16b, 0x1800df0cb\njz      short loc_1800DF105                                            ; +0x172, 0x1800df0d2\ncmp     cs:OSMesaDestroyContext, 0                                     ; +0x174, 0x1800df0d4\njz      short loc_1800DF105                                            ; +0x17c, 0x1800df0dc\ncmp     cs:OSMesaMakeCurrent, 0                                        ; +0x17e, 0x1800df0de\njz      short loc_1800DF105                                            ; +0x186, 0x1800df0e6\ncmp     cs:OSMesaGetColorBuffer, 0                                     ; +0x188, 0x1800df0e8\njz      short loc_1800DF105                                            ; +0x190, 0x1800df0f0\ncmp     cs:OSMesaGetDepthBuffer, 0                                     ; +0x192, 0x1800df0f2\njz      short loc_1800DF105                                            ; +0x19a, 0x1800df0fa\ntest    rax, rax                                                       ; +0x19c, 0x1800df0fc\njnz     loc_1800DEF9E                                                  ; +0x19f, 0x1800df0ff\nlea     rdx, aOsmesaFailedTo_0; \"OSMesa: Failed to load required entry p\"... ; +0x1a5, 0x1800df105\nmov     ecx, 10008h                                                    ; +0x1ac, 0x1800df10c\ncall    sub_1800D3530                                                  ; +0x1b1, 0x1800df111\nmov     rcx, cs:qword_1801AC220; hLibModule                            ; +0x1b6, 0x1800df116\ntest    rcx, rcx                                                       ; +0x1bd, 0x1800df11d\njz      short loc_1800DF133                                            ; +0x1c0, 0x1800df120\ncall    cs:FreeLibrary                                                 ; +0x1c2, 0x1800df122\nmov     cs:qword_1801AC220, 0                                          ; +0x1c8, 0x1800df128\nxor     eax, eax                                                       ; +0x1d3, 0x1800df133\nmov     rcx, [rsp+48h+var_10]                                          ; +0x1d5, 0x1800df135\nxor     rcx, rsp; StackCookie                                          ; +0x1da, 0x1800df13a\ncall    __security_check_cookie                                        ; +0x1dd, 0x1800df13d\nadd     rsp, 48h                                                       ; +0x1e2, 0x1800df142\nretn                                                                   ; +0x1e6, 0x1800df146", "xrefs": ["sub_1800D6480 @ 0x1800d650b", "<???> @ 0x1801434f8", "<???> @ 0x180143508", "<???> @ 0x1801baf38", "<???> @ 0x1801baf44"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}