{"type": "func", "start": 6442885984, "end": 6442886235, "name": "cocos2d::CCParticleSystemQuad::allocMemory", "pseudocode": "// \n// cocos2d::CCParticleSystemQuad::allocMemory from 0x18006a360 to 0x18006a45b (251 bytes)\n// \n// 4 xrefs:\n// > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x18006aa25\n// > cocos2d::CCParticleSystemQuad::setBatchNode @ 0x18006ab27\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b3c9c\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::CCParticleSystemQuad::allocMemory(cocos2d::CCParticleSystemQuad *this)\n{\n  cocos2d::ccV3F_C4B_T2F_Quad *m_pQuads; // rcx\n  GLushort *m_pIndices; // rcx\n  GLushort *v4; // rax\n  cocos2d::ccV3F_C4B_T2F_Quad *v5; // rcx\n  GLushort *v7; // rcx\n\n  m_pQuads = this->m_pQuads;\n  if ( m_pQuads )\n  {\n    free(m_pQuads);\n    this->m_pQuads = nullptr;\n  }\n  m_pIndices = this->m_pIndices;\n  if ( m_pIndices )\n  {\n    free(m_pIndices);\n    this->m_pIndices = nullptr;\n  }\n  this->m_pQuads = (cocos2d::ccV3F_C4B_T2F_Quad *)malloc(96LL * this->m_uTotalParticles);\n  v4 = (GLushort *)malloc(12LL * this->m_uTotalParticles);\n  v5 = this->m_pQuads;\n  this->m_pIndices = v4;\n  if ( v5 )\n  {\n    if ( v4 )\n    {\n      memset(v5, 0, 96LL * this->m_uTotalParticles);\n      memset(this->m_pIndices, 0, 12LL * this->m_uTotalParticles);\n      return 1;\n    }\n    free(v5);\n    this->m_pQuads = nullptr;\n  }\n  v7 = this->m_pIndices;\n  if ( v7 )\n  {\n    free(v7);\n    this->m_pIndices = nullptr;\n  }\n  return 0;\n}", "assembly": "; \n; cocos2d::CCParticleSystemQuad::allocMemory from 0x18006a360 to 0x18006a45b (251 bytes)\n; \n; 4 xrefs:\n; > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x18006aa25\n; > cocos2d::CCParticleSystemQuad::setBatchNode @ 0x18006ab27\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b3c9c\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, 0x18006a360\npush    rdi                                                            ; +0x5, 0x18006a365\nsub     rsp, 20h                                                       ; +0x6, 0x18006a366\nmov     rbx, rcx                                                       ; +0xa, 0x18006a36a\nxor     edi, edi                                                       ; +0xd, 0x18006a36d\nmov     rcx, [rcx+318h]; Block                                         ; +0xf, 0x18006a36f\ntest    rcx, rcx                                                       ; +0x16, 0x18006a376\njz      short loc_18006A388                                            ; +0x19, 0x18006a379\ncall    cs:__imp_free                                                  ; +0x1b, 0x18006a37b\nmov     [rbx+318h], rdi                                                ; +0x21, 0x18006a381\nmov     rcx, [rbx+320h]; Block                                         ; +0x28, 0x18006a388\ntest    rcx, rcx                                                       ; +0x2f, 0x18006a38f\njz      short loc_18006A3A1                                            ; +0x32, 0x18006a392\ncall    cs:__imp_free                                                  ; +0x34, 0x18006a394\nmov     [rbx+320h], rdi                                                ; +0x3a, 0x18006a39a\nmov     eax, [rbx+298h]                                                ; +0x41, 0x18006a3a1\nlea     rcx, [rax+rax*2]                                               ; +0x47, 0x18006a3a7\nshl     rcx, 5; Size                                                   ; +0x4b, 0x18006a3ab\ncall    cs:__imp_malloc                                                ; +0x4f, 0x18006a3af\nmov     [rbx+318h], rax                                                ; +0x55, 0x18006a3b5\nmov     eax, [rbx+298h]                                                ; +0x5c, 0x18006a3bc\nlea     ecx, [rax+rax*2]                                               ; +0x62, 0x18006a3c2\nadd     ecx, ecx                                                       ; +0x65, 0x18006a3c5\nadd     rcx, rcx; Size                                                 ; +0x67, 0x18006a3c7\ncall    cs:__imp_malloc                                                ; +0x6a, 0x18006a3ca\nmov     rcx, [rbx+318h]; void *                                        ; +0x70, 0x18006a3d0\nmov     [rbx+320h], rax                                                ; +0x77, 0x18006a3d7\ntest    rcx, rcx                                                       ; +0x7e, 0x18006a3de\njz      short loc_18006A435                                            ; +0x81, 0x18006a3e1\ntest    rax, rax                                                       ; +0x83, 0x18006a3e3\njz      short loc_18006A428                                            ; +0x86, 0x18006a3e6\nmov     eax, [rbx+298h]                                                ; +0x88, 0x18006a3e8\nxor     edx, edx; Val                                                  ; +0x8e, 0x18006a3ee\nlea     r8, [rax+rax*2]                                                ; +0x90, 0x18006a3f0\nshl     r8, 5; Size                                                    ; +0x94, 0x18006a3f4\ncall    memset                                                         ; +0x98, 0x18006a3f8\nmov     eax, [rbx+298h]                                                ; +0x9d, 0x18006a3fd\nxor     edx, edx; Val                                                  ; +0xa3, 0x18006a403\nlea     ecx, [rax+rax*2]                                               ; +0xa5, 0x18006a405\nlea     r8d, [rcx+rcx]                                                 ; +0xa8, 0x18006a408\nmov     rcx, [rbx+320h]; void *                                        ; +0xac, 0x18006a40c\nadd     r8, r8; Size                                                   ; +0xb3, 0x18006a413\ncall    memset                                                         ; +0xb6, 0x18006a416\nmov     al, 1                                                          ; +0xbb, 0x18006a41b\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xbd, 0x18006a41d\nadd     rsp, 20h                                                       ; +0xc2, 0x18006a422\npop     rdi                                                            ; +0xc6, 0x18006a426\nretn                                                                   ; +0xc7, 0x18006a427\ncall    cs:__imp_free                                                  ; +0xc8, 0x18006a428\nmov     [rbx+318h], rdi                                                ; +0xce, 0x18006a42e\nmov     rcx, [rbx+320h]; Block                                         ; +0xd5, 0x18006a435\ntest    rcx, rcx                                                       ; +0xdc, 0x18006a43c\njz      short loc_18006A44E                                            ; +0xdf, 0x18006a43f\ncall    cs:__imp_free                                                  ; +0xe1, 0x18006a441\nmov     [rbx+320h], rdi                                                ; +0xe7, 0x18006a447\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xee, 0x18006a44e\nxor     al, al                                                         ; +0xf3, 0x18006a453\nadd     rsp, 20h                                                       ; +0xf5, 0x18006a455\npop     rdi                                                            ; +0xf9, 0x18006a459\nretn                                                                   ; +0xfa, 0x18006a45a", "xrefs": ["cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x18006aa25", "cocos2d::CCParticleSystemQuad::setBatchNode @ 0x18006ab27", "<???> @ 0x1801438a8", "<???> @ 0x1801b3c9c"], "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"}