{"type": "func", "start": 4298358752, "end": 4298359034, "name": "CCAnimatedSprite::switchToMode", "pseudocode": "// \n// CCAnimatedSprite::switchToMode from 0x10033bfe0 to 0x10033c0fa (282 bytes)\n// \n// 3 xrefs:\n// > SpriteAnimationManager::executeAnimation @ 0x100802b7f\n// > SpriteAnimationManager::executeAnimation @ 0x100802bf4\n// > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x10080345a\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:28:41 +0000\n// \n\nvoid __fastcall CCAnimatedSprite::switchToMode(__int64 a1, int a2)\n{\n  __int64 v3; // rdi\n  __int64 v4; // r15\n  __int64 *v5; // r12\n  __int64 v6; // rax\n  unsigned __int8 *v7; // r15\n  unsigned __int8 isFlipX; // al\n  __int64 v9; // r15\n  unsigned __int16 *v10; // rax\n  __int64 v11; // r15\n  unsigned __int8 v12; // al\n\n  if ( *(_DWORD *)(a1 + 680) != a2 )\n  {\n    cocos2d::CCNode::stopAllActions(*(_QWORD *)(a1 + 656));\n    (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 656) + 344LL))(*(_QWORD *)(a1 + 656), 0);\n    if ( a2 == 1 )\n    {\n      v3 = *(_QWORD *)(a1 + 656);\n      v4 = *(_QWORD *)(a1 + 664);\n      if ( !v4 )\n      {\nLABEL_7:\n        cocos2d::CCNode::stopAllActions(v3);\n        (*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 656) + 344LL))(*(_QWORD *)(a1 + 656), 1);\n        *(_DWORD *)(a1 + 680) = a2;\n        return;\n      }\n      v5 = (__int64 *)(a1 + 664);\n      v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 944LL))(v3);\n      (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 960LL))(v4, v6);\n      v7 = *(unsigned __int8 **)(a1 + 664);\n      isFlipX = cocos2d::CCSprite::isFlipX(*(_QWORD *)(a1 + 656));\n      cocos2d::CCSprite::setFlipX(v7, isFlipX);\n    }\n    else\n    {\n      v5 = (__int64 *)(a1 + 672);\n      v9 = *(_QWORD *)(a1 + 672);\n      v10 = (unsigned __int16 *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 656) + 944LL))(*(_QWORD *)(a1 + 656));\n      CCPartAnimSprite::setColor(v9, *v10 | (*((unsigned __int8 *)v10 + 2) << 16));\n      v11 = *(_QWORD *)(a1 + 672);\n      v12 = cocos2d::CCSprite::isFlipX(*(_QWORD *)(a1 + 656));\n      CCPartAnimSprite::setFlipX(v11, v12);\n    }\n    v3 = *v5;\n    *(_QWORD *)(a1 + 656) = *v5;\n    goto LABEL_7;\n  }\n}", "assembly": "; \n; CCAnimatedSprite::switchToMode from 0x10033bfe0 to 0x10033c0fa (282 bytes)\n; \n; 3 xrefs:\n; > SpriteAnimationManager::executeAnimation @ 0x100802b7f\n; > SpriteAnimationManager::executeAnimation @ 0x100802bf4\n; > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x10080345a\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:28:41 +0000\n; \ncmp     [rdi+2A8h], esi                                                ; +0x0, 0x10033bfe0\njz      locret_10033C0F9                                               ; +0x6, 0x10033bfe6\npush    rbp                                                            ; +0xc, 0x10033bfec\nmov     rbp, rsp                                                       ; +0xd, 0x10033bfed\npush    r15                                                            ; +0x10, 0x10033bff0\npush    r14                                                            ; +0x12, 0x10033bff2\npush    r12                                                            ; +0x14, 0x10033bff4\npush    rbx                                                            ; +0x16, 0x10033bff6\nmov     ebx, esi                                                       ; +0x17, 0x10033bff7\nmov     r14, rdi                                                       ; +0x19, 0x10033bff9\nmov     rdi, [rdi+290h]                                                ; +0x1c, 0x10033bffc\ncall    cocos2d__CCNode__stopAllActions                                ; +0x23, 0x10033c003\nmov     rdi, [r14+290h]                                                ; +0x28, 0x10033c008\nmov     rax, [rdi]                                                     ; +0x2f, 0x10033c00f\nxor     esi, esi                                                       ; +0x32, 0x10033c012\ncall    qword ptr [rax+158h]                                           ; +0x34, 0x10033c014\ncmp     ebx, 1                                                         ; +0x3a, 0x10033c01a\njnz     short loc_10033C075                                            ; +0x3d, 0x10033c01d\nmov     rdi, [r14+290h]                                                ; +0x3f, 0x10033c01f\nmov     r15, [r14+298h]                                                ; +0x46, 0x10033c026\ntest    r15, r15                                                       ; +0x4d, 0x10033c02d\njz      loc_10033C0D0                                                  ; +0x50, 0x10033c030\nlea     r12, [r14+298h]                                                ; +0x56, 0x10033c036\nmov     rax, [rdi]                                                     ; +0x5d, 0x10033c03d\ncall    qword ptr [rax+3B0h]                                           ; +0x60, 0x10033c040\nmov     rcx, [r15]                                                     ; +0x66, 0x10033c046\nmov     rdi, r15                                                       ; +0x69, 0x10033c049\nmov     rsi, rax                                                       ; +0x6c, 0x10033c04c\ncall    qword ptr [rcx+3C0h]                                           ; +0x6f, 0x10033c04f\nmov     rdi, [r14+290h]                                                ; +0x75, 0x10033c055\nmov     r15, [r14+298h]                                                ; +0x7c, 0x10033c05c\ncall    cocos2d__CCSprite__isFlipX                                     ; +0x83, 0x10033c063\nmovzx   esi, al                                                        ; +0x88, 0x10033c068\nmov     rdi, r15                                                       ; +0x8b, 0x10033c06b\ncall    cocos2d__CCSprite__setFlipX                                    ; +0x8e, 0x10033c06e\njmp     short loc_10033C0C5                                            ; +0x93, 0x10033c073\nlea     r12, [r14+2A0h]                                                ; +0x95, 0x10033c075\nmov     rdi, [r14+290h]                                                ; +0x9c, 0x10033c07c\nmov     r15, [r14+2A0h]                                                ; +0xa3, 0x10033c083\nmov     rax, [rdi]                                                     ; +0xaa, 0x10033c08a\ncall    qword ptr [rax+3B0h]                                           ; +0xad, 0x10033c08d\nmovzx   ecx, word ptr [rax]                                            ; +0xb3, 0x10033c093\nmovzx   esi, byte ptr [rax+2]                                          ; +0xb6, 0x10033c096\nshl     esi, 10h                                                       ; +0xba, 0x10033c09a\nor      esi, ecx                                                       ; +0xbd, 0x10033c09d\nmov     rdi, r15                                                       ; +0xbf, 0x10033c09f\ncall    CCPartAnimSprite__setColor                                     ; +0xc2, 0x10033c0a2\nmov     rdi, [r14+290h]                                                ; +0xc7, 0x10033c0a7\nmov     r15, [r14+2A0h]                                                ; +0xce, 0x10033c0ae\ncall    cocos2d__CCSprite__isFlipX                                     ; +0xd5, 0x10033c0b5\nmovzx   esi, al                                                        ; +0xda, 0x10033c0ba\nmov     rdi, r15                                                       ; +0xdd, 0x10033c0bd\ncall    CCPartAnimSprite__setFlipX                                     ; +0xe0, 0x10033c0c0\nmov     rdi, [r12]                                                     ; +0xe5, 0x10033c0c5\nmov     [r14+290h], rdi                                                ; +0xe9, 0x10033c0c9\ncall    cocos2d__CCNode__stopAllActions                                ; +0xf0, 0x10033c0d0\nmov     rdi, [r14+290h]                                                ; +0xf5, 0x10033c0d5\nmov     rax, [rdi]                                                     ; +0xfc, 0x10033c0dc\nmov     esi, 1                                                         ; +0xff, 0x10033c0df\ncall    qword ptr [rax+158h]                                           ; +0x104, 0x10033c0e4\nmov     [r14+2A8h], ebx                                                ; +0x10a, 0x10033c0ea\npop     rbx                                                            ; +0x111, 0x10033c0f1\npop     r12                                                            ; +0x112, 0x10033c0f2\npop     r14                                                            ; +0x114, 0x10033c0f4\npop     r15                                                            ; +0x116, 0x10033c0f6\npop     rbp                                                            ; +0x118, 0x10033c0f8\nretn                                                                   ; +0x119, 0x10033c0f9", "xrefs": ["SpriteAnimationManager::executeAnimation @ 0x100802b7f", "SpriteAnimationManager::executeAnimation @ 0x100802bf4", "SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x10080345a"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}