{"type": "func", "start": 6443036240, "end": 6443036586, "name": "cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas", "pseudocode": "// \n// cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas from 0x18008ee50 to 0x18008efaa (346 bytes)\n// \n// 9 xrefs:\n// > cocos2d::CCSprite::removeAllChildrenWithCleanup @ 0x18008c078\n// > cocos2d::CCSprite::removeChild @ 0x18008c0e5\n// > cocos2d::CCSpriteBatchNode::removeChild @ 0x18008ee1e\n// > cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x18008ef23\n// > cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x18008ef8c\n// > <???> @ 0x18013d80c\n// > <???> @ 0x18013d81c\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b60d8\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::removeSpriteFromAtlas(\n        cocos2d::CCSpriteBatchNode *this,\n        struct cocos2d::CCSprite *a2)\n{\n  unsigned int m_unknown2; // ebp\n  unsigned int v5; // esi\n  __int64 v6; // r8\n  cocos2d::CCArray *v7; // rax\n  cocos2d::CCArray *v8; // rbx\n  cocos2d::ccArray *v9; // rbx\n  __int64 v10; // rax\n  struct cocos2d::CCSprite **v11; // rbx\n  struct cocos2d::CCSprite **j; // rsi\n  cocos2d::CCArray *v13; // rax\n  cocos2d::CCArray *v14; // rbx\n  cocos2d::ccArray *data; // rbx\n  __int64 num; // rax\n  struct cocos2d::CCSprite **arr; // rbx\n  struct cocos2d::CCSprite **i; // rsi\n\n  if ( a2->m_bDontDraw )\n  {\n    v13 = (cocos2d::CCArray *)((__int64 (__fastcall *)(struct cocos2d::CCSprite *))a2->getChildren)(a2);\n    v14 = v13;\n    if ( v13 )\n    {\n      if ( (unsigned int)cocos2d::CCArray::count(v13) )\n      {\n        data = v14->data;\n        num = data->num;\n        if ( (_DWORD)num )\n        {\n          arr = (struct cocos2d::CCSprite **)data->arr;\n          for ( i = &arr[num - 1]; arr <= i; ++arr )\n          {\n            if ( !*arr )\n              break;\n            cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas(this, *arr);\n          }\n        }\n      }\n    }\n  }\n  else\n  {\n    m_unknown2 = a2->m_unknown2;\n    if ( m_unknown2 != -1 )\n    {\n      v5 = cocos2d::CCArray::count(this->m_pobDescendants) - 1;\n      if ( m_unknown2 < v5 )\n        cocos2d::CCSpriteBatchNode::swap(this, m_unknown2, v5);\n      cocos2d::CCTextureAtlas::removeQuadAtIndex(this->m_pobTextureAtlas, v5);\n      this->m_bReorderChildDirty = 1;\n      ((void (__fastcall *)(struct cocos2d::CCSprite *, _QWORD))a2->setBatchNode)(a2, 0);\n      LOBYTE(v6) = 1;\n      sub_18009DF50(this->m_pobDescendants->data, this->m_pobDescendants->data->num - 1, v6);\n      v7 = (cocos2d::CCArray *)((__int64 (__fastcall *)(struct cocos2d::CCSprite *))a2->getChildren)(a2);\n      v8 = v7;\n      if ( v7 )\n      {\n        if ( (unsigned int)cocos2d::CCArray::count(v7) )\n        {\n          v9 = v8->data;\n          v10 = v9->num;\n          if ( (_DWORD)v10 )\n          {\n            v11 = (struct cocos2d::CCSprite **)v9->arr;\n            for ( j = &v11[v10 - 1]; v11 <= j; ++v11 )\n            {\n              if ( !*v11 )\n                break;\n              cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas(this, *v11);\n            }\n          }\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas from 0x18008ee50 to 0x18008efaa (346 bytes)\n; \n; 9 xrefs:\n; > cocos2d::CCSprite::removeAllChildrenWithCleanup @ 0x18008c078\n; > cocos2d::CCSprite::removeChild @ 0x18008c0e5\n; > cocos2d::CCSpriteBatchNode::removeChild @ 0x18008ee1e\n; > cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x18008ef23\n; > cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x18008ef8c\n; > <???> @ 0x18013d80c\n; > <???> @ 0x18013d81c\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b60d8\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, 0x18008ee50\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x18008ee55\npush    rdi                                                            ; +0xa, 0x18008ee5a\nsub     rsp, 20h                                                       ; +0xb, 0x18008ee5b\ncmp     byte ptr [rdx+22Fh], 0                                         ; +0xf, 0x18008ee5f\nmov     rbx, rdx                                                       ; +0x16, 0x18008ee66\nmov     rdi, rcx                                                       ; +0x19, 0x18008ee69\njnz     loc_18008EF46                                                  ; +0x1c, 0x18008ee6c\nmov     [rsp+28h+arg_0], rbp                                           ; +0x22, 0x18008ee72\nmov     ebp, [rdx+28h]                                                 ; +0x27, 0x18008ee77\ncmp     ebp, 0FFFFFFFFh                                                ; +0x2a, 0x18008ee7a\njz      loc_18008EF31                                                  ; +0x2d, 0x18008ee7d\nmov     rcx, [rcx+158h]; this                                          ; +0x33, 0x18008ee83\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x3a, 0x18008ee8a\nlea     esi, [rax-1]                                                   ; +0x3f, 0x18008ee8f\ncmp     ebp, esi                                                       ; +0x42, 0x18008ee92\njnb     short loc_18008EEA3                                            ; +0x44, 0x18008ee94\nmov     r8d, esi; int                                                  ; +0x46, 0x18008ee96\nmov     edx, ebp; int                                                  ; +0x49, 0x18008ee99\nmov     rcx, rdi; this                                                 ; +0x4b, 0x18008ee9b\ncall    ?swap@CCSpriteBatchNode@cocos2d@@AEAAXHH@Z; cocos2d::CCSpriteBatchNode::swap(int,int) ; +0x4e, 0x18008ee9e\nmov     rcx, [rdi+148h]; this                                          ; +0x53, 0x18008eea3\nmov     edx, esi; unsigned int                                         ; +0x5a, 0x18008eeaa\ncall    ?removeQuadAtIndex@CCTextureAtlas@cocos2d@@QEAAXI@Z; cocos2d::CCTextureAtlas::removeQuadAtIndex(uint) ; +0x5c, 0x18008eeac\nmov     byte ptr [rdi+120h], 1                                         ; +0x61, 0x18008eeb1\nxor     edx, edx                                                       ; +0x68, 0x18008eeb8\nmov     rax, [rbx]                                                     ; +0x6a, 0x18008eeba\nmov     rcx, rbx                                                       ; +0x6d, 0x18008eebd\ncall    qword ptr [rax+3B8h]                                           ; +0x70, 0x18008eec0\nmov     rax, [rdi+158h]                                                ; +0x76, 0x18008eec6\nmov     r8b, 1                                                         ; +0x7d, 0x18008eecd\nmov     rcx, [rax+38h]                                                 ; +0x80, 0x18008eed0\nmov     edx, [rcx]                                                     ; +0x84, 0x18008eed4\ndec     edx                                                            ; +0x86, 0x18008eed6\ncall    sub_18009DF50                                                  ; +0x88, 0x18008eed8\nmov     rax, [rbx]                                                     ; +0x8d, 0x18008eedd\nmov     rcx, rbx                                                       ; +0x90, 0x18008eee0\ncall    qword ptr [rax+1D0h]                                           ; +0x93, 0x18008eee3\nmov     rbx, rax                                                       ; +0x99, 0x18008eee9\ntest    rax, rax                                                       ; +0x9c, 0x18008eeec\njz      short loc_18008EF31                                            ; +0x9f, 0x18008eeef\nmov     rcx, rax; this                                                 ; +0xa1, 0x18008eef1\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xa4, 0x18008eef4\ntest    eax, eax                                                       ; +0xa9, 0x18008eef9\njz      short loc_18008EF31                                            ; +0xab, 0x18008eefb\nmov     rbx, [rbx+38h]                                                 ; +0xad, 0x18008eefd\nmov     eax, [rbx]                                                     ; +0xb1, 0x18008ef01\ntest    eax, eax                                                       ; +0xb3, 0x18008ef03\njz      short loc_18008EF31                                            ; +0xb5, 0x18008ef05\nmov     rbx, [rbx+10h]                                                 ; +0xb7, 0x18008ef07\nlea     rsi, [rax-1]                                                   ; +0xbb, 0x18008ef0b\nlea     rsi, [rbx+rsi*8]                                               ; +0xbf, 0x18008ef0f\ncmp     rbx, rsi                                                       ; +0xc3, 0x18008ef13\nja      short loc_18008EF31                                            ; +0xc6, 0x18008ef16\nmov     rdx, [rbx]; struct cocos2d::CCSprite *                         ; +0xc8, 0x18008ef18\ntest    rdx, rdx                                                       ; +0xcb, 0x18008ef1b\njz      short loc_18008EF31                                            ; +0xce, 0x18008ef1e\nmov     rcx, rdi; this                                                 ; +0xd0, 0x18008ef20\ncall    ?removeSpriteFromAtlas@CCSpriteBatchNode@cocos2d@@QEAAXPEAVCCSprite@2@@Z; cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas(cocos2d::CCSprite *) ; +0xd3, 0x18008ef23\nadd     rbx, 8                                                         ; +0xd8, 0x18008ef28\ncmp     rbx, rsi                                                       ; +0xdc, 0x18008ef2c\njbe     short loc_18008EF18                                            ; +0xdf, 0x18008ef2f\nmov     rbp, [rsp+28h+arg_0]                                           ; +0xe1, 0x18008ef31\nmov     rbx, [rsp+28h+arg_8]                                           ; +0xe6, 0x18008ef36\nmov     rsi, [rsp+28h+arg_10]                                          ; +0xeb, 0x18008ef3b\nadd     rsp, 20h                                                       ; +0xf0, 0x18008ef40\npop     rdi                                                            ; +0xf4, 0x18008ef44\nretn                                                                   ; +0xf5, 0x18008ef45\nmov     rax, [rdx]                                                     ; +0xf6, 0x18008ef46\nmov     rcx, rbx                                                       ; +0xf9, 0x18008ef49\ncall    qword ptr [rax+1D0h]                                           ; +0xfc, 0x18008ef4c\nmov     rbx, rax                                                       ; +0x102, 0x18008ef52\ntest    rax, rax                                                       ; +0x105, 0x18008ef55\njz      short loc_18008EF36                                            ; +0x108, 0x18008ef58\nmov     rcx, rax; this                                                 ; +0x10a, 0x18008ef5a\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x10d, 0x18008ef5d\ntest    eax, eax                                                       ; +0x112, 0x18008ef62\njz      short loc_18008EF36                                            ; +0x114, 0x18008ef64\nmov     rbx, [rbx+38h]                                                 ; +0x116, 0x18008ef66\nmov     eax, [rbx]                                                     ; +0x11a, 0x18008ef6a\ntest    eax, eax                                                       ; +0x11c, 0x18008ef6c\njz      short loc_18008EF36                                            ; +0x11e, 0x18008ef6e\nmov     rbx, [rbx+10h]                                                 ; +0x120, 0x18008ef70\nlea     rsi, [rax-1]                                                   ; +0x124, 0x18008ef74\nlea     rsi, [rbx+rsi*8]                                               ; +0x128, 0x18008ef78\ncmp     rbx, rsi                                                       ; +0x12c, 0x18008ef7c\nja      short loc_18008EF36                                            ; +0x12f, 0x18008ef7f\nmov     rdx, [rbx]; struct cocos2d::CCSprite *                         ; +0x131, 0x18008ef81\ntest    rdx, rdx                                                       ; +0x134, 0x18008ef84\njz      short loc_18008EF36                                            ; +0x137, 0x18008ef87\nmov     rcx, rdi; this                                                 ; +0x139, 0x18008ef89\ncall    ?removeSpriteFromAtlas@CCSpriteBatchNode@cocos2d@@QEAAXPEAVCCSprite@2@@Z; cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas(cocos2d::CCSprite *) ; +0x13c, 0x18008ef8c\nadd     rbx, 8                                                         ; +0x141, 0x18008ef91\ncmp     rbx, rsi                                                       ; +0x145, 0x18008ef95\njbe     short loc_18008EF81                                            ; +0x148, 0x18008ef98\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x14a, 0x18008ef9a\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x14f, 0x18008ef9f\nadd     rsp, 20h                                                       ; +0x154, 0x18008efa4\npop     rdi                                                            ; +0x158, 0x18008efa8\nretn                                                                   ; +0x159, 0x18008efa9", "xrefs": ["cocos2d::CCSprite::removeAllChildrenWithCleanup @ 0x18008c078", "cocos2d::CCSprite::removeChild @ 0x18008c0e5", "cocos2d::CCSpriteBatchNode::removeChild @ 0x18008ee1e", "cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x18008ef23", "cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x18008ef8c", "<???> @ 0x18013d80c", "<???> @ 0x18013d81c", "<???> @ 0x1801438a8", "<???> @ 0x1801b60d8"], "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"}