{"type": "func", "start": 6442887920, "end": 6442888219, "name": "cocos2d::CCParticleSystemQuad::setBatchNode", "pseudocode": "// \n// cocos2d::CCParticleSystemQuad::setBatchNode from 0x18006aaf0 to 0x18006ac1b (299 bytes)\n// \n// 16 xrefs:\n// > <???> @ 0x1800faa70\n// > <???> @ 0x1800fb0e0\n// > <???> @ 0x1800fb750\n// > <???> @ 0x1800fbdc0\n// > <???> @ 0x1800fc430\n// > <???> @ 0x1800fcaa0\n// > <???> @ 0x1800fd110\n// > <???> @ 0x1800fd780\n// > <???> @ 0x1800fddf0\n// > <???> @ 0x1800fe460\n// > <???> @ 0x1800fead0\n// > <???> @ 0x1800ffdb8\n// > <???> @ 0x18013a148\n// > <???> @ 0x18013a158\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b3d08\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::setBatchNode(\n        cocos2d::CCParticleSystemQuad *this,\n        struct cocos2d::CCParticleBatchNode *a2)\n{\n  cocos2d::CCParticleBatchNode *m_pBatchNode; // rbp\n  cocos2d::CCTextureProtocol_vtbl *v5; // rdi\n  __int64 v6; // rax\n  __int64 v7; // rax\n  cocos2d::ccV3F_C4B_T2F_Quad *m_pQuads; // rcx\n  GLushort *m_pIndices; // rcx\n\n  m_pBatchNode = this->m_pBatchNode;\n  if ( m_pBatchNode != a2 )\n  {\n    cocos2d::CCParticleSystem::setBatchNode(this, a2);\n    if ( a2 )\n    {\n      if ( !m_pBatchNode )\n      {\n        v7 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pBatchNode->m_pTextureAtlas->getQuads)(this->m_pBatchNode->m_pTextureAtlas);\n        memcpy((void *)(v7 + 96LL * this->m_uAtlasIndex), this->m_pQuads, 96LL * this->m_uTotalParticles);\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        _glewDeleteBuffers(2, this->m_pBuffersVBO);\n        *(_QWORD *)this->m_pBuffersVBO = 0;\n      }\n    }\n    else\n    {\n      cocos2d::CCParticleSystemQuad::allocMemory(this);\n      cocos2d::CCParticleSystemQuad::initIndices(this);\n      v5 = this->cocos2d::CCParticleSystem::cocos2d::CCTextureProtocol::cocos2d::CCBlendProtocol::__vftable;\n      v6 = ((__int64 (__fastcall *)(cocos2d::CCTextureProtocol *))m_pBatchNode->getTexture)(&m_pBatchNode->cocos2d::CCTextureProtocol);\n      ((void (__fastcall *)(cocos2d::CCTextureProtocol *, __int64))v5->setTexture)(\n        &this->cocos2d::CCTextureProtocol,\n        v6);\n      cocos2d::CCParticleSystemQuad::setupVBO(this);\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCParticleSystemQuad::setBatchNode from 0x18006aaf0 to 0x18006ac1b (299 bytes)\n; \n; 16 xrefs:\n; > <???> @ 0x1800faa70\n; > <???> @ 0x1800fb0e0\n; > <???> @ 0x1800fb750\n; > <???> @ 0x1800fbdc0\n; > <???> @ 0x1800fc430\n; > <???> @ 0x1800fcaa0\n; > <???> @ 0x1800fd110\n; > <???> @ 0x1800fd780\n; > <???> @ 0x1800fddf0\n; > <???> @ 0x1800fe460\n; > <???> @ 0x1800fead0\n; > <???> @ 0x1800ffdb8\n; > <???> @ 0x18013a148\n; > <???> @ 0x18013a158\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b3d08\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_8], rbx                                               ; +0x0, 0x18006aaf0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x18006aaf5\npush    rsi                                                            ; +0xa, 0x18006aafa\nsub     rsp, 20h                                                       ; +0xb, 0x18006aafb\nmov     rbp, [rcx+1B8h]                                                ; +0xf, 0x18006aaff\nmov     rbx, rdx                                                       ; +0x16, 0x18006ab06\nmov     rsi, rcx                                                       ; +0x19, 0x18006ab09\ncmp     rbp, rdx                                                       ; +0x1c, 0x18006ab0c\njz      loc_18006AC0B                                                  ; +0x1f, 0x18006ab0f\ncall    ?setBatchNode@CCParticleSystem@cocos2d@@UEAAXPEAVCCParticleBatchNode@2@@Z; cocos2d::CCParticleSystem::setBatchNode(cocos2d::CCParticleBatchNode *) ; +0x25, 0x18006ab15\ntest    rbx, rbx                                                       ; +0x2a, 0x18006ab1a\njnz     short loc_18006AB71                                            ; +0x2d, 0x18006ab1d\nmov     rcx, rsi; this                                                 ; +0x2f, 0x18006ab1f\nmov     [rsp+28h+arg_0], rdi                                           ; +0x32, 0x18006ab22\ncall    ?allocMemory@CCParticleSystemQuad@cocos2d@@AEAA_NXZ; cocos2d::CCParticleSystemQuad::allocMemory(void) ; +0x37, 0x18006ab27\nmov     rcx, rsi; this                                                 ; +0x3c, 0x18006ab2c\ncall    ?initIndices@CCParticleSystemQuad@cocos2d@@QEAAXXZ; cocos2d::CCParticleSystemQuad::initIndices(void) ; +0x3f, 0x18006ab2f\nmov     rdi, [rsi+140h]                                                ; +0x44, 0x18006ab34\nlea     rcx, [rbp+140h]                                                ; +0x4b, 0x18006ab3b\nmov     rax, [rcx]                                                     ; +0x52, 0x18006ab42\ncall    qword ptr [rax+10h]                                            ; +0x55, 0x18006ab45\nmov     rdx, rax                                                       ; +0x58, 0x18006ab48\nlea     rcx, [rsi+140h]                                                ; +0x5b, 0x18006ab4b\ncall    qword ptr [rdi+18h]                                            ; +0x62, 0x18006ab52\nmov     rcx, rsi; this                                                 ; +0x65, 0x18006ab55\nmov     rdi, [rsp+28h+arg_0]                                           ; +0x68, 0x18006ab58\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x6d, 0x18006ab5d\nmov     rbp, [rsp+28h+arg_10]                                          ; +0x72, 0x18006ab62\nadd     rsp, 20h                                                       ; +0x77, 0x18006ab67\npop     rsi                                                            ; +0x7b, 0x18006ab6b\njmp     ?setupVBO@CCParticleSystemQuad@cocos2d@@AEAAXXZ; cocos2d::CCParticleSystemQuad::setupVBO(void) ; +0x7c, 0x18006ab6c\ntest    rbp, rbp                                                       ; +0x81, 0x18006ab71\njnz     loc_18006AC0B                                                  ; +0x84, 0x18006ab74\nmov     rax, [rsi+1B8h]                                                ; +0x8a, 0x18006ab7a\nmov     rcx, [rax+148h]                                                ; +0x91, 0x18006ab81\nmov     rax, [rcx]                                                     ; +0x98, 0x18006ab88\ncall    qword ptr [rax+68h]                                            ; +0x9b, 0x18006ab8b\nmov     ecx, [rsi+298h]                                                ; +0x9e, 0x18006ab8e\nmov     rdx, [rsi+318h]; Src                                           ; +0xa4, 0x18006ab94\nlea     r8, [rcx+rcx*2]                                                ; +0xab, 0x18006ab9b\nmov     ecx, [rsi+1C0h]                                                ; +0xaf, 0x18006ab9f\nshl     r8, 5; Size                                                    ; +0xb5, 0x18006aba5\nlea     rcx, [rcx+rcx*2]                                               ; +0xb9, 0x18006aba9\nshl     rcx, 5                                                         ; +0xbd, 0x18006abad\nadd     rcx, rax; void *                                               ; +0xc1, 0x18006abb1\ncall    memcpy                                                         ; +0xc4, 0x18006abb4\nmov     rcx, [rsi+318h]; Block                                         ; +0xc9, 0x18006abb9\nxor     ebx, ebx                                                       ; +0xd0, 0x18006abc0\ntest    rcx, rcx                                                       ; +0xd2, 0x18006abc2\njz      short loc_18006ABD4                                            ; +0xd5, 0x18006abc5\ncall    cs:__imp_free                                                  ; +0xd7, 0x18006abc7\nmov     [rsi+318h], rbx                                                ; +0xdd, 0x18006abcd\nmov     rcx, [rsi+320h]; Block                                         ; +0xe4, 0x18006abd4\ntest    rcx, rcx                                                       ; +0xeb, 0x18006abdb\njz      short loc_18006ABED                                            ; +0xee, 0x18006abde\ncall    cs:__imp_free                                                  ; +0xf0, 0x18006abe0\nmov     [rsi+320h], rbx                                                ; +0xf6, 0x18006abe6\nmov     rax, cs:__glewDeleteBuffers                                    ; +0xfd, 0x18006abed\nlea     rdx, [rsi+328h]                                                ; +0x104, 0x18006abf4\nmov     ecx, 2                                                         ; +0x10b, 0x18006abfb\ncall    qword ptr [rax]                                                ; +0x110, 0x18006ac00\nxor     eax, eax                                                       ; +0x112, 0x18006ac02\nmov     [rsi+328h], rax                                                ; +0x114, 0x18006ac04\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x11b, 0x18006ac0b\nmov     rbp, [rsp+28h+arg_10]                                          ; +0x120, 0x18006ac10\nadd     rsp, 20h                                                       ; +0x125, 0x18006ac15\npop     rsi                                                            ; +0x129, 0x18006ac19\nretn                                                                   ; +0x12a, 0x18006ac1a", "xrefs": ["<???> @ 0x1800faa70", "<???> @ 0x1800fb0e0", "<???> @ 0x1800fb750", "<???> @ 0x1800fbdc0", "<???> @ 0x1800fc430", "<???> @ 0x1800fcaa0", "<???> @ 0x1800fd110", "<???> @ 0x1800fd780", "<???> @ 0x1800fddf0", "<???> @ 0x1800fe460", "<???> @ 0x1800fead0", "<???> @ 0x1800ffdb8", "<???> @ 0x18013a148", "<???> @ 0x18013a158", "<???> @ 0x1801438a8", "<???> @ 0x1801b3d08"], "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"}