{"type": "func", "start": 6443037344, "end": 6443037789, "name": "cocos2d::CCSpriteBatchNode::updateAtlasIndex", "pseudocode": "// \n// cocos2d::CCSpriteBatchNode::updateAtlasIndex from 0x18008f2a0 to 0x18008f45d (445 bytes)\n// \n// 8 xrefs:\n// > cocos2d::CCSpriteBatchNode::sortAllChildren @ 0x18008f160\n// > cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x18008f314\n// > cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x18008f3dc\n// > <???> @ 0x18013d980\n// > <???> @ 0x18013d990\n// > <???> @ 0x18013d9a4\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b6144\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::updateAtlasIndex(\n        cocos2d::CCSpriteBatchNode *this,\n        struct cocos2d::CCSprite *a2,\n        int *a3)\n{\n  __int64 v6; // rax\n  bool m_bDontDraw; // cl\n  __int64 v8; // rdi\n  unsigned int *v9; // r9\n  __int64 v10; // rcx\n  struct cocos2d::CCSprite **v11; // rdi\n  struct cocos2d::CCSprite **i; // rsi\n  char v13; // bp\n  unsigned int m_uAtlasIndex; // edx\n  unsigned int *v15; // rsi\n  __int64 v16; // rax\n  struct cocos2d::CCSprite **v17; // rsi\n  struct cocos2d::CCSprite **j; // r12\n  struct cocos2d::CCSprite *v19; // rdi\n  unsigned int v20; // edx\n  unsigned int v21; // edx\n  unsigned int v22; // edx\n\n  v6 = ((__int64 (__fastcall *)(struct cocos2d::CCSprite *))a2->getChildren)(a2);\n  m_bDontDraw = a2->m_bDontDraw;\n  v8 = v6;\n  if ( v6 && (v9 = *(unsigned int **)(v6 + 56), *v9) )\n  {\n    if ( m_bDontDraw )\n    {\n      v10 = *v9;\n      if ( (_DWORD)v10 )\n      {\n        v11 = *((struct cocos2d::CCSprite ***)v9 + 2);\n        for ( i = &v11[v10 - 1]; v11 <= i; ++v11 )\n        {\n          if ( !*v11 )\n            break;\n          cocos2d::CCSpriteBatchNode::updateAtlasIndex(this, *v11, a3);\n        }\n      }\n    }\n    else\n    {\n      v13 = 1;\n      if ( (*(int (__fastcall **)(_QWORD))(***((_QWORD ***)v9 + 2) + 96LL))(**((_QWORD **)v9 + 2)) >= 0 )\n      {\n        m_uAtlasIndex = a2->m_uAtlasIndex;\n        a2->m_uAtlasIndex = *a3;\n        if ( m_uAtlasIndex != *a3 )\n          cocos2d::CCSpriteBatchNode::swap(this, m_uAtlasIndex, *a3);\n        ++*a3;\n        v13 = 0;\n      }\n      v15 = *(unsigned int **)(v8 + 56);\n      v16 = *v15;\n      if ( (_DWORD)v16 )\n      {\n        v17 = *((struct cocos2d::CCSprite ***)v15 + 2);\n        for ( j = &v17[v16 - 1]; v17 <= j; ++v17 )\n        {\n          v19 = *v17;\n          if ( !*v17 )\n            break;\n          if ( v13 && ((int (__fastcall *)(struct cocos2d::CCSprite *))v19->getZOrder)(*v17) >= 0 )\n          {\n            v20 = a2->m_uAtlasIndex;\n            a2->m_uAtlasIndex = *a3;\n            if ( v20 != *a3 )\n              cocos2d::CCSpriteBatchNode::swap(this, v20, *a3);\n            ++*a3;\n            v13 = 0;\n          }\n          cocos2d::CCSpriteBatchNode::updateAtlasIndex(this, v19, a3);\n        }\n      }\n      if ( v13 )\n      {\n        v21 = a2->m_uAtlasIndex;\n        a2->m_uAtlasIndex = *a3;\n        if ( v21 != *a3 )\n          cocos2d::CCSpriteBatchNode::swap(this, v21, *a3);\n        ++*a3;\n      }\n    }\n  }\n  else if ( !m_bDontDraw )\n  {\n    v22 = a2->m_uAtlasIndex;\n    a2->m_uAtlasIndex = *a3;\n    if ( v22 != *a3 )\n      cocos2d::CCSpriteBatchNode::swap(this, v22, *a3);\n    ++*a3;\n  }\n}", "assembly": "; \n; cocos2d::CCSpriteBatchNode::updateAtlasIndex from 0x18008f2a0 to 0x18008f45d (445 bytes)\n; \n; 8 xrefs:\n; > cocos2d::CCSpriteBatchNode::sortAllChildren @ 0x18008f160\n; > cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x18008f314\n; > cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x18008f3dc\n; > <???> @ 0x18013d980\n; > <???> @ 0x18013d990\n; > <???> @ 0x18013d9a4\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b6144\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_18], rbx                                              ; +0x0, 0x18008f2a0\npush    rdi                                                            ; +0x5, 0x18008f2a5\npush    r14                                                            ; +0x6, 0x18008f2a6\npush    r15                                                            ; +0x8, 0x18008f2a8\nsub     rsp, 20h                                                       ; +0xa, 0x18008f2aa\nmov     rax, [rdx]                                                     ; +0xe, 0x18008f2ae\nmov     r15, rcx                                                       ; +0x11, 0x18008f2b1\nmov     rcx, rdx                                                       ; +0x14, 0x18008f2b4\nmov     rbx, r8                                                        ; +0x17, 0x18008f2b7\nmov     r14, rdx                                                       ; +0x1a, 0x18008f2ba\ncall    qword ptr [rax+1D0h]                                           ; +0x1d, 0x18008f2bd\nmovzx   ecx, byte ptr [r14+22Fh]                                       ; +0x23, 0x18008f2c3\nmov     rdi, rax                                                       ; +0x2b, 0x18008f2cb\ntest    rax, rax                                                       ; +0x2e, 0x18008f2ce\njz      loc_18008F424                                                  ; +0x31, 0x18008f2d1\nmov     r9, [rax+38h]                                                  ; +0x37, 0x18008f2d7\ncmp     dword ptr [r9], 0                                              ; +0x3b, 0x18008f2db\njz      loc_18008F424                                                  ; +0x3f, 0x18008f2df\nmov     [rsp+38h+arg_8], rsi                                           ; +0x45, 0x18008f2e5\ntest    cl, cl                                                         ; +0x4a, 0x18008f2ea\njz      short loc_18008F336                                            ; +0x4c, 0x18008f2ec\nmov     ecx, [r9]                                                      ; +0x4e, 0x18008f2ee\ntest    ecx, ecx                                                       ; +0x51, 0x18008f2f1\njz      short loc_18008F322                                            ; +0x53, 0x18008f2f3\nmov     rdi, [r9+10h]                                                  ; +0x55, 0x18008f2f5\nlea     rsi, [rcx-1]                                                   ; +0x59, 0x18008f2f9\nlea     rsi, [rdi+rsi*8]                                               ; +0x5d, 0x18008f2fd\ncmp     rdi, rsi                                                       ; +0x61, 0x18008f301\nja      short loc_18008F322                                            ; +0x64, 0x18008f304\nmov     rdx, [rdi]; struct cocos2d::CCSprite *                         ; +0x66, 0x18008f306\ntest    rdx, rdx                                                       ; +0x69, 0x18008f309\njz      short loc_18008F322                                            ; +0x6c, 0x18008f30c\nmov     r8, rbx; int *                                                 ; +0x6e, 0x18008f30e\nmov     rcx, r15; this                                                 ; +0x71, 0x18008f311\ncall    ?updateAtlasIndex@CCSpriteBatchNode@cocos2d@@AEAAXPEAVCCSprite@2@PEAH@Z; cocos2d::CCSpriteBatchNode::updateAtlasIndex(cocos2d::CCSprite *,int *) ; +0x74, 0x18008f314\nadd     rdi, 8                                                         ; +0x79, 0x18008f319\ncmp     rdi, rsi                                                       ; +0x7d, 0x18008f31d\njbe     short loc_18008F306                                            ; +0x80, 0x18008f320\nmov     rsi, [rsp+38h+arg_8]                                           ; +0x82, 0x18008f322\nmov     rbx, [rsp+38h+arg_18]                                          ; +0x87, 0x18008f327\nadd     rsp, 20h                                                       ; +0x8c, 0x18008f32c\npop     r15                                                            ; +0x90, 0x18008f330\npop     r14                                                            ; +0x92, 0x18008f332\npop     rdi                                                            ; +0x94, 0x18008f334\nretn                                                                   ; +0x95, 0x18008f335\nmov     rax, [r9+10h]                                                  ; +0x96, 0x18008f336\nmov     [rsp+38h+arg_0], rbp                                           ; +0x9a, 0x18008f33a\nmov     bpl, 1                                                         ; +0x9f, 0x18008f33f\nmov     rcx, [rax]                                                     ; +0xa2, 0x18008f342\nmov     rax, [rcx]                                                     ; +0xa5, 0x18008f345\ncall    qword ptr [rax+60h]                                            ; +0xa8, 0x18008f348\ntest    eax, eax                                                       ; +0xab, 0x18008f34b\njs      short loc_18008F374                                            ; +0xad, 0x18008f34d\nmov     edx, [r14+168h]; int                                           ; +0xaf, 0x18008f34f\nmov     eax, [rbx]                                                     ; +0xb6, 0x18008f356\nmov     [r14+168h], eax                                                ; +0xb8, 0x18008f358\nmov     r8d, [rbx]; int                                                ; +0xbf, 0x18008f35f\ncmp     edx, r8d                                                       ; +0xc2, 0x18008f362\njz      short loc_18008F36F                                            ; +0xc5, 0x18008f365\nmov     rcx, r15; this                                                 ; +0xc7, 0x18008f367\ncall    ?swap@CCSpriteBatchNode@cocos2d@@AEAAXHH@Z; cocos2d::CCSpriteBatchNode::swap(int,int) ; +0xca, 0x18008f36a\ninc     dword ptr [rbx]                                                ; +0xcf, 0x18008f36f\nxor     bpl, bpl                                                       ; +0xd1, 0x18008f371\nmov     rsi, [rdi+38h]                                                 ; +0xd4, 0x18008f374\nmov     eax, [rsi]                                                     ; +0xd8, 0x18008f378\ntest    eax, eax                                                       ; +0xda, 0x18008f37a\njz      short loc_18008F3EF                                            ; +0xdc, 0x18008f37c\nmov     rsi, [rsi+10h]                                                 ; +0xde, 0x18008f37e\nmov     [rsp+38h+arg_10], r12                                          ; +0xe2, 0x18008f382\nlea     r12, [rax-1]                                                   ; +0xe7, 0x18008f387\nlea     r12, [rsi+r12*8]                                               ; +0xeb, 0x18008f38b\ncmp     rsi, r12                                                       ; +0xef, 0x18008f38f\nja      short loc_18008F3EA                                            ; +0xf2, 0x18008f392\nmov     rdi, [rsi]                                                     ; +0xf4, 0x18008f394\ntest    rdi, rdi                                                       ; +0xf7, 0x18008f397\njz      short loc_18008F3EA                                            ; +0xfa, 0x18008f39a\ntest    bpl, bpl                                                       ; +0xfc, 0x18008f39c\njz      short loc_18008F3D3                                            ; +0xff, 0x18008f39f\nmov     rax, [rdi]                                                     ; +0x101, 0x18008f3a1\nmov     rcx, rdi                                                       ; +0x104, 0x18008f3a4\ncall    qword ptr [rax+60h]                                            ; +0x107, 0x18008f3a7\ntest    eax, eax                                                       ; +0x10a, 0x18008f3aa\njs      short loc_18008F3D3                                            ; +0x10c, 0x18008f3ac\nmov     edx, [r14+168h]; int                                           ; +0x10e, 0x18008f3ae\nmov     eax, [rbx]                                                     ; +0x115, 0x18008f3b5\nmov     [r14+168h], eax                                                ; +0x117, 0x18008f3b7\nmov     r8d, [rbx]; int                                                ; +0x11e, 0x18008f3be\ncmp     edx, r8d                                                       ; +0x121, 0x18008f3c1\njz      short loc_18008F3CE                                            ; +0x124, 0x18008f3c4\nmov     rcx, r15; this                                                 ; +0x126, 0x18008f3c6\ncall    ?swap@CCSpriteBatchNode@cocos2d@@AEAAXHH@Z; cocos2d::CCSpriteBatchNode::swap(int,int) ; +0x129, 0x18008f3c9\ninc     dword ptr [rbx]                                                ; +0x12e, 0x18008f3ce\nxor     bpl, bpl                                                       ; +0x130, 0x18008f3d0\nmov     r8, rbx; int *                                                 ; +0x133, 0x18008f3d3\nmov     rdx, rdi; struct cocos2d::CCSprite *                           ; +0x136, 0x18008f3d6\nmov     rcx, r15; this                                                 ; +0x139, 0x18008f3d9\ncall    ?updateAtlasIndex@CCSpriteBatchNode@cocos2d@@AEAAXPEAVCCSprite@2@PEAH@Z; cocos2d::CCSpriteBatchNode::updateAtlasIndex(cocos2d::CCSprite *,int *) ; +0x13c, 0x18008f3dc\nadd     rsi, 8                                                         ; +0x141, 0x18008f3e1\ncmp     rsi, r12                                                       ; +0x145, 0x18008f3e5\njbe     short loc_18008F394                                            ; +0x148, 0x18008f3e8\nmov     r12, [rsp+38h+arg_10]                                          ; +0x14a, 0x18008f3ea\ntest    bpl, bpl                                                       ; +0x14f, 0x18008f3ef\nmov     rbp, [rsp+38h+arg_0]                                           ; +0x152, 0x18008f3f2\njz      loc_18008F322                                                  ; +0x157, 0x18008f3f7\nmov     edx, [r14+168h]; int                                           ; +0x15d, 0x18008f3fd\nmov     eax, [rbx]                                                     ; +0x164, 0x18008f404\nmov     [r14+168h], eax                                                ; +0x166, 0x18008f406\nmov     r8d, [rbx]; int                                                ; +0x16d, 0x18008f40d\ncmp     edx, r8d                                                       ; +0x170, 0x18008f410\njz      short loc_18008F41D                                            ; +0x173, 0x18008f413\nmov     rcx, r15; this                                                 ; +0x175, 0x18008f415\ncall    ?swap@CCSpriteBatchNode@cocos2d@@AEAAXHH@Z; cocos2d::CCSpriteBatchNode::swap(int,int) ; +0x178, 0x18008f418\ninc     dword ptr [rbx]                                                ; +0x17d, 0x18008f41d\njmp     loc_18008F322                                                  ; +0x17f, 0x18008f41f\ntest    cl, cl                                                         ; +0x184, 0x18008f424\njnz     loc_18008F327                                                  ; +0x186, 0x18008f426\nmov     edx, [r14+168h]; int                                           ; +0x18c, 0x18008f42c\nmov     eax, [rbx]                                                     ; +0x193, 0x18008f433\nmov     [r14+168h], eax                                                ; +0x195, 0x18008f435\nmov     r8d, [rbx]; int                                                ; +0x19c, 0x18008f43c\ncmp     edx, r8d                                                       ; +0x19f, 0x18008f43f\njz      short loc_18008F44C                                            ; +0x1a2, 0x18008f442\nmov     rcx, r15; this                                                 ; +0x1a4, 0x18008f444\ncall    ?swap@CCSpriteBatchNode@cocos2d@@AEAAXHH@Z; cocos2d::CCSpriteBatchNode::swap(int,int) ; +0x1a7, 0x18008f447\ninc     dword ptr [rbx]                                                ; +0x1ac, 0x18008f44c\nmov     rbx, [rsp+38h+arg_18]                                          ; +0x1ae, 0x18008f44e\nadd     rsp, 20h                                                       ; +0x1b3, 0x18008f453\npop     r15                                                            ; +0x1b7, 0x18008f457\npop     r14                                                            ; +0x1b9, 0x18008f459\npop     rdi                                                            ; +0x1bb, 0x18008f45b\nretn                                                                   ; +0x1bc, 0x18008f45c", "xrefs": ["cocos2d::CCSpriteBatchNode::sortAllChildren @ 0x18008f160", "cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x18008f314", "cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x18008f3dc", "<???> @ 0x18013d980", "<???> @ 0x18013d990", "<???> @ 0x18013d9a4", "<???> @ 0x1801438a8", "<???> @ 0x1801b6144"], "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"}