{"type": "func", "start": 6442879952, "end": 6442880230, "name": "cocos2d::CCParticleSystem::initWithTotalParticles", "pseudocode": "// \n// cocos2d::CCParticleSystem::initWithTotalParticles from 0x180068bd0 to 0x180068ce6 (278 bytes)\n// \n// 4 xrefs:\n// > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x18006aa19\n// > <???> @ 0x1800ff5b8\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b3be8\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::CCParticleSystem::initWithTotalParticles(\n        cocos2d::CCParticleSystem *this,\n        unsigned int a2,\n        char a3)\n{\n  cocos2d::tCCParticle *m_pParticles; // rcx\n  cocos2d::tCCParticle *v7; // rax\n  bool v9; // zf\n  unsigned int i; // edx\n\n  this->m_uTotalParticles = a2;\n  m_pParticles = this->m_pParticles;\n  if ( m_pParticles )\n  {\n    free(m_pParticles);\n    this->m_pParticles = nullptr;\n  }\n  v7 = (cocos2d::tCCParticle *)calloc(this->m_uTotalParticles, 0x94u);\n  this->m_pParticles = v7;\n  if ( v7 )\n  {\n    v9 = this->m_pBatchNode == nullptr;\n    this->m_uAllocatedParticles = a2;\n    if ( !v9 )\n    {\n      for ( i = 0; i < this->m_uTotalParticles; ++i )\n        *((_DWORD *)&this->m_pParticles->modeA.dir.x + 37 * i) = i;\n    }\n    this->m_bIsActive = 1;\n    this->m_tBlendFunc.src = 1;\n    this->m_tBlendFunc.dst = 771;\n    this->m_ePositionType = kCCPositionTypeFree;\n    this->m_nEmitterMode = 0;\n    this->m_bIsAutoRemoveOnFinish = 0;\n    this->m_bTransformSystemDirty = 0;\n    if ( !a3 )\n    {\n      cocos2d::CCNode::scheduleUpdateWithPriority(this, 1);\n      this->m_bUsingSchedule = 1;\n    }\n    return 1;\n  }\n  else\n  {\n    cocos2d::CCObject::release(this);\n    return 0;\n  }\n}", "assembly": "; \n; cocos2d::CCParticleSystem::initWithTotalParticles from 0x180068bd0 to 0x180068ce6 (278 bytes)\n; \n; 4 xrefs:\n; > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x18006aa19\n; > <???> @ 0x1800ff5b8\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b3be8\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, 0x180068bd0\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x180068bd5\npush    rdi                                                            ; +0xa, 0x180068bda\nsub     rsp, 20h                                                       ; +0xb, 0x180068bdb\nmov     rbx, rcx                                                       ; +0xf, 0x180068bdf\nmov     [rcx+298h], edx                                                ; +0x12, 0x180068be2\nmov     rcx, [rcx+1A8h]; Block                                         ; +0x18, 0x180068be8\nmovzx   esi, r8b                                                       ; +0x1f, 0x180068bef\nmov     edi, edx                                                       ; +0x23, 0x180068bf3\ntest    rcx, rcx                                                       ; +0x25, 0x180068bf5\njz      short loc_180068C0B                                            ; +0x28, 0x180068bf8\ncall    cs:__imp_free                                                  ; +0x2a, 0x180068bfa\nmov     qword ptr [rbx+1A8h], 0                                        ; +0x30, 0x180068c00\nmov     ecx, [rbx+298h]; Count                                         ; +0x3b, 0x180068c0b\nmov     edx, 94h; Size                                                 ; +0x41, 0x180068c11\ncall    cs:calloc                                                      ; +0x46, 0x180068c16\nmov     [rbx+1A8h], rax                                                ; +0x4c, 0x180068c1c\ntest    rax, rax                                                       ; +0x53, 0x180068c23\njnz     short loc_180068C42                                            ; +0x56, 0x180068c26\nmov     rcx, rbx; this                                                 ; +0x58, 0x180068c28\ncall    ?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x5b, 0x180068c2b\nxor     al, al                                                         ; +0x60, 0x180068c30\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x62, 0x180068c32\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x67, 0x180068c37\nadd     rsp, 20h                                                       ; +0x6c, 0x180068c3c\npop     rdi                                                            ; +0x70, 0x180068c40\nretn                                                                   ; +0x71, 0x180068c41\ncmp     qword ptr [rbx+1B8h], 0                                        ; +0x72, 0x180068c42\nmov     [rbx+1C8h], edi                                                ; +0x7a, 0x180068c4a\njz      short loc_180068C7E                                            ; +0x80, 0x180068c50\nxor     edx, edx                                                       ; +0x82, 0x180068c52\ncmp     [rbx+298h], edx                                                ; +0x84, 0x180068c54\njbe     short loc_180068C7E                                            ; +0x8a, 0x180068c5a\nnop     dword ptr [rax+00h]                                            ; +0x8c, 0x180068c5c\nmov     eax, edx                                                       ; +0x90, 0x180068c60\nimul    rcx, rax, 94h                                                  ; +0x92, 0x180068c62\nmov     rax, [rbx+1A8h]                                                ; +0x99, 0x180068c69\nmov     [rcx+rax+48h], edx                                             ; +0xa0, 0x180068c70\ninc     edx                                                            ; +0xa4, 0x180068c74\ncmp     edx, [rbx+298h]                                                ; +0xa6, 0x180068c76\njb      short loc_180068C60                                            ; +0xac, 0x180068c7c\nmov     byte ptr [rbx+1CCh], 1                                         ; +0xae, 0x180068c7e\nmov     dword ptr [rbx+2A8h], 1                                        ; +0xb5, 0x180068c85\nmov     dword ptr [rbx+2ACh], 303h                                     ; +0xbf, 0x180068c8f\nmov     dword ptr [rbx+2B4h], 0                                        ; +0xc9, 0x180068c99\nmov     dword ptr [rbx+2BCh], 0                                        ; +0xd3, 0x180068ca3\nmov     byte ptr [rbx+2B8h], 0                                         ; +0xdd, 0x180068cad\nmov     byte ptr [rbx+1C4h], 0                                         ; +0xe4, 0x180068cb4\ntest    sil, sil                                                       ; +0xeb, 0x180068cbb\njnz     short loc_180068CD4                                            ; +0xee, 0x180068cbe\nmov     edx, 1; int                                                    ; +0xf0, 0x180068cc0\nmov     rcx, rbx; this                                                 ; +0xf5, 0x180068cc5\ncall    ?scheduleUpdateWithPriority@CCNode@cocos2d@@QEAAXH@Z; cocos2d::CCNode::scheduleUpdateWithPriority(int) ; +0xf8, 0x180068cc8\nmov     byte ptr [rbx+230h], 1                                         ; +0xfd, 0x180068ccd\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x104, 0x180068cd4\nmov     al, 1                                                          ; +0x109, 0x180068cd9\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x10b, 0x180068cdb\nadd     rsp, 20h                                                       ; +0x110, 0x180068ce0\npop     rdi                                                            ; +0x114, 0x180068ce4\nretn                                                                   ; +0x115, 0x180068ce5", "xrefs": ["cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x18006aa19", "<???> @ 0x1800ff5b8", "<???> @ 0x1801438a8", "<???> @ 0x1801b3be8"], "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"}