{"type": "func", "start": 6443316208, "end": 6443316355, "name": "sub_1800D33F0", "pseudocode": "// \n// sub_1800D33F0 from 0x1800d33f0 to 0x1800d3483 (147 bytes)\n// \n// 4 xrefs:\n// > cocos2d::CCEGLView::setupWindow @ 0x180078af8\n// > sub_1800D44F0 @ 0x1800d47d3\n// > sub_1800D4950 @ 0x1800d49d1\n// > <???> @ 0x1801ba53c\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 __fastcall sub_1800D33F0(__int64 a1)\n{\n  __int64 result; // rax\n  __int64 v3; // rdx\n\n  if ( !*(_DWORD *)&ModuleName )\n    return sub_1800D3530(65537, nullptr);\n  result = sub_1800D99B0(&unk_1801AB18C);\n  v3 = result;\n  if ( a1 && !*(_DWORD *)(a1 + 512) )\n    return sub_1800D3530(65546, \"Cannot make current with a window that has no OpenGL or OpenGL ES context\");\n  if ( !result )\n  {\nLABEL_10:\n    if ( !a1 )\n      return result;\n    return (*(__int64 (__fastcall **)(__int64, __int64))(a1 + 584))(a1, v3);\n  }\n  if ( !a1 || *(_DWORD *)(a1 + 516) != *(_DWORD *)(result + 516) )\n  {\n    result = (*(__int64 (__fastcall **)(_QWORD))(result + 584))(0);\n    goto LABEL_10;\n  }\n  return (*(__int64 (__fastcall **)(__int64, __int64))(a1 + 584))(a1, v3);\n}", "assembly": "; \n; sub_1800D33F0 from 0x1800d33f0 to 0x1800d3483 (147 bytes)\n; \n; 4 xrefs:\n; > cocos2d::CCEGLView::setupWindow @ 0x180078af8\n; > sub_1800D44F0 @ 0x1800d47d3\n; > sub_1800D4950 @ 0x1800d49d1\n; > <???> @ 0x1801ba53c\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\npush    rbx                                                            ; +0x0, 0x1800d33f0\nsub     rsp, 20h                                                       ; +0x2, 0x1800d33f2\ncmp     dword ptr cs:ModuleName, 0                                     ; +0x6, 0x1800d33f6\nmov     rbx, rcx                                                       ; +0xd, 0x1800d33fd\njnz     short loc_1800D3413                                            ; +0x10, 0x1800d3400\nxor     edx, edx                                                       ; +0x12, 0x1800d3402\nmov     ecx, 10001h                                                    ; +0x14, 0x1800d3404\nadd     rsp, 20h                                                       ; +0x19, 0x1800d3409\npop     rbx                                                            ; +0x1d, 0x1800d340d\njmp     sub_1800D3530                                                  ; +0x1e, 0x1800d340e\nlea     rcx, unk_1801AB18C                                             ; +0x23, 0x1800d3413\ncall    sub_1800D99B0                                                  ; +0x2a, 0x1800d341a\nmov     rdx, rax                                                       ; +0x2f, 0x1800d341f\ntest    rbx, rbx                                                       ; +0x32, 0x1800d3422\njz      short loc_1800D3446                                            ; +0x35, 0x1800d3425\ncmp     dword ptr [rbx+200h], 0                                        ; +0x37, 0x1800d3427\njnz     short loc_1800D3446                                            ; +0x3e, 0x1800d342e\nlea     rdx, aCannotMakeCurr; \"Cannot make current with a window that \"... ; +0x40, 0x1800d3430\nmov     ecx, 1000Ah                                                    ; +0x47, 0x1800d3437\nadd     rsp, 20h                                                       ; +0x4c, 0x1800d343c\npop     rbx                                                            ; +0x50, 0x1800d3440\njmp     sub_1800D3530                                                  ; +0x51, 0x1800d3441\ntest    rdx, rdx                                                       ; +0x56, 0x1800d3446\njz      short loc_1800D3466                                            ; +0x59, 0x1800d3449\ntest    rbx, rbx                                                       ; +0x5b, 0x1800d344b\njz      short loc_1800D345E                                            ; +0x5e, 0x1800d344e\nmov     eax, [rax+204h]                                                ; +0x60, 0x1800d3450\ncmp     [rbx+204h], eax                                                ; +0x66, 0x1800d3456\njz      short loc_1800D346B                                            ; +0x6c, 0x1800d345c\nxor     ecx, ecx                                                       ; +0x6e, 0x1800d345e\ncall    qword ptr [rdx+248h]                                           ; +0x70, 0x1800d3460\ntest    rbx, rbx                                                       ; +0x76, 0x1800d3466\njz      short loc_1800D347D                                            ; +0x79, 0x1800d3469\nmov     rcx, rbx                                                       ; +0x7b, 0x1800d346b\nmov     rax, [rbx+248h]                                                ; +0x7e, 0x1800d346e\nadd     rsp, 20h                                                       ; +0x85, 0x1800d3475\npop     rbx                                                            ; +0x89, 0x1800d3479\njmp     rax                                                            ; +0x8a, 0x1800d347a\nadd     rsp, 20h                                                       ; +0x8d, 0x1800d347d\npop     rbx                                                            ; +0x91, 0x1800d3481\nretn                                                                   ; +0x92, 0x1800d3482", "xrefs": ["cocos2d::CCEGLView::setupWindow @ 0x180078af8", "sub_1800D44F0 @ 0x1800d47d3", "sub_1800D4950 @ 0x1800d49d1", "<???> @ 0x1801ba53c"], "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"}