{"type": "func", "start": 6442537440, "end": 6442537833, "name": "cocos2d::CCDrawNode::init", "pseudocode": "// \n// cocos2d::CCDrawNode::init from 0x1800151e0 to 0x180015369 (393 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x1800ec7a0\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801b8554\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:21:23 +0000\n// \n\nchar __fastcall cocos2d::CCDrawNode::init(cocos2d::CCDrawNode *this)\n{\n  __int64 v1; // rbx\n  cocos2d::CCShaderCache *v3; // rax\n  struct cocos2d::CCGLProgram *v4; // rax\n  int v5; // ecx\n  unsigned int v6; // edx\n  __int64 v7; // rax\n  void *v8; // rcx\n  __int64 v9; // r9\n\n  v1 = *(_QWORD *)this;\n  *((_DWORD *)this + 92) = 1;\n  *((_DWORD *)this + 93) = 771;\n  v3 = cocos2d::CCShaderCache::sharedShaderCache();\n  v4 = cocos2d::CCShaderCache::programForKey(v3, \"ShaderPositionColor\");\n  (*(void (__fastcall **)(cocos2d::CCDrawNode *, struct cocos2d::CCGLProgram *))(v1 + 656))(this, v4);\n  v5 = 512;\n  v6 = *((_DWORD *)this + 88);\n  if ( *((_DWORD *)this + 89) + 512 > v6 )\n  {\n    if ( v6 > 0x200 )\n      v5 = *((_DWORD *)this + 88);\n    v7 = v6 + v5;\n    v8 = *((void **)this + 45);\n    *((_DWORD *)this + 88) = v7;\n    *((_QWORD *)this + 45) = realloc(v8, 20 * v7);\n  }\n  _glewGenBuffers(1, (char *)this + 348);\n  _glewBindBuffer(34962, *((unsigned int *)this + 87));\n  _glewBufferData(34962, 20LL * *((unsigned int *)this + 88), *((_QWORD *)this + 45), 35040);\n  _glewEnableVertexAttribArray(0);\n  _glewVertexAttribPointer(0, 2, 5126, 0, 20, 0);\n  _glewEnableVertexAttribArray(1);\n  LOBYTE(v9) = 1;\n  _glewVertexAttribPointer(1, 4, 5121, v9, 20, 8);\n  _glewBindBuffer(34962, 0);\n  *((_BYTE *)this + 376) = 1;\n  return 1;\n}", "assembly": "; \n; cocos2d::CCDrawNode::init from 0x1800151e0 to 0x180015369 (393 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x1800ec7a0\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801b8554\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:21:23 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1800151e0\npush    rdi                                                            ; +0x5, 0x1800151e5\nsub     rsp, 30h                                                       ; +0x6, 0x1800151e6\nmov     rbx, [rcx]                                                     ; +0xa, 0x1800151ea\nmov     rdi, rcx                                                       ; +0xd, 0x1800151ed\nmov     dword ptr [rcx+170h], 1                                        ; +0x10, 0x1800151f0\nmov     dword ptr [rcx+174h], 303h                                     ; +0x1a, 0x1800151fa\ncall    ?sharedShaderCache@CCShaderCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCShaderCache::sharedShaderCache(void) ; +0x24, 0x180015204\nmov     rcx, rax; this                                                 ; +0x29, 0x180015209\nlea     rdx, aShaderposition_1; \"ShaderPositionColor\"                  ; +0x2c, 0x18001520c\ncall    ?programForKey@CCShaderCache@cocos2d@@QEAAPEAVCCGLProgram@2@PEBD@Z; cocos2d::CCShaderCache::programForKey(char const *) ; +0x33, 0x180015213\nmov     rdx, rax                                                       ; +0x38, 0x180015218\nmov     rcx, rdi                                                       ; +0x3b, 0x18001521b\ncall    qword ptr [rbx+290h]                                           ; +0x3e, 0x18001521e\nmov     eax, [rdi+164h]                                                ; +0x44, 0x180015224\nmov     ecx, 200h                                                      ; +0x4a, 0x18001522a\nmov     edx, [rdi+160h]                                                ; +0x4f, 0x18001522f\nadd     eax, ecx                                                       ; +0x55, 0x180015235\ncmp     eax, edx                                                       ; +0x57, 0x180015237\njbe     short loc_180015265                                            ; +0x59, 0x180015239\ncmp     edx, ecx                                                       ; +0x5b, 0x18001523b\ncmova   ecx, edx                                                       ; +0x5d, 0x18001523d\nlea     eax, [rdx+rcx]                                                 ; +0x60, 0x180015240\nmov     rcx, [rdi+168h]; Block                                         ; +0x63, 0x180015243\nlea     rdx, [rax+rax*4]                                               ; +0x6a, 0x18001524a\nmov     [rdi+160h], eax                                                ; +0x6e, 0x18001524e\nshl     rdx, 2; Size                                                   ; +0x74, 0x180015254\ncall    cs:realloc                                                     ; +0x78, 0x180015258\nmov     [rdi+168h], rax                                                ; +0x7e, 0x18001525e\nmov     rax, cs:__glewGenBuffers                                       ; +0x85, 0x180015265\nlea     rdx, [rdi+15Ch]                                                ; +0x8c, 0x18001526c\nmov     ecx, 1                                                         ; +0x93, 0x180015273\nmov     r8, [rax]                                                      ; +0x98, 0x180015278\ncall    r8                                                             ; +0x9b, 0x18001527b\nmov     rax, cs:__glewBindBuffer                                       ; +0x9e, 0x18001527e\nmov     ecx, 8892h                                                     ; +0xa5, 0x180015285\nmov     edx, [rdi+15Ch]                                                ; +0xaa, 0x18001528a\nmov     r8, [rax]                                                      ; +0xb0, 0x180015290\ncall    r8                                                             ; +0xb3, 0x180015293\nmov     eax, [rdi+160h]                                                ; +0xb6, 0x180015296\nmov     r9d, 88E0h                                                     ; +0xbc, 0x18001529c\nmov     r8, [rdi+168h]                                                 ; +0xc2, 0x1800152a2\nmov     ecx, 8892h                                                     ; +0xc9, 0x1800152a9\nlea     rdx, [rax+rax*4]                                               ; +0xce, 0x1800152ae\nmov     rax, cs:__glewBufferData                                       ; +0xd2, 0x1800152b2\nshl     rdx, 2                                                         ; +0xd9, 0x1800152b9\nmov     r10, [rax]                                                     ; +0xdd, 0x1800152bd\ncall    r10                                                            ; +0xe0, 0x1800152c0\nmov     rax, cs:__glewEnableVertexAttribArray                          ; +0xe3, 0x1800152c3\nxor     ecx, ecx                                                       ; +0xea, 0x1800152ca\nmov     rdx, [rax]                                                     ; +0xec, 0x1800152cc\ncall    rdx                                                            ; +0xef, 0x1800152cf\nmov     rax, cs:__glewVertexAttribPointer                              ; +0xf1, 0x1800152d1\nxor     r9d, r9d                                                       ; +0xf8, 0x1800152d8\nmov     [rsp+38h+var_10], 0                                            ; +0xfb, 0x1800152db\nmov     edx, 2                                                         ; +0x104, 0x1800152e4\nxor     ecx, ecx                                                       ; +0x109, 0x1800152e9\nmov     [rsp+38h+var_18], 14h                                          ; +0x10b, 0x1800152eb\nmov     r8d, 1406h                                                     ; +0x113, 0x1800152f3\nmov     r10, [rax]                                                     ; +0x119, 0x1800152f9\ncall    r10                                                            ; +0x11c, 0x1800152fc\nmov     rax, cs:__glewEnableVertexAttribArray                          ; +0x11f, 0x1800152ff\nmov     ecx, 1                                                         ; +0x126, 0x180015306\nmov     rdx, [rax]                                                     ; +0x12b, 0x18001530b\ncall    rdx                                                            ; +0x12e, 0x18001530e\nmov     rax, cs:__glewVertexAttribPointer                              ; +0x130, 0x180015310\nmov     r9b, 1                                                         ; +0x137, 0x180015317\nmov     [rsp+38h+var_10], 8                                            ; +0x13a, 0x18001531a\nmov     edx, 4                                                         ; +0x143, 0x180015323\nmov     ecx, 1                                                         ; +0x148, 0x180015328\nmov     [rsp+38h+var_18], 14h                                          ; +0x14d, 0x18001532d\nmov     r8d, 1401h                                                     ; +0x155, 0x180015335\nmov     r10, [rax]                                                     ; +0x15b, 0x18001533b\ncall    r10                                                            ; +0x15e, 0x18001533e\nmov     rax, cs:__glewBindBuffer                                       ; +0x161, 0x180015341\nxor     edx, edx                                                       ; +0x168, 0x180015348\nmov     ecx, 8892h                                                     ; +0x16a, 0x18001534a\nmov     r8, [rax]                                                      ; +0x16f, 0x18001534f\ncall    r8                                                             ; +0x172, 0x180015352\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x175, 0x180015355\nmov     al, 1                                                          ; +0x17a, 0x18001535a\nmov     byte ptr [rdi+178h], 1                                         ; +0x17c, 0x18001535c\nadd     rsp, 30h                                                       ; +0x183, 0x180015363\npop     rdi                                                            ; +0x187, 0x180015367\nretn                                                                   ; +0x188, 0x180015368", "xrefs": ["<???> @ 0x1800ec7a0", "<???> @ 0x18014cf68", "<???> @ 0x1801b8554"], "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"}