{"type": "func", "start": 6442537664, "end": 6442538023, "name": "cocos2d::CCDrawNode::init", "pseudocode": "// \n// cocos2d::CCDrawNode::init from 0x1800152c0 to 0x180015427 (359 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x1800e6758\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801ae4a0\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::CCDrawNode::init(cocos2d::CCDrawNode *this)\n{\n  cocos2d::CCDrawNode_vtbl *v1; // rbx\n  cocos2d::CCShaderCache *v3; // rax\n  struct cocos2d::CCGLProgram *v4; // rax\n  unsigned int v5; // ecx\n  unsigned int m_uBufferCapacity; // edx\n  __int64 v7; // rax\n  cocos2d::ccV2F_C4B_T2F *m_pBuffer; // rcx\n\n  v1 = this->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  this->m_sBlendFunc.src = 1;\n  this->m_sBlendFunc.dst = 771;\n  v3 = cocos2d::CCShaderCache::sharedShaderCache();\n  v4 = cocos2d::CCShaderCache::programForKey(v3, \"ShaderPositionColor\");\n  ((void (__fastcall *)(cocos2d::CCDrawNode *, struct cocos2d::CCGLProgram *))v1->setShaderProgram)(this, v4);\n  v5 = 512;\n  m_uBufferCapacity = this->m_uBufferCapacity;\n  if ( this->m_nBufferCount + 512 > m_uBufferCapacity )\n  {\n    if ( m_uBufferCapacity > 0x200 )\n      v5 = this->m_uBufferCapacity;\n    v7 = m_uBufferCapacity + v5;\n    m_pBuffer = this->m_pBuffer;\n    this->m_uBufferCapacity = v7;\n    this->m_pBuffer = (cocos2d::ccV2F_C4B_T2F *)realloc(m_pBuffer, 20 * v7);\n  }\n  _glewGenBuffers(1, &this->m_uVbo);\n  _glewBindBuffer(34962, this->m_uVbo);\n  _glewBufferData(34962, 20LL * this->m_uBufferCapacity, this->m_pBuffer);\n  _glewEnableVertexAttribArray(0);\n  _glewVertexAttribPointer(0, 2, 5126);\n  _glewEnableVertexAttribArray(1);\n  _glewVertexAttribPointer(1, 4, 5121);\n  _glewBindBuffer(34962, 0);\n  this->m_bDirty = 1;\n  return 1;\n}", "assembly": "; \n; cocos2d::CCDrawNode::init from 0x1800152c0 to 0x180015427 (359 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x1800e6758\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801ae4a0\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\nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1800152c0\npush    rdi                                                            ; +0x5, 0x1800152c5\nsub     rsp, 30h                                                       ; +0x6, 0x1800152c6\nmov     rbx, [rcx]                                                     ; +0xa, 0x1800152ca\nmov     rdi, rcx                                                       ; +0xd, 0x1800152cd\nmov     dword ptr [rcx+170h], 1                                        ; +0x10, 0x1800152d0\nmov     dword ptr [rcx+174h], 303h                                     ; +0x1a, 0x1800152da\ncall    ?sharedShaderCache@CCShaderCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCShaderCache::sharedShaderCache(void) ; +0x24, 0x1800152e4\nmov     rcx, rax; this                                                 ; +0x29, 0x1800152e9\nlea     rdx, aShaderposition_1; \"ShaderPositionColor\"                  ; +0x2c, 0x1800152ec\ncall    ?programForKey@CCShaderCache@cocos2d@@QEAAPEAVCCGLProgram@2@PEBD@Z; cocos2d::CCShaderCache::programForKey(char const *) ; +0x33, 0x1800152f3\nmov     rdx, rax                                                       ; +0x38, 0x1800152f8\nmov     rcx, rdi                                                       ; +0x3b, 0x1800152fb\ncall    qword ptr [rbx+280h]                                           ; +0x3e, 0x1800152fe\nmov     eax, [rdi+164h]                                                ; +0x44, 0x180015304\nmov     ecx, 200h                                                      ; +0x4a, 0x18001530a\nmov     edx, [rdi+160h]                                                ; +0x4f, 0x18001530f\nadd     eax, ecx                                                       ; +0x55, 0x180015315\ncmp     eax, edx                                                       ; +0x57, 0x180015317\njbe     short loc_180015345                                            ; +0x59, 0x180015319\ncmp     edx, ecx                                                       ; +0x5b, 0x18001531b\ncmova   ecx, edx                                                       ; +0x5d, 0x18001531d\nlea     eax, [rdx+rcx]                                                 ; +0x60, 0x180015320\nmov     rcx, [rdi+168h]; Block                                         ; +0x63, 0x180015323\nlea     rdx, [rax+rax*4]                                               ; +0x6a, 0x18001532a\nmov     [rdi+160h], eax                                                ; +0x6e, 0x18001532e\nshl     rdx, 2; Size                                                   ; +0x74, 0x180015334\ncall    cs:realloc                                                     ; +0x78, 0x180015338\nmov     [rdi+168h], rax                                                ; +0x7e, 0x18001533e\nmov     rax, cs:__glewGenBuffers                                       ; +0x85, 0x180015345\nlea     rdx, [rdi+15Ch]                                                ; +0x8c, 0x18001534c\nmov     ecx, 1                                                         ; +0x93, 0x180015353\ncall    qword ptr [rax]                                                ; +0x98, 0x180015358\nmov     rax, cs:__glewBindBuffer                                       ; +0x9a, 0x18001535a\nmov     ecx, 8892h                                                     ; +0xa1, 0x180015361\nmov     edx, [rdi+15Ch]                                                ; +0xa6, 0x180015366\ncall    qword ptr [rax]                                                ; +0xac, 0x18001536c\nmov     eax, [rdi+160h]                                                ; +0xae, 0x18001536e\nmov     r9d, 88E0h                                                     ; +0xb4, 0x180015374\nmov     r8, [rdi+168h]                                                 ; +0xba, 0x18001537a\nlea     rdx, [rax+rax*4]                                               ; +0xc1, 0x180015381\nmov     rax, cs:__glewBufferData                                       ; +0xc5, 0x180015385\nshl     rdx, 2                                                         ; +0xcc, 0x18001538c\nlea     ecx, [r9-4Eh]                                                  ; +0xd0, 0x180015390\ncall    qword ptr [rax]                                                ; +0xd4, 0x180015394\nmov     rax, cs:__glewEnableVertexAttribArray                          ; +0xd6, 0x180015396\nxor     ecx, ecx                                                       ; +0xdd, 0x18001539d\ncall    qword ptr [rax]                                                ; +0xdf, 0x18001539f\nmov     rax, cs:__glewVertexAttribPointer                              ; +0xe1, 0x1800153a1\nxor     r9d, r9d                                                       ; +0xe8, 0x1800153a8\nmov     [rsp+38h+var_10], 0                                            ; +0xeb, 0x1800153ab\nxor     ecx, ecx                                                       ; +0xf4, 0x1800153b4\nmov     r8d, 1406h                                                     ; +0xf6, 0x1800153b6\nmov     [rsp+38h+var_18], 14h                                          ; +0xfc, 0x1800153bc\nlea     edx, [r9+2]                                                    ; +0x104, 0x1800153c4\ncall    qword ptr [rax]                                                ; +0x108, 0x1800153c8\nmov     rax, cs:__glewEnableVertexAttribArray                          ; +0x10a, 0x1800153ca\nmov     ecx, 1                                                         ; +0x111, 0x1800153d1\ncall    qword ptr [rax]                                                ; +0x116, 0x1800153d6\nmov     rax, cs:__glewVertexAttribPointer                              ; +0x118, 0x1800153d8\nmov     edx, 4                                                         ; +0x11f, 0x1800153df\nmov     [rsp+38h+var_10], 8                                            ; +0x124, 0x1800153e4\nmov     r9b, 1                                                         ; +0x12d, 0x1800153ed\nmov     r8d, 1401h                                                     ; +0x130, 0x1800153f0\nmov     [rsp+38h+var_18], 14h                                          ; +0x136, 0x1800153f6\nlea     ecx, [rdx-3]                                                   ; +0x13e, 0x1800153fe\ncall    qword ptr [rax]                                                ; +0x141, 0x180015401\nmov     rax, cs:__glewBindBuffer                                       ; +0x143, 0x180015403\nxor     edx, edx                                                       ; +0x14a, 0x18001540a\nmov     ecx, 8892h                                                     ; +0x14c, 0x18001540c\ncall    qword ptr [rax]                                                ; +0x151, 0x180015411\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x153, 0x180015413\nmov     al, 1                                                          ; +0x158, 0x180015418\nmov     byte ptr [rdi+178h], 1                                         ; +0x15a, 0x18001541a\nadd     rsp, 30h                                                       ; +0x161, 0x180015421\npop     rdi                                                            ; +0x165, 0x180015425\nretn                                                                   ; +0x166, 0x180015426", "xrefs": ["<???> @ 0x1800e6758", "<???> @ 0x1801438a8", "<???> @ 0x1801ae4a0"], "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"}