{"type": "func", "start": 4298442960, "end": 4298443242, "name": "CCAnimatedSprite::switchToMode", "pseudocode": "// \n// CCAnimatedSprite::switchToMode from 0x1003508d0 to 0x1003509ea (282 bytes)\n// \n// 3 xrefs:\n// > SpriteAnimationManager::executeAnimation @ 0x100723c5f\n// > SpriteAnimationManager::executeAnimation @ 0x100723cd4\n// > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x10072453a\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 CCAnimatedSprite::switchToMode(CCAnimatedSprite *a1, spriteMode a2)\n{\n  cocos2d::CCSprite *m_sprite; // rdi\n  cocos2d::CCSprite *m_fbfSprite; // r15\n  cocos2d::CCSprite **p_m_fbfSprite; // r12\n  __int64 v6; // rax\n  cocos2d::CCSprite *v7; // r15\n  bool isFlipX; // al\n  CCPartAnimSprite *m_paSprite; // r15\n  unsigned __int16 *v10; // rax\n  CCPartAnimSprite *v11; // r15\n  bool v12; // al\n\n  if ( a1->m_spriteMode != a2 )\n  {\n    cocos2d::CCNode::stopAllActions(a1->m_sprite);\n    ((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_sprite->setVisible)(a1->m_sprite, 0);\n    if ( a2 == FrameByFrame )\n    {\n      m_sprite = a1->m_sprite;\n      m_fbfSprite = a1->m_fbfSprite;\n      if ( !m_fbfSprite )\n      {\nLABEL_7:\n        cocos2d::CCNode::stopAllActions(m_sprite);\n        ((void (__fastcall *)(cocos2d::CCSprite *, __int64))a1->m_sprite->setVisible)(a1->m_sprite, 1);\n        a1->m_spriteMode = a2;\n        return;\n      }\n      p_m_fbfSprite = &a1->m_fbfSprite;\n      v6 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))m_sprite->getColor)(m_sprite);\n      ((void (__fastcall *)(cocos2d::CCSprite *, __int64))m_fbfSprite->setColor)(m_fbfSprite, v6);\n      v7 = a1->m_fbfSprite;\n      isFlipX = cocos2d::CCSprite::isFlipX(a1->m_sprite);\n      cocos2d::CCSprite::setFlipX(v7, isFlipX);\n    }\n    else\n    {\n      p_m_fbfSprite = &a1->m_paSprite;\n      m_paSprite = a1->m_paSprite;\n      v10 = (unsigned __int16 *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_sprite->getColor)(a1->m_sprite);\n      CCPartAnimSprite::setColor(m_paSprite, (cocos2d::ccColor3B)(*v10 | (*((unsigned __int8 *)v10 + 2) << 16)));\n      v11 = a1->m_paSprite;\n      v12 = cocos2d::CCSprite::isFlipX(a1->m_sprite);\n      CCPartAnimSprite::setFlipX(v11, v12);\n    }\n    m_sprite = *p_m_fbfSprite;\n    a1->m_sprite = *p_m_fbfSprite;\n    goto LABEL_7;\n  }\n}", "assembly": "; \n; CCAnimatedSprite::switchToMode from 0x1003508d0 to 0x1003509ea (282 bytes)\n; \n; 3 xrefs:\n; > SpriteAnimationManager::executeAnimation @ 0x100723c5f\n; > SpriteAnimationManager::executeAnimation @ 0x100723cd4\n; > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x10072453a\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\ncmp     [rdi+2A8h], esi                                                ; +0x0, 0x1003508d0\njz      locret_1003509E9                                               ; +0x6, 0x1003508d6\npush    rbp                                                            ; +0xc, 0x1003508dc\nmov     rbp, rsp                                                       ; +0xd, 0x1003508dd\npush    r15                                                            ; +0x10, 0x1003508e0\npush    r14                                                            ; +0x12, 0x1003508e2\npush    r12                                                            ; +0x14, 0x1003508e4\npush    rbx                                                            ; +0x16, 0x1003508e6\nmov     ebx, esi                                                       ; +0x17, 0x1003508e7\nmov     r14, rdi                                                       ; +0x19, 0x1003508e9\nmov     rdi, [rdi+290h]                                                ; +0x1c, 0x1003508ec\ncall    cocos2d__CCNode__stopAllActions                                ; +0x23, 0x1003508f3\nmov     rdi, [r14+290h]                                                ; +0x28, 0x1003508f8\nmov     rax, [rdi]                                                     ; +0x2f, 0x1003508ff\nxor     esi, esi                                                       ; +0x32, 0x100350902\ncall    qword ptr [rax+148h]                                           ; +0x34, 0x100350904\ncmp     ebx, 1                                                         ; +0x3a, 0x10035090a\njnz     short loc_100350965                                            ; +0x3d, 0x10035090d\nmov     rdi, [r14+290h]                                                ; +0x3f, 0x10035090f\nmov     r15, [r14+298h]                                                ; +0x46, 0x100350916\ntest    r15, r15                                                       ; +0x4d, 0x10035091d\njz      loc_1003509C0                                                  ; +0x50, 0x100350920\nlea     r12, [r14+298h]                                                ; +0x56, 0x100350926\nmov     rax, [rdi]                                                     ; +0x5d, 0x10035092d\ncall    qword ptr [rax+3A0h]                                           ; +0x60, 0x100350930\nmov     rcx, [r15]                                                     ; +0x66, 0x100350936\nmov     rdi, r15                                                       ; +0x69, 0x100350939\nmov     rsi, rax                                                       ; +0x6c, 0x10035093c\ncall    qword ptr [rcx+3B0h]                                           ; +0x6f, 0x10035093f\nmov     rdi, [r14+290h]                                                ; +0x75, 0x100350945\nmov     r15, [r14+298h]                                                ; +0x7c, 0x10035094c\ncall    cocos2d__CCSprite__isFlipX                                     ; +0x83, 0x100350953\nmovzx   esi, al                                                        ; +0x88, 0x100350958\nmov     rdi, r15                                                       ; +0x8b, 0x10035095b\ncall    cocos2d__CCSprite__setFlipX                                    ; +0x8e, 0x10035095e\njmp     short loc_1003509B5                                            ; +0x93, 0x100350963\nlea     r12, [r14+2A0h]                                                ; +0x95, 0x100350965\nmov     rdi, [r14+290h]                                                ; +0x9c, 0x10035096c\nmov     r15, [r14+2A0h]                                                ; +0xa3, 0x100350973\nmov     rax, [rdi]                                                     ; +0xaa, 0x10035097a\ncall    qword ptr [rax+3A0h]                                           ; +0xad, 0x10035097d\nmovzx   ecx, word ptr [rax]                                            ; +0xb3, 0x100350983\nmovzx   esi, byte ptr [rax+2]                                          ; +0xb6, 0x100350986\nshl     esi, 10h                                                       ; +0xba, 0x10035098a\nor      esi, ecx                                                       ; +0xbd, 0x10035098d\nmov     rdi, r15                                                       ; +0xbf, 0x10035098f\ncall    CCPartAnimSprite__setColor                                     ; +0xc2, 0x100350992\nmov     rdi, [r14+290h]                                                ; +0xc7, 0x100350997\nmov     r15, [r14+2A0h]                                                ; +0xce, 0x10035099e\ncall    cocos2d__CCSprite__isFlipX                                     ; +0xd5, 0x1003509a5\nmovzx   esi, al                                                        ; +0xda, 0x1003509aa\nmov     rdi, r15                                                       ; +0xdd, 0x1003509ad\ncall    CCPartAnimSprite__setFlipX                                     ; +0xe0, 0x1003509b0\nmov     rdi, [r12]                                                     ; +0xe5, 0x1003509b5\nmov     [r14+290h], rdi                                                ; +0xe9, 0x1003509b9\ncall    cocos2d__CCNode__stopAllActions                                ; +0xf0, 0x1003509c0\nmov     rdi, [r14+290h]                                                ; +0xf5, 0x1003509c5\nmov     rax, [rdi]                                                     ; +0xfc, 0x1003509cc\nmov     esi, 1                                                         ; +0xff, 0x1003509cf\ncall    qword ptr [rax+148h]                                           ; +0x104, 0x1003509d4\nmov     [r14+2A8h], ebx                                                ; +0x10a, 0x1003509da\npop     rbx                                                            ; +0x111, 0x1003509e1\npop     r12                                                            ; +0x112, 0x1003509e2\npop     r14                                                            ; +0x114, 0x1003509e4\npop     r15                                                            ; +0x116, 0x1003509e6\npop     rbp                                                            ; +0x118, 0x1003509e8\nretn                                                                   ; +0x119, 0x1003509e9", "xrefs": ["SpriteAnimationManager::executeAnimation @ 0x100723c5f", "SpriteAnimationManager::executeAnimation @ 0x100723cd4", "SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x10072453a"], "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"}