{"type": "func", "start": 6443331808, "end": 6443332383, "name": "sub_1800D70E0", "pseudocode": "// \n// sub_1800D70E0 from 0x1800d70e0 to 0x1800d731f (575 bytes)\n// \n// 2 xrefs:\n// > sub_1800DC220 @ 0x1800dc3a0\n// > <???> @ 0x1801c48fc\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:33 +0000\n// \n\n__int64 __fastcall sub_1800D70E0(int *a1)\n{\n  int v1; // r8d\n  int v3; // edx\n  __int64 v4; // rax\n  int v5; // r8d\n  int v6; // edx\n  int v7; // r9d\n  int v8; // r8d\n  int v9; // eax\n  int v10; // r8d\n  int v11; // r8d\n\n  v1 = a1[1];\n  if ( (unsigned int)(v1 - 221185) > 2 )\n  {\n    sub_1800DB260(65539, \"Invalid context creation API 0x%08X\", v1);\n    return 0;\n  }\n  v3 = *a1;\n  if ( *a1 && (unsigned int)(v3 - 196609) > 1 )\n  {\n    sub_1800DB260(65539, \"Invalid client API 0x%08X\", v3);\n    return 0;\n  }\n  v4 = *((_QWORD *)a1 + 5);\n  if ( v4 )\n  {\n    if ( !v3 || !*(_DWORD *)(v4 + 512) )\n    {\n      sub_1800DB260(65546, nullptr);\n      return 0;\n    }\n    if ( v1 != *(_DWORD *)(v4 + 516) )\n    {\n      sub_1800DB260(65539, \"Context creation APIs do not match between contexts\");\n      return 0;\n    }\n  }\n  if ( v3 == 196609 )\n  {\n    v5 = a1[2];\n    if ( v5 < 1 || (v6 = a1[3], v6 < 0) || v5 == 1 && v6 > 5 || v5 == 2 && v6 > 1 || v5 == 3 && v6 > 3 )\n    {\n      sub_1800DB260(65540, \"Invalid OpenGL version %i.%i\", v5, a1[3]);\n      return 0;\n    }\n    v7 = a1[7];\n    if ( v7 )\n    {\n      if ( (unsigned int)(v7 - 204801) > 1 )\n      {\n        sub_1800DB260(65539, \"Invalid OpenGL profile 0x%08X\", v7);\n        return 0;\n      }\n      if ( v5 <= 2 || v5 == 3 && v6 < 2 )\n      {\n        sub_1800DB260(65540, \"Context profiles are only defined for OpenGL version 3.2 and above\");\n        return 0;\n      }\n    }\n    if ( a1[4] && v5 <= 2 )\n    {\n      sub_1800DB260(65540, \"Forward-compatibility is only defined for OpenGL version 3.0 and above\");\n      return 0;\n    }\n  }\n  else if ( v3 == 196610 )\n  {\n    if ( (v8 = a1[2], v8 < 1) || (v9 = a1[3], v9 < 0) || v8 == 1 && v9 > 1 || v8 == 2 && v9 > 0 )\n    {\n      sub_1800DB260(65540, \"Invalid OpenGL ES version %i.%i\", v8, a1[3]);\n      return 0;\n    }\n  }\n  v10 = a1[8];\n  if ( v10 && (unsigned int)(v10 - 200705) > 1 )\n  {\n    sub_1800DB260(65539, \"Invalid context robustness mode 0x%08X\", v10);\n    return 0;\n  }\n  else\n  {\n    v11 = a1[9];\n    if ( v11 && (unsigned int)(v11 - 217089) > 1 )\n    {\n      sub_1800DB260(65539, \"Invalid context release behavior 0x%08X\", v11);\n      return 0;\n    }\n    else\n    {\n      return 1;\n    }\n  }\n}", "assembly": "; \n; sub_1800D70E0 from 0x1800d70e0 to 0x1800d731f (575 bytes)\n; \n; 2 xrefs:\n; > sub_1800DC220 @ 0x1800dc3a0\n; > <???> @ 0x1801c48fc\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:33 +0000\n; \nsub     rsp, 28h                                                       ; +0x0, 0x1800d70e0\nmov     r8d, [rcx+4]                                                   ; +0x4, 0x1800d70e4\nlea     eax, [r8-36001h]                                               ; +0x8, 0x1800d70e8\ncmp     eax, 2                                                         ; +0xf, 0x1800d70ef\njbe     short loc_1800D710C                                            ; +0x12, 0x1800d70f2\nlea     rdx, aInvalidContext; \"Invalid context creation API 0x%08X\"    ; +0x14, 0x1800d70f4\nmov     ecx, 10003h                                                    ; +0x1b, 0x1800d70fb\ncall    sub_1800DB260                                                  ; +0x20, 0x1800d7100\nxor     eax, eax                                                       ; +0x25, 0x1800d7105\nadd     rsp, 28h                                                       ; +0x27, 0x1800d7107\nretn                                                                   ; +0x2b, 0x1800d710b\nmov     edx, [rcx]                                                     ; +0x2c, 0x1800d710c\ntest    edx, edx                                                       ; +0x2e, 0x1800d710e\njz      short loc_1800D7138                                            ; +0x30, 0x1800d7110\nlea     eax, [rdx-30001h]                                              ; +0x32, 0x1800d7112\ncmp     eax, 1                                                         ; +0x38, 0x1800d7118\njbe     short loc_1800D7138                                            ; +0x3b, 0x1800d711b\nmov     r8d, edx                                                       ; +0x3d, 0x1800d711d\nmov     ecx, 10003h                                                    ; +0x40, 0x1800d7120\nlea     rdx, aInvalidClientA; \"Invalid client API 0x%08X\"              ; +0x45, 0x1800d7125\ncall    sub_1800DB260                                                  ; +0x4c, 0x1800d712c\nxor     eax, eax                                                       ; +0x51, 0x1800d7131\nadd     rsp, 28h                                                       ; +0x53, 0x1800d7133\nretn                                                                   ; +0x57, 0x1800d7137\nmov     rax, [rcx+28h]                                                 ; +0x58, 0x1800d7138\ntest    rax, rax                                                       ; +0x5c, 0x1800d713c\njz      short loc_1800D7182                                            ; +0x5f, 0x1800d713f\ntest    edx, edx                                                       ; +0x61, 0x1800d7141\njz      short loc_1800D716F                                            ; +0x63, 0x1800d7143\ncmp     dword ptr [rax+200h], 0                                        ; +0x65, 0x1800d7145\njz      short loc_1800D716F                                            ; +0x6c, 0x1800d714c\ncmp     r8d, [rax+204h]                                                ; +0x6e, 0x1800d714e\njz      short loc_1800D7182                                            ; +0x75, 0x1800d7155\nlea     rdx, aContextCreatio; \"Context creation APIs do not match betw\"... ; +0x77, 0x1800d7157\nmov     ecx, 10003h                                                    ; +0x7e, 0x1800d715e\ncall    sub_1800DB260                                                  ; +0x83, 0x1800d7163\nxor     eax, eax                                                       ; +0x88, 0x1800d7168\nadd     rsp, 28h                                                       ; +0x8a, 0x1800d716a\nretn                                                                   ; +0x8e, 0x1800d716e\nxor     edx, edx                                                       ; +0x8f, 0x1800d716f\nmov     ecx, 1000Ah                                                    ; +0x91, 0x1800d7171\ncall    sub_1800DB260                                                  ; +0x96, 0x1800d7176\nxor     eax, eax                                                       ; +0x9b, 0x1800d717b\nadd     rsp, 28h                                                       ; +0x9d, 0x1800d717d\nretn                                                                   ; +0xa1, 0x1800d7181\ncmp     edx, 30001h                                                    ; +0xa2, 0x1800d7182\njnz     loc_1800D7271                                                  ; +0xa8, 0x1800d7188\nmov     r8d, [rcx+8]                                                   ; +0xae, 0x1800d718e\ncmp     r8d, 1                                                         ; +0xb2, 0x1800d7192\njl      loc_1800D7255                                                  ; +0xb6, 0x1800d7196\nmov     edx, [rcx+0Ch]                                                 ; +0xbc, 0x1800d719c\ntest    edx, edx                                                       ; +0xbf, 0x1800d719f\njs      loc_1800D7255                                                  ; +0xc1, 0x1800d71a1\ncmp     r8d, 1                                                         ; +0xc7, 0x1800d71a7\njnz     short loc_1800D71B6                                            ; +0xcb, 0x1800d71ab\ncmp     edx, 5                                                         ; +0xcd, 0x1800d71ad\njg      loc_1800D7255                                                  ; +0xd0, 0x1800d71b0\ncmp     r8d, 2                                                         ; +0xd6, 0x1800d71b6\njnz     short loc_1800D71C5                                            ; +0xda, 0x1800d71ba\ncmp     edx, 1                                                         ; +0xdc, 0x1800d71bc\njg      loc_1800D7255                                                  ; +0xdf, 0x1800d71bf\ncmp     r8d, 3                                                         ; +0xe5, 0x1800d71c5\njnz     short loc_1800D71D4                                            ; +0xe9, 0x1800d71c9\ncmp     edx, r8d                                                       ; +0xeb, 0x1800d71cb\njg      loc_1800D7255                                                  ; +0xee, 0x1800d71ce\nmov     r9d, [rcx+1Ch]                                                 ; +0xf4, 0x1800d71d4\ntest    r9d, r9d                                                       ; +0xf8, 0x1800d71d8\njz      short loc_1800D722D                                            ; +0xfb, 0x1800d71db\nlea     eax, [r9-32001h]                                               ; +0xfd, 0x1800d71dd\ncmp     eax, 1                                                         ; +0x104, 0x1800d71e4\njbe     short loc_1800D7204                                            ; +0x107, 0x1800d71e7\nmov     r8d, r9d                                                       ; +0x109, 0x1800d71e9\nlea     rdx, aInvalidOpenglP; \"Invalid OpenGL profile 0x%08X\"          ; +0x10c, 0x1800d71ec\nmov     ecx, 10003h                                                    ; +0x113, 0x1800d71f3\ncall    sub_1800DB260                                                  ; +0x118, 0x1800d71f8\nxor     eax, eax                                                       ; +0x11d, 0x1800d71fd\nadd     rsp, 28h                                                       ; +0x11f, 0x1800d71ff\nretn                                                                   ; +0x123, 0x1800d7203\ncmp     r8d, 2                                                         ; +0x124, 0x1800d7204\njle     short loc_1800D7215                                            ; +0x128, 0x1800d7208\ncmp     r8d, 3                                                         ; +0x12a, 0x1800d720a\njnz     short loc_1800D722D                                            ; +0x12e, 0x1800d720e\ncmp     edx, 2                                                         ; +0x130, 0x1800d7210\njge     short loc_1800D722D                                            ; +0x133, 0x1800d7213\nlea     rdx, aContextProfile; \"Context profiles are only defined for O\"... ; +0x135, 0x1800d7215\nmov     ecx, 10004h                                                    ; +0x13c, 0x1800d721c\ncall    sub_1800DB260                                                  ; +0x141, 0x1800d7221\nxor     eax, eax                                                       ; +0x146, 0x1800d7226\nadd     rsp, 28h                                                       ; +0x148, 0x1800d7228\nretn                                                                   ; +0x14c, 0x1800d722c\ncmp     dword ptr [rcx+10h], 0                                         ; +0x14d, 0x1800d722d\njz      loc_1800D72BB                                                  ; +0x151, 0x1800d7231\ncmp     r8d, 2                                                         ; +0x157, 0x1800d7237\njg      short loc_1800D72BB                                            ; +0x15b, 0x1800d723b\nlea     rdx, aForwardCompati; \"Forward-compatibility is only defined f\"... ; +0x15d, 0x1800d723d\nmov     ecx, 10004h                                                    ; +0x164, 0x1800d7244\ncall    sub_1800DB260                                                  ; +0x169, 0x1800d7249\nxor     eax, eax                                                       ; +0x16e, 0x1800d724e\nadd     rsp, 28h                                                       ; +0x170, 0x1800d7250\nretn                                                                   ; +0x174, 0x1800d7254\nmov     r9d, [rcx+0Ch]                                                 ; +0x175, 0x1800d7255\nlea     rdx, aInvalidOpenglV; \"Invalid OpenGL version %i.%i\"           ; +0x179, 0x1800d7259\nmov     ecx, 10004h                                                    ; +0x180, 0x1800d7260\ncall    sub_1800DB260                                                  ; +0x185, 0x1800d7265\nxor     eax, eax                                                       ; +0x18a, 0x1800d726a\nadd     rsp, 28h                                                       ; +0x18c, 0x1800d726c\nretn                                                                   ; +0x190, 0x1800d7270\ncmp     edx, 30002h                                                    ; +0x191, 0x1800d7271\njnz     short loc_1800D72BB                                            ; +0x197, 0x1800d7277\nmov     r8d, [rcx+8]                                                   ; +0x199, 0x1800d7279\ncmp     r8d, 1                                                         ; +0x19d, 0x1800d727d\njl      short loc_1800D729F                                            ; +0x1a1, 0x1800d7281\nmov     eax, [rcx+0Ch]                                                 ; +0x1a3, 0x1800d7283\ntest    eax, eax                                                       ; +0x1a6, 0x1800d7286\njs      short loc_1800D729F                                            ; +0x1a8, 0x1800d7288\ncmp     r8d, 1                                                         ; +0x1aa, 0x1800d728a\njnz     short loc_1800D7295                                            ; +0x1ae, 0x1800d728e\ncmp     eax, r8d                                                       ; +0x1b0, 0x1800d7290\njg      short loc_1800D729F                                            ; +0x1b3, 0x1800d7293\ncmp     r8d, 2                                                         ; +0x1b5, 0x1800d7295\njnz     short loc_1800D72BB                                            ; +0x1b9, 0x1800d7299\ntest    eax, eax                                                       ; +0x1bb, 0x1800d729b\njle     short loc_1800D72BB                                            ; +0x1bd, 0x1800d729d\nmov     r9d, [rcx+0Ch]                                                 ; +0x1bf, 0x1800d729f\nlea     rdx, aInvalidOpenglE; \"Invalid OpenGL ES version %i.%i\"        ; +0x1c3, 0x1800d72a3\nmov     ecx, 10004h                                                    ; +0x1ca, 0x1800d72aa\ncall    sub_1800DB260                                                  ; +0x1cf, 0x1800d72af\nxor     eax, eax                                                       ; +0x1d4, 0x1800d72b4\nadd     rsp, 28h                                                       ; +0x1d6, 0x1800d72b6\nretn                                                                   ; +0x1da, 0x1800d72ba\nmov     r8d, [rcx+20h]                                                 ; +0x1db, 0x1800d72bb\ntest    r8d, r8d                                                       ; +0x1df, 0x1800d72bf\njz      short loc_1800D72E8                                            ; +0x1e2, 0x1800d72c2\nlea     eax, [r8-31001h]                                               ; +0x1e4, 0x1800d72c4\ncmp     eax, 1                                                         ; +0x1eb, 0x1800d72cb\njbe     short loc_1800D72E8                                            ; +0x1ee, 0x1800d72ce\nlea     rdx, aInvalidContext_0; \"Invalid context robustness mode 0x%08X\" ; +0x1f0, 0x1800d72d0\nmov     ecx, 10003h                                                    ; +0x1f7, 0x1800d72d7\ncall    sub_1800DB260                                                  ; +0x1fc, 0x1800d72dc\nxor     eax, eax                                                       ; +0x201, 0x1800d72e1\nadd     rsp, 28h                                                       ; +0x203, 0x1800d72e3\nretn                                                                   ; +0x207, 0x1800d72e7\nmov     r8d, [rcx+24h]                                                 ; +0x208, 0x1800d72e8\ntest    r8d, r8d                                                       ; +0x20c, 0x1800d72ec\njz      short loc_1800D7315                                            ; +0x20f, 0x1800d72ef\nlea     eax, [r8-35001h]                                               ; +0x211, 0x1800d72f1\ncmp     eax, 1                                                         ; +0x218, 0x1800d72f8\njbe     short loc_1800D7315                                            ; +0x21b, 0x1800d72fb\nlea     rdx, aInvalidContext_1; \"Invalid context release behavior 0x%08X\" ; +0x21d, 0x1800d72fd\nmov     ecx, 10003h                                                    ; +0x224, 0x1800d7304\ncall    sub_1800DB260                                                  ; +0x229, 0x1800d7309\nxor     eax, eax                                                       ; +0x22e, 0x1800d730e\nadd     rsp, 28h                                                       ; +0x230, 0x1800d7310\nretn                                                                   ; +0x234, 0x1800d7314\nmov     eax, 1                                                         ; +0x235, 0x1800d7315\nadd     rsp, 28h                                                       ; +0x23a, 0x1800d731a\nretn                                                                   ; +0x23e, 0x1800d731e", "xrefs": ["sub_1800DC220 @ 0x1800dc3a0", "<???> @ 0x1801c48fc"], "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"}