{"type": "func", "start": 6442888528, "end": 6442888935, "name": "cocos2d::CCParticleSystemQuad::setTotalParticles", "pseudocode": "// \n// cocos2d::CCParticleSystemQuad::setTotalParticles from 0x18006ad50 to 0x18006aee7 (407 bytes)\n// \n// 14 xrefs:\n// > <???> @ 0x1800facc8\n// > <???> @ 0x1800fb338\n// > <???> @ 0x1800fb9a8\n// > <???> @ 0x1800fc018\n// > <???> @ 0x1800fc688\n// > <???> @ 0x1800fccf8\n// > <???> @ 0x1800fd368\n// > <???> @ 0x1800fd9d8\n// > <???> @ 0x1800fe048\n// > <???> @ 0x1800fe6b8\n// > <???> @ 0x1800fed28\n// > <???> @ 0x180100010\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b3d80\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\nvoid __fastcall cocos2d::CCParticleSystemQuad::setTotalParticles(cocos2d::CCParticleSystemQuad *this, unsigned int a2)\n{\n  __int64 v3; // rdi\n  cocos2d::tCCParticle *v4; // rbp\n  cocos2d::ccV3F_C4B_T2F_Quad *v5; // rsi\n  GLushort *v6; // rax\n  bool v7; // zf\n  unsigned int v8; // edx\n\n  v3 = a2;\n  if ( a2 <= this->m_uAllocatedParticles )\n  {\n    this->m_uTotalParticles = a2;\nLABEL_16:\n    cocos2d::CCParticleSystem::resetSystem(this);\n    return;\n  }\n  v4 = (cocos2d::tCCParticle *)realloc(this->m_pParticles, 148LL * a2);\n  v5 = (cocos2d::ccV3F_C4B_T2F_Quad *)realloc(this->m_pQuads, 96 * v3);\n  v6 = (GLushort *)realloc(this->m_pIndices, 12 * v3);\n  if ( v4 )\n  {\n    if ( v5 && v6 )\n    {\n      this->m_pParticles = v4;\n      this->m_pQuads = v5;\n      this->m_pIndices = v6;\n      memset(v4, 0, 148 * v3);\n      memset(this->m_pQuads, 0, 96 * v3);\n      memset(this->m_pIndices, 0, 12 * v3);\n      v7 = this->m_pBatchNode == nullptr;\n      this->m_uAllocatedParticles = v3;\n      this->m_uTotalParticles = v3;\n      if ( !v7 )\n      {\n        v8 = 0;\n        if ( (_DWORD)v3 )\n        {\n          do\n          {\n            *((_DWORD *)&this->m_pParticles->cocos2d::CCParticleSystem::modeA.dir.x + 37 * v8) = v8;\n            ++v8;\n          }\n          while ( v8 < this->m_uTotalParticles );\n        }\n      }\n      cocos2d::CCParticleSystemQuad::initIndices(this);\n      cocos2d::CCParticleSystemQuad::setupVBO(this);\n      if ( this->m_pTexture )\n        cocos2d::CCParticleSystemQuad::initTexCoordsWithRect(this, &this->m_tTextureRect);\n      goto LABEL_16;\n    }\n    this->m_pParticles = v4;\n  }\n  if ( v5 )\n    this->m_pQuads = v5;\n  if ( v6 )\n    this->m_pIndices = v6;\n}", "assembly": "; \n; cocos2d::CCParticleSystemQuad::setTotalParticles from 0x18006ad50 to 0x18006aee7 (407 bytes)\n; \n; 14 xrefs:\n; > <???> @ 0x1800facc8\n; > <???> @ 0x1800fb338\n; > <???> @ 0x1800fb9a8\n; > <???> @ 0x1800fc018\n; > <???> @ 0x1800fc688\n; > <???> @ 0x1800fccf8\n; > <???> @ 0x1800fd368\n; > <???> @ 0x1800fd9d8\n; > <???> @ 0x1800fe048\n; > <???> @ 0x1800fe6b8\n; > <???> @ 0x1800fed28\n; > <???> @ 0x180100010\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b3d80\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, 0x18006ad50\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x18006ad55\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x18006ad5a\nmov     [rsp+arg_18], rdi                                              ; +0xf, 0x18006ad5f\npush    r12                                                            ; +0x14, 0x18006ad64\npush    r14                                                            ; +0x16, 0x18006ad66\npush    r15                                                            ; +0x18, 0x18006ad68\nsub     rsp, 20h                                                       ; +0x1a, 0x18006ad6a\nmov     rbx, rcx                                                       ; +0x1e, 0x18006ad6e\nmov     edi, edx                                                       ; +0x21, 0x18006ad71\ncmp     edx, [rcx+1C8h]                                                ; +0x23, 0x18006ad73\njbe     loc_18006AEBA                                                  ; +0x29, 0x18006ad79\nmov     rcx, [rcx+1A8h]; Block                                         ; +0x2f, 0x18006ad7f\nlea     r14, [rdi+rdi*2]                                               ; +0x36, 0x18006ad86\nimul    r12, rdi, 94h                                                  ; +0x3a, 0x18006ad8a\nlea     r15, [rdi+rdi*2]                                               ; +0x41, 0x18006ad91\nshl     r14, 5                                                         ; +0x45, 0x18006ad95\nmov     rdx, r12; Size                                                 ; +0x49, 0x18006ad99\nshl     r15, 2                                                         ; +0x4c, 0x18006ad9c\ncall    cs:realloc                                                     ; +0x50, 0x18006ada0\nmov     rcx, [rbx+318h]; Block                                         ; +0x56, 0x18006ada6\nmov     rdx, r14; Size                                                 ; +0x5d, 0x18006adad\nmov     rbp, rax                                                       ; +0x60, 0x18006adb0\ncall    cs:realloc                                                     ; +0x63, 0x18006adb3\nmov     rcx, [rbx+320h]; Block                                         ; +0x69, 0x18006adb9\nmov     rdx, r15; Size                                                 ; +0x70, 0x18006adc0\nmov     rsi, rax                                                       ; +0x73, 0x18006adc3\ncall    cs:realloc                                                     ; +0x76, 0x18006adc6\ntest    rbp, rbp                                                       ; +0x7c, 0x18006adcc\njz      loc_18006AEA0                                                  ; +0x7f, 0x18006adcf\ntest    rsi, rsi                                                       ; +0x85, 0x18006add5\njz      loc_18006AE99                                                  ; +0x88, 0x18006add8\ntest    rax, rax                                                       ; +0x8e, 0x18006adde\njz      loc_18006AE99                                                  ; +0x91, 0x18006ade1\nmov     r8, r12; Size                                                  ; +0x97, 0x18006ade7\nmov     [rbx+1A8h], rbp                                                ; +0x9a, 0x18006adea\nxor     edx, edx; Val                                                  ; +0xa1, 0x18006adf1\nmov     [rbx+318h], rsi                                                ; +0xa3, 0x18006adf3\nmov     rcx, rbp; void *                                               ; +0xaa, 0x18006adfa\nmov     [rbx+320h], rax                                                ; +0xad, 0x18006adfd\ncall    memset                                                         ; +0xb4, 0x18006ae04\nmov     rcx, [rbx+318h]; void *                                        ; +0xb9, 0x18006ae09\nmov     r8, r14; Size                                                  ; +0xc0, 0x18006ae10\nxor     edx, edx; Val                                                  ; +0xc3, 0x18006ae13\ncall    memset                                                         ; +0xc5, 0x18006ae15\nmov     rcx, [rbx+320h]; void *                                        ; +0xca, 0x18006ae1a\nmov     r8, r15; Size                                                  ; +0xd1, 0x18006ae21\nxor     edx, edx; Val                                                  ; +0xd4, 0x18006ae24\ncall    memset                                                         ; +0xd6, 0x18006ae26\ncmp     qword ptr [rbx+1B8h], 0                                        ; +0xdb, 0x18006ae2b\nmov     [rbx+1C8h], edi                                                ; +0xe3, 0x18006ae33\nmov     [rbx+298h], edi                                                ; +0xe9, 0x18006ae39\njz      short loc_18006AE6E                                            ; +0xef, 0x18006ae3f\nxor     edx, edx                                                       ; +0xf1, 0x18006ae41\ntest    edi, edi                                                       ; +0xf3, 0x18006ae43\njz      short loc_18006AE6E                                            ; +0xf5, 0x18006ae45\nnop     word ptr [rax+rax+00000000h]                                   ; +0xf7, 0x18006ae47\nmov     eax, edx                                                       ; +0x100, 0x18006ae50\nimul    rcx, rax, 94h                                                  ; +0x102, 0x18006ae52\nmov     rax, [rbx+1A8h]                                                ; +0x109, 0x18006ae59\nmov     [rcx+rax+48h], edx                                             ; +0x110, 0x18006ae60\ninc     edx                                                            ; +0x114, 0x18006ae64\ncmp     edx, [rbx+298h]                                                ; +0x116, 0x18006ae66\njb      short loc_18006AE50                                            ; +0x11c, 0x18006ae6c\nmov     rcx, rbx; this                                                 ; +0x11e, 0x18006ae6e\ncall    ?initIndices@CCParticleSystemQuad@cocos2d@@QEAAXXZ; cocos2d::CCParticleSystemQuad::initIndices(void) ; +0x121, 0x18006ae71\nmov     rcx, rbx; this                                                 ; +0x126, 0x18006ae76\ncall    ?setupVBO@CCParticleSystemQuad@cocos2d@@AEAAXXZ; cocos2d::CCParticleSystemQuad::setupVBO(void) ; +0x129, 0x18006ae79\ncmp     qword ptr [rbx+2A0h], 0                                        ; +0x12e, 0x18006ae7e\njz      short loc_18006AEC0                                            ; +0x136, 0x18006ae86\nlea     rdx, [rbx+330h]; struct cocos2d::CCRect *                      ; +0x138, 0x18006ae88\nmov     rcx, rbx; this                                                 ; +0x13f, 0x18006ae8f\ncall    ?initTexCoordsWithRect@CCParticleSystemQuad@cocos2d@@QEAAXAEBVCCRect@2@@Z; cocos2d::CCParticleSystemQuad::initTexCoordsWithRect(cocos2d::CCRect const &) ; +0x142, 0x18006ae92\njmp     short loc_18006AEC0                                            ; +0x147, 0x18006ae97\nmov     [rbx+1A8h], rbp                                                ; +0x149, 0x18006ae99\ntest    rsi, rsi                                                       ; +0x150, 0x18006aea0\njz      short loc_18006AEAC                                            ; +0x153, 0x18006aea3\nmov     [rbx+318h], rsi                                                ; +0x155, 0x18006aea5\ntest    rax, rax                                                       ; +0x15c, 0x18006aeac\njz      short loc_18006AEC8                                            ; +0x15f, 0x18006aeaf\nmov     [rbx+320h], rax                                                ; +0x161, 0x18006aeb1\njmp     short loc_18006AEC8                                            ; +0x168, 0x18006aeb8\nmov     [rcx+298h], edi                                                ; +0x16a, 0x18006aeba\nmov     rcx, rbx; this                                                 ; +0x170, 0x18006aec0\ncall    ?resetSystem@CCParticleSystem@cocos2d@@QEAAXXZ; cocos2d::CCParticleSystem::resetSystem(void) ; +0x173, 0x18006aec3\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x178, 0x18006aec8\nmov     rbp, [rsp+38h+arg_8]                                           ; +0x17d, 0x18006aecd\nmov     rsi, [rsp+38h+arg_10]                                          ; +0x182, 0x18006aed2\nmov     rdi, [rsp+38h+arg_18]                                          ; +0x187, 0x18006aed7\nadd     rsp, 20h                                                       ; +0x18c, 0x18006aedc\npop     r15                                                            ; +0x190, 0x18006aee0\npop     r14                                                            ; +0x192, 0x18006aee2\npop     r12                                                            ; +0x194, 0x18006aee4\nretn                                                                   ; +0x196, 0x18006aee6", "xrefs": ["<???> @ 0x1800facc8", "<???> @ 0x1800fb338", "<???> @ 0x1800fb9a8", "<???> @ 0x1800fc018", "<???> @ 0x1800fc688", "<???> @ 0x1800fccf8", "<???> @ 0x1800fd368", "<???> @ 0x1800fd9d8", "<???> @ 0x1800fe048", "<???> @ 0x1800fe6b8", "<???> @ 0x1800fed28", "<???> @ 0x180100010", "<???> @ 0x1801438a8", "<???> @ 0x1801b3d80"], "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"}