{"type": "func", "start": 6442939008, "end": 6442939628, "name": "cocos2d::CCEGLView::initWithRect", "pseudocode": "// \n// cocos2d::CCEGLView::initWithRect from 0x180077280 to 0x1800774ec (620 bytes)\n// \n// 7 xrefs:\n// > cocos2d::CCEGLView::create @ 0x18007683c\n// > cocos2d::CCEGLView::createWithFullScreen @ 0x180076a07\n// > cocos2d::CCEGLView::createWithRect @ 0x180076a9e\n// > cocos2d::CCEGLView::initWithFullScreen @ 0x180077161\n// > cocos2d::CCEGLView::initWithFullscreen @ 0x180077265\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b4950\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\nchar __fastcall cocos2d::CCEGLView::initWithRect(\n        cocos2d::CCEGLView *this,\n        _QWORD *a2,\n        const struct cocos2d::CCRect *a3,\n        float a4)\n{\n  float *v6; // rax\n  struct cocos2d::CCRect *v7; // rax\n  const char *String; // rdi\n  HWND v9; // rax\n  __int64 v11; // rcx\n  int v12; // r8d\n  HWND v13; // rax\n  int v14; // [rsp+40h] [rbp-158h] BYREF\n  cocos2d::CCRect v15; // [rsp+48h] [rbp-150h] BYREF\n  char Buffer[256]; // [rsp+60h] [rbp-138h] BYREF\n\n  if ( *((_BYTE *)this + 232) && *((_BYTE *)this + 233) && *((_BYTE *)this + 234) )\n  {\n    a3->size.width = a3->size.width + 1.0;\n    a3->size.height = a3->size.height + 1.0;\n  }\n  if ( a2[3] > 0xFu )\n    a2 = (_QWORD *)*a2;\n  ((void (__fastcall *)(cocos2d::CCEGLView *, _QWORD *))this->setViewName)(this, a2);\n  *((float *)this + 48) = a4;\n  sub_1800D4D00(131075, 1);\n  sub_1800D4D00(135181, 0);\n  sub_1800D4D00(135184, 1);\n  v6 = kmVec2Fill((float *)&v15.origin, a3->size.width, a3->size.height);\n  cocos2d::CCSize::operator=((_DWORD *)this + 54, v6);\n  v7 = cocos2d::CCRect::CCRect(&v15, a3);\n  cocos2d::CCEGLView::setupWindow(this, v7);\n  ((void (__fastcall *)(cocos2d::CCEGLView *))this->setFrameSize)(this);\n  String = (const char *)glGetString(0x1F02u);\n  if ( atof(String) >= 1.5 )\n  {\n    cocos2d::CCEGLView::initGlew(this);\n    glEnable(0x8642u);\n    if ( !*((_QWORD *)this + 26) )\n    {\n      v11 = *((_QWORD *)this + 25);\n      v12 = (int)*((float *)this + 55);\n      LODWORD(v15.origin.x) = (int)*((float *)this + 54);\n      v14 = v12;\n      sub_1800D4AD0(v11);\n      sub_1800D4A20(*((_QWORD *)this + 25), &v15, &v14);\n      cocos2d::CCEGLViewProtocol::setFrameSize(this, (float)SLODWORD(v15.origin.x), (float)v14);\n      sub_1800D44D0(*((_QWORD *)this + 25));\n    }\n    if ( *((_BYTE *)this + 232) && *((_BYTE *)this + 233) )\n    {\n      if ( *((_BYTE *)this + 234) )\n      {\n        v13 = (HWND)sub_1800D8320(*((_QWORD *)this + 25));\n        SetWindowPos(v13, HWND_MESSAGE|0x2LL, 0, 0, 0, 0, 0x53u);\n      }\n    }\n    return 1;\n  }\n  else\n  {\n    memset(Buffer, 0, sizeof(Buffer));\n    sub_180009530(\n      Buffer,\n      \"OpenGL 1.5 or higher is required (your version is %s). Please upgrade the driver of your video card.\",\n      String);\n    v9 = (HWND)sub_1800D8320(*((_QWORD *)this + 25));\n    MessageBoxW(v9, L\"OpenGL 1.5 or higher is required\", L\"OpenGL version too old\", 0);\n    return 0;\n  }\n}", "assembly": "; \n; cocos2d::CCEGLView::initWithRect from 0x180077280 to 0x1800774ec (620 bytes)\n; \n; 7 xrefs:\n; > cocos2d::CCEGLView::create @ 0x18007683c\n; > cocos2d::CCEGLView::createWithFullScreen @ 0x180076a07\n; > cocos2d::CCEGLView::createWithRect @ 0x180076a9e\n; > cocos2d::CCEGLView::initWithFullScreen @ 0x180077161\n; > cocos2d::CCEGLView::initWithFullscreen @ 0x180077265\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b4950\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, 0x180077280\npush    rsi                                                            ; +0x2, 0x180077282\npush    rdi                                                            ; +0x3, 0x180077283\nsub     rsp, 180h                                                      ; +0x4, 0x180077284\nmovaps  [rsp+198h+var_28], xmm6                                        ; +0xb, 0x18007728b\nmov     rax, cs:__security_cookie                                      ; +0x13, 0x180077293\nxor     rax, rsp                                                       ; +0x1a, 0x18007729a\nmov     [rsp+198h+var_38], rax                                         ; +0x1d, 0x18007729d\ncmp     byte ptr [rcx+0E8h], 0                                         ; +0x25, 0x1800772a5\nmovaps  xmm6, xmm3                                                     ; +0x2c, 0x1800772ac\nmov     rdi, r8                                                        ; +0x2f, 0x1800772af\nmov     rbx, rcx                                                       ; +0x32, 0x1800772b2\njz      short loc_1800772F1                                            ; +0x35, 0x1800772b5\ncmp     byte ptr [rcx+0E9h], 0                                         ; +0x37, 0x1800772b7\njz      short loc_1800772F1                                            ; +0x3e, 0x1800772be\ncmp     byte ptr [rcx+0EAh], 0                                         ; +0x40, 0x1800772c0\njz      short loc_1800772F1                                            ; +0x47, 0x1800772c7\nmovss   xmm0, dword ptr [r8+8]                                         ; +0x49, 0x1800772c9\naddss   xmm0, cs:flt_1800E61A8                                         ; +0x4f, 0x1800772cf\nmovss   dword ptr [r8+8], xmm0                                         ; +0x57, 0x1800772d7\nmovss   xmm0, dword ptr [r8+0Ch]                                       ; +0x5d, 0x1800772dd\naddss   xmm0, cs:flt_1800E61A8                                         ; +0x63, 0x1800772e3\nmovss   dword ptr [r8+0Ch], xmm0                                       ; +0x6b, 0x1800772eb\ncmp     qword ptr [rdx+18h], 0Fh                                       ; +0x71, 0x1800772f1\njbe     short loc_1800772FB                                            ; +0x76, 0x1800772f6\nmov     rdx, [rdx]                                                     ; +0x78, 0x1800772f8\nmov     rax, [rcx]                                                     ; +0x7b, 0x1800772fb\ncall    qword ptr [rax+80h]                                            ; +0x7e, 0x1800772fe\nmov     edx, 1                                                         ; +0x84, 0x180077304\nmovss   dword ptr [rbx+0C0h], xmm6                                     ; +0x89, 0x180077309\nmov     ecx, 20003h                                                    ; +0x91, 0x180077311\ncall    sub_1800D4D00                                                  ; +0x96, 0x180077316\nxor     edx, edx                                                       ; +0x9b, 0x18007731b\nmov     ecx, 2100Dh                                                    ; +0x9d, 0x18007731d\ncall    sub_1800D4D00                                                  ; +0xa2, 0x180077322\nmov     edx, 1                                                         ; +0xa7, 0x180077327\nmov     ecx, 21010h                                                    ; +0xac, 0x18007732c\ncall    sub_1800D4D00                                                  ; +0xb1, 0x180077331\nmovss   xmm2, dword ptr [rdi+0Ch]                                      ; +0xb6, 0x180077336\nlea     rcx, [rsp+198h+var_150]                                        ; +0xbb, 0x18007733b\nmovss   xmm1, dword ptr [rdi+8]                                        ; +0xc0, 0x180077340\ncall    kmVec2Fill                                                     ; +0xc5, 0x180077345\nmov     rdx, rax                                                       ; +0xca, 0x18007734a\nlea     rcx, [rbx+0D8h]                                                ; +0xcd, 0x18007734d\ncall    ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0xd4, 0x180077354\nmov     rdx, rdi; struct cocos2d::CCRect *                             ; +0xd9, 0x180077359\nlea     rcx, [rsp+198h+var_150]; this                                  ; +0xdc, 0x18007735c\ncall    ??0CCRect@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCRect::CCRect(cocos2d::CCRect const &) ; +0xe1, 0x180077361\nmov     rdx, rax                                                       ; +0xe6, 0x180077366\nmov     rcx, rbx                                                       ; +0xe9, 0x180077369\ncall    ?setupWindow@CCEGLView@cocos2d@@IEAAXVCCRect@2@@Z; cocos2d::CCEGLView::setupWindow(cocos2d::CCRect) ; +0xec, 0x18007736c\nmov     rax, [rbx]                                                     ; +0xf1, 0x180077371\nmov     rcx, rbx                                                       ; +0xf4, 0x180077374\nmovss   xmm2, dword ptr [rdi+0Ch]                                      ; +0xf7, 0x180077377\nmovss   xmm1, dword ptr [rdi+8]                                        ; +0xfc, 0x18007737c\ncall    qword ptr [rax+30h]                                            ; +0x101, 0x180077381\nmov     ecx, 1F02h; name                                               ; +0x104, 0x180077384\ncall    cs:glGetString                                                 ; +0x109, 0x180077389\nmov     rcx, rax; String                                               ; +0x10f, 0x18007738f\nmov     rdi, rax                                                       ; +0x112, 0x180077392\ncall    cs:atof                                                        ; +0x115, 0x180077395\nmovsd   xmm1, cs:qword_180101040                                       ; +0x11b, 0x18007739b\ncomisd  xmm1, xmm0                                                     ; +0x123, 0x1800773a3\njbe     short loc_1800773FC                                            ; +0x127, 0x1800773a7\nxor     edx, edx; Val                                                  ; +0x129, 0x1800773a9\nlea     rcx, [rsp+198h+Buffer]; void *                                 ; +0x12b, 0x1800773ab\nmov     r8d, 100h; Size                                                ; +0x130, 0x1800773b0\ncall    memset                                                         ; +0x136, 0x1800773b6\nmov     r8, rdi                                                        ; +0x13b, 0x1800773bb\nlea     rdx, aOpengl15OrHigh; \"OpenGL 1.5 or higher is required (your \"... ; +0x13e, 0x1800773be\nlea     rcx, [rsp+198h+Buffer]; Buffer                                 ; +0x145, 0x1800773c5\ncall    sub_180009530                                                  ; +0x14a, 0x1800773ca\nmov     rcx, [rbx+0C8h]                                                ; +0x14f, 0x1800773cf\ncall    sub_1800D8320                                                  ; +0x156, 0x1800773d6\nmov     rcx, rax; hWnd                                                 ; +0x15b, 0x1800773db\nlea     r8, aOpenglVersionT; \"OpenGL version too old\"                  ; +0x15e, 0x1800773de\nxor     r9d, r9d; uType                                                ; +0x165, 0x1800773e5\nlea     rdx, aOpengl15OrHigh_0; \"OpenGL 1.5 or higher is required\"     ; +0x168, 0x1800773e8\ncall    cs:MessageBoxW                                                 ; +0x16f, 0x1800773ef\nxor     al, al                                                         ; +0x175, 0x1800773f5\njmp     loc_1800774C9                                                  ; +0x177, 0x1800773f7\nmov     rcx, rbx; this                                                 ; +0x17c, 0x1800773fc\ncall    ?initGlew@CCEGLView@cocos2d@@IEAA_NXZ; cocos2d::CCEGLView::initGlew(void) ; +0x17f, 0x1800773ff\nmov     ecx, 8642h; cap                                                ; +0x184, 0x180077404\ncall    cs:glEnable                                                    ; +0x189, 0x180077409\ncmp     qword ptr [rbx+0D0h], 0                                        ; +0x18f, 0x18007740f\njnz     short loc_18007747B                                            ; +0x197, 0x180077417\ncvttss2si edx, dword ptr [rbx+0D8h]                                    ; +0x199, 0x180077419\nmov     rcx, [rbx+0C8h]                                                ; +0x1a1, 0x180077421\ncvttss2si r8d, dword ptr [rbx+0DCh]                                    ; +0x1a8, 0x180077428\nmov     [rsp+198h+var_150.origin.x], edx                               ; +0x1b1, 0x180077431\nmov     [rsp+198h+var_158], r8d                                        ; +0x1b5, 0x180077435\ncall    sub_1800D4AD0                                                  ; +0x1ba, 0x18007743a\nmov     rcx, [rbx+0C8h]                                                ; +0x1bf, 0x18007743f\nlea     r8, [rsp+198h+var_158]                                         ; +0x1c6, 0x180077446\nlea     rdx, [rsp+198h+var_150]                                        ; +0x1cb, 0x18007744b\ncall    sub_1800D4A20                                                  ; +0x1d0, 0x180077450\nmovd    xmm2, [rsp+198h+var_158]                                       ; +0x1d5, 0x180077455\nmov     rcx, rbx; this                                                 ; +0x1db, 0x18007745b\nmovd    xmm1, [rsp+198h+var_150.origin.x]                              ; +0x1de, 0x18007745e\ncvtdq2ps xmm2, xmm2; float                                             ; +0x1e4, 0x180077464\ncvtdq2ps xmm1, xmm1; float                                             ; +0x1e7, 0x180077467\ncall    ?setFrameSize@CCEGLViewProtocol@cocos2d@@UEAAXMM@Z; cocos2d::CCEGLViewProtocol::setFrameSize(float,float) ; +0x1ea, 0x18007746a\nmov     rcx, [rbx+0C8h]                                                ; +0x1ef, 0x18007746f\ncall    sub_1800D44D0                                                  ; +0x1f6, 0x180077476\ncmp     byte ptr [rbx+0E8h], 0                                         ; +0x1fb, 0x18007747b\njz      short loc_1800774C7                                            ; +0x202, 0x180077482\ncmp     byte ptr [rbx+0E9h], 0                                         ; +0x204, 0x180077484\njz      short loc_1800774C7                                            ; +0x20b, 0x18007748b\ncmp     byte ptr [rbx+0EAh], 0                                         ; +0x20d, 0x18007748d\njz      short loc_1800774C7                                            ; +0x214, 0x180077494\nmov     rcx, [rbx+0C8h]                                                ; +0x216, 0x180077496\ncall    sub_1800D8320                                                  ; +0x21d, 0x18007749d\nxor     ecx, ecx                                                       ; +0x222, 0x1800774a2\nmov     [rsp+198h+uFlags], 53h ; 'S'; uFlags                           ; +0x224, 0x1800774a4\nmov     [rsp+198h+cy], ecx; cy                                         ; +0x22c, 0x1800774ac\nxor     r9d, r9d; Y                                                    ; +0x230, 0x1800774b0\nmov     [rsp+198h+var_178], ecx; cx                                    ; +0x233, 0x1800774b3\nxor     r8d, r8d; X                                                    ; +0x237, 0x1800774b7\nlea     rdx, [rcx-1]; hWndInsertAfter                                  ; +0x23a, 0x1800774ba\nmov     rcx, rax; hWnd                                                 ; +0x23e, 0x1800774be\ncall    cs:SetWindowPos                                                ; +0x241, 0x1800774c1\nmov     al, 1                                                          ; +0x247, 0x1800774c7\nmov     rcx, [rsp+198h+var_38]                                         ; +0x249, 0x1800774c9\nxor     rcx, rsp; StackCookie                                          ; +0x251, 0x1800774d1\ncall    __security_check_cookie                                        ; +0x254, 0x1800774d4\nmovaps  xmm6, [rsp+198h+var_28]                                        ; +0x259, 0x1800774d9\nadd     rsp, 180h                                                      ; +0x261, 0x1800774e1\npop     rdi                                                            ; +0x268, 0x1800774e8\npop     rsi                                                            ; +0x269, 0x1800774e9\npop     rbx                                                            ; +0x26a, 0x1800774ea\nretn                                                                   ; +0x26b, 0x1800774eb", "xrefs": ["cocos2d::CCEGLView::create @ 0x18007683c", "cocos2d::CCEGLView::createWithFullScreen @ 0x180076a07", "cocos2d::CCEGLView::createWithRect @ 0x180076a9e", "cocos2d::CCEGLView::initWithFullScreen @ 0x180077161", "cocos2d::CCEGLView::initWithFullscreen @ 0x180077265", "<???> @ 0x1801438a8", "<???> @ 0x1801b4950"], "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"}