{"type": "func", "start": 6443032400, "end": 6443032829, "name": "cocos2d::CCSpriteBatchNode::appendChild", "pseudocode": "// \n// cocos2d::CCSpriteBatchNode::appendChild from 0x18008df50 to 0x18008e0fd (429 bytes)\n// \n// 7 xrefs:\n// > cocos2d::CCSprite::addChild @ 0x18008b479\n// > cocos2d::CCSpriteBatchNode::addChild @ 0x18008de98\n// > cocos2d::CCSpriteBatchNode::appendChild @ 0x18008e0cc\n// > <???> @ 0x18013d7e8\n// > <???> @ 0x18013d7f8\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b5f64\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::CCSpriteBatchNode::appendChild(cocos2d::CCSpriteBatchNode *this, struct cocos2d::CCSprite *a2)\n{\n  __int64 v4; // rdx\n  int v5; // ebx\n  cocos2d::ccArray *data; // rbx\n  __int128 v7; // xmm0\n  unsigned int v8; // r8d\n  __int128 v9; // xmm1\n  cocos2d::CCTextureAtlas *m_pobTextureAtlas; // rcx\n  __int128 v11; // xmm0\n  __int128 v12; // xmm1\n  __int128 v13; // xmm0\n  __int128 v14; // xmm1\n  struct cocos2d::CCSprite **v15; // rbx\n  __int64 v16; // rdi\n  unsigned __int64 i; // rdi\n  struct cocos2d::_ccV3F_C4B_T2F_Quad v18; // [rsp+20h] [rbp-88h] BYREF\n\n  this->m_bReorderChildDirty = 1;\n  ((void (__fastcall *)(struct cocos2d::CCSprite *, cocos2d::CCSpriteBatchNode *))a2->setBatchNode)(a2, this);\n  LOBYTE(v4) = 1;\n  ((void (__fastcall *)(struct cocos2d::CCSprite *, __int64))a2->setDirty)(a2, v4);\n  if ( !a2->m_bDontDraw )\n  {\n    v5 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pobTextureAtlas->getCapacity)(this->m_pobTextureAtlas);\n    if ( ((unsigned int (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pobTextureAtlas->getTotalQuads)(this->m_pobTextureAtlas) == v5 )\n      cocos2d::CCSpriteBatchNode::increaseAtlasCapacity(this);\n    data = this->m_pobDescendants->data;\n    sub_18009D680(data, a2);\n    v7 = *(_OWORD *)&a2->m_sQuad.tl.vertices.x;\n    v8 = data->num - 1;\n    v9 = *(_OWORD *)&a2->m_sQuad.tl.texCoords.u;\n    a2->m_uAtlasIndex = v8;\n    m_pobTextureAtlas = this->m_pobTextureAtlas;\n    *(_OWORD *)&v18.tl.vertices.x = v7;\n    v11 = *(_OWORD *)&a2->m_sQuad.bl.vertices.z;\n    *(_OWORD *)&v18.tl.texCoords.u = v9;\n    v12 = *(_OWORD *)&a2->m_sQuad.tr.vertices.x;\n    *(_OWORD *)&v18.bl.vertices.z = v11;\n    v13 = *(_OWORD *)&a2->m_sQuad.tr.texCoords.u;\n    *(_OWORD *)&v18.tr.vertices.x = v12;\n    v14 = *(_OWORD *)&a2->m_sQuad.br.vertices.z;\n    *(_OWORD *)&v18.tr.texCoords.u = v13;\n    *(_OWORD *)&v18.br.vertices.z = v14;\n    cocos2d::CCTextureAtlas::insertQuad(m_pobTextureAtlas, &v18, v8);\n  }\n  if ( ((__int64 (__fastcall *)(struct cocos2d::CCSprite *))a2->getChildren)(a2) )\n  {\n    if ( **(_DWORD **)(((__int64 (__fastcall *)(struct cocos2d::CCSprite *))a2->getChildren)(a2) + 56) )\n    {\n      v15 = *(struct cocos2d::CCSprite ***)(*(_QWORD *)(((__int64 (__fastcall *)(struct cocos2d::CCSprite *))a2->getChildren)(a2)\n                                                      + 56)\n                                          + 16LL);\n      v16 = 8LL * **(unsigned int **)(((__int64 (__fastcall *)(struct cocos2d::CCSprite *))a2->getChildren)(a2) + 56);\n      for ( i = *(_QWORD *)(*(_QWORD *)(((__int64 (__fastcall *)(struct cocos2d::CCSprite *))a2->getChildren)(a2) + 56)\n                          + 16LL)\n              + v16\n              - 8; (unsigned __int64)v15 <= i; ++v15 )\n      {\n        if ( !*v15 )\n          break;\n        cocos2d::CCSpriteBatchNode::appendChild(this, *v15);\n      }\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCSpriteBatchNode::appendChild from 0x18008df50 to 0x18008e0fd (429 bytes)\n; \n; 7 xrefs:\n; > cocos2d::CCSprite::addChild @ 0x18008b479\n; > cocos2d::CCSpriteBatchNode::addChild @ 0x18008de98\n; > cocos2d::CCSpriteBatchNode::appendChild @ 0x18008e0cc\n; > <???> @ 0x18013d7e8\n; > <???> @ 0x18013d7f8\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b5f64\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\npush    rbx                                                            ; +0x0, 0x18008df50\npush    rbp                                                            ; +0x2, 0x18008df52\npush    rsi                                                            ; +0x3, 0x18008df53\nsub     rsp, 90h                                                       ; +0x4, 0x18008df54\nmov     rax, cs:__security_cookie                                      ; +0xb, 0x18008df5b\nxor     rax, rsp                                                       ; +0x12, 0x18008df62\nmov     [rsp+0A8h+var_28], rax                                         ; +0x15, 0x18008df65\nmov     byte ptr [rcx+120h], 1                                         ; +0x1d, 0x18008df6d\nmov     rsi, rdx                                                       ; +0x24, 0x18008df74\nmov     rax, [rdx]                                                     ; +0x27, 0x18008df77\nmov     rbp, rcx                                                       ; +0x2a, 0x18008df7a\nmov     rdx, rcx                                                       ; +0x2d, 0x18008df7d\nmov     rcx, rsi                                                       ; +0x30, 0x18008df80\ncall    qword ptr [rax+3B8h]                                           ; +0x33, 0x18008df83\nmov     rax, [rsi]                                                     ; +0x39, 0x18008df89\nmov     dl, 1                                                          ; +0x3c, 0x18008df8c\nmov     rcx, rsi                                                       ; +0x3e, 0x18008df8e\ncall    qword ptr [rax+408h]                                           ; +0x41, 0x18008df91\ncmp     byte ptr [rsi+22Fh], 0                                         ; +0x47, 0x18008df97\njnz     loc_18008E048                                                  ; +0x4e, 0x18008df9e\nmov     rcx, [rbp+148h]                                                ; +0x54, 0x18008dfa4\nmov     rax, [rcx]                                                     ; +0x5b, 0x18008dfab\ncall    qword ptr [rax+50h]                                            ; +0x5e, 0x18008dfae\nmov     rcx, [rbp+148h]                                                ; +0x61, 0x18008dfb1\nmov     ebx, eax                                                       ; +0x68, 0x18008dfb8\nmov     rdx, [rcx]                                                     ; +0x6a, 0x18008dfba\ncall    qword ptr [rdx+48h]                                            ; +0x6d, 0x18008dfbd\ncmp     eax, ebx                                                       ; +0x70, 0x18008dfc0\njnz     short loc_18008DFCC                                            ; +0x72, 0x18008dfc2\nmov     rcx, rbp; this                                                 ; +0x74, 0x18008dfc4\ncall    ?increaseAtlasCapacity@CCSpriteBatchNode@cocos2d@@QEAAXXZ; cocos2d::CCSpriteBatchNode::increaseAtlasCapacity(void) ; +0x77, 0x18008dfc7\nmov     rax, [rbp+158h]                                                ; +0x7c, 0x18008dfcc\nmov     rdx, rsi                                                       ; +0x83, 0x18008dfd3\nmov     rbx, [rax+38h]                                                 ; +0x86, 0x18008dfd6\nmov     rcx, rbx                                                       ; +0x8a, 0x18008dfda\ncall    sub_18009D680                                                  ; +0x8d, 0x18008dfdd\nmov     r8d, [rbx]                                                     ; +0x92, 0x18008dfe2\nlea     rdx, [rsp+0A8h+var_88]; struct cocos2d::_ccV3F_C4B_T2F_Quad *  ; +0x95, 0x18008dfe5\nmovups  xmm0, xmmword ptr [rsi+1CCh]                                   ; +0x9a, 0x18008dfea\ndec     r8d; unsigned int                                              ; +0xa1, 0x18008dff1\nmovups  xmm1, xmmword ptr [rsi+1DCh]                                   ; +0xa4, 0x18008dff4\nmov     [rsi+168h], r8d                                                ; +0xab, 0x18008dffb\nmov     rcx, [rbp+148h]; this                                          ; +0xb2, 0x18008e002\nmovaps  [rsp+0A8h+var_88], xmm0                                        ; +0xb9, 0x18008e009\nmovups  xmm0, xmmword ptr [rsi+1ECh]                                   ; +0xbe, 0x18008e00e\nmovaps  [rsp+0A8h+var_78], xmm1                                        ; +0xc5, 0x18008e015\nmovups  xmm1, xmmword ptr [rsi+1FCh]                                   ; +0xca, 0x18008e01a\nmovaps  [rsp+0A8h+var_68], xmm0                                        ; +0xd1, 0x18008e021\nmovups  xmm0, xmmword ptr [rsi+20Ch]                                   ; +0xd6, 0x18008e026\nmovaps  [rsp+0A8h+var_58], xmm1                                        ; +0xdd, 0x18008e02d\nmovups  xmm1, xmmword ptr [rsi+21Ch]                                   ; +0xe2, 0x18008e032\nmovaps  [rsp+0A8h+var_48], xmm0                                        ; +0xe9, 0x18008e039\nmovaps  [rsp+0A8h+var_38], xmm1                                        ; +0xee, 0x18008e03e\ncall    ?insertQuad@CCTextureAtlas@cocos2d@@QEAAXPEAU_ccV3F_C4B_T2F_Quad@2@I@Z; cocos2d::CCTextureAtlas::insertQuad(cocos2d::_ccV3F_C4B_T2F_Quad *,uint) ; +0xf3, 0x18008e043\nmov     rax, [rsi]                                                     ; +0xf8, 0x18008e048\nmov     rcx, rsi                                                       ; +0xfb, 0x18008e04b\ncall    qword ptr [rax+1D0h]                                           ; +0xfe, 0x18008e04e\ntest    rax, rax                                                       ; +0x104, 0x18008e054\njz      loc_18008E0E2                                                  ; +0x107, 0x18008e057\nmov     rax, [rsi]                                                     ; +0x10d, 0x18008e05d\nmov     rcx, rsi                                                       ; +0x110, 0x18008e060\ncall    qword ptr [rax+1D0h]                                           ; +0x113, 0x18008e063\nmov     rcx, [rax+38h]                                                 ; +0x119, 0x18008e069\ncmp     dword ptr [rcx], 0                                             ; +0x11d, 0x18008e06d\njbe     short loc_18008E0E2                                            ; +0x120, 0x18008e070\nmov     rax, [rsi]                                                     ; +0x122, 0x18008e072\nmov     rcx, rsi                                                       ; +0x125, 0x18008e075\nmov     [rsp+0A8h+arg_10], rdi                                         ; +0x128, 0x18008e078\ncall    qword ptr [rax+1D0h]                                           ; +0x130, 0x18008e080\nmov     rcx, rsi                                                       ; +0x136, 0x18008e086\nmov     rbx, [rax+38h]                                                 ; +0x139, 0x18008e089\nmov     rax, [rsi]                                                     ; +0x13d, 0x18008e08d\nmov     rbx, [rbx+10h]                                                 ; +0x140, 0x18008e090\ncall    qword ptr [rax+1D0h]                                           ; +0x144, 0x18008e094\nmov     rcx, rsi                                                       ; +0x14a, 0x18008e09a\nmov     rdx, [rax+38h]                                                 ; +0x14d, 0x18008e09d\nmov     rax, [rsi]                                                     ; +0x151, 0x18008e0a1\nmov     edi, [rdx]                                                     ; +0x154, 0x18008e0a4\nshl     rdi, 3                                                         ; +0x156, 0x18008e0a6\ncall    qword ptr [rax+1D0h]                                           ; +0x15a, 0x18008e0aa\nadd     rdi, 0FFFFFFFFFFFFFFF8h                                        ; +0x160, 0x18008e0b0\nmov     rcx, [rax+38h]                                                 ; +0x164, 0x18008e0b4\nadd     rdi, [rcx+10h]                                                 ; +0x168, 0x18008e0b8\ncmp     rbx, rdi                                                       ; +0x16c, 0x18008e0bc\nja      short loc_18008E0DA                                            ; +0x16f, 0x18008e0bf\nmov     rdx, [rbx]; struct cocos2d::CCSprite *                         ; +0x171, 0x18008e0c1\ntest    rdx, rdx                                                       ; +0x174, 0x18008e0c4\njz      short loc_18008E0DA                                            ; +0x177, 0x18008e0c7\nmov     rcx, rbp; this                                                 ; +0x179, 0x18008e0c9\ncall    ?appendChild@CCSpriteBatchNode@cocos2d@@QEAAXPEAVCCSprite@2@@Z; cocos2d::CCSpriteBatchNode::appendChild(cocos2d::CCSprite *) ; +0x17c, 0x18008e0cc\nadd     rbx, 8                                                         ; +0x181, 0x18008e0d1\ncmp     rbx, rdi                                                       ; +0x185, 0x18008e0d5\njbe     short loc_18008E0C1                                            ; +0x188, 0x18008e0d8\nmov     rdi, [rsp+0A8h+arg_10]                                         ; +0x18a, 0x18008e0da\nmov     rcx, [rsp+0A8h+var_28]                                         ; +0x192, 0x18008e0e2\nxor     rcx, rsp; StackCookie                                          ; +0x19a, 0x18008e0ea\ncall    __security_check_cookie                                        ; +0x19d, 0x18008e0ed\nadd     rsp, 90h                                                       ; +0x1a2, 0x18008e0f2\npop     rsi                                                            ; +0x1a9, 0x18008e0f9\npop     rbp                                                            ; +0x1aa, 0x18008e0fa\npop     rbx                                                            ; +0x1ab, 0x18008e0fb\nretn                                                                   ; +0x1ac, 0x18008e0fc", "xrefs": ["cocos2d::CCSprite::addChild @ 0x18008b479", "cocos2d::CCSpriteBatchNode::addChild @ 0x18008de98", "cocos2d::CCSpriteBatchNode::appendChild @ 0x18008e0cc", "<???> @ 0x18013d7e8", "<???> @ 0x18013d7f8", "<???> @ 0x1801438a8", "<???> @ 0x1801b5f64"], "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"}