{"type": "func", "start": 3945780, "end": 3945970, "name": "CCAnimatedSprite::switchToMode", "pseudocode": "// \n// CCAnimatedSprite::switchToMode from 0x3c3534 to 0x3c35f2 (190 bytes)\n// \n// 3 xrefs:\n// > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x3d8284\n// > SpriteAnimationManager::executeAnimation @ 0x3d839e\n// > SpriteAnimationManager::executeAnimation @ 0x3d8468\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 11:46:32 +0000\n// \n\nint __fastcall CCAnimatedSprite::switchToMode(int result, int a2)\n{\n  int v2; // r4\n  int v4; // r6\n  void (__fastcall *v5)(int, int); // r7\n  int v6; // r0\n  cocos2d::CCSprite *v7; // r6\n  char isFlipX; // r0\n  int v9; // r3\n  int v10; // r6\n  unsigned __int8 *v11; // r0\n  CCPartAnimSprite *v12; // r6\n  char v13; // r0\n\n  v2 = result;\n  if ( *(_DWORD *)(result + 548) != a2 )\n  {\n    cocos2d::CCNode::stopAllActions(*(cocos2d::CCNode **)(result + 536));\n    (*(void (__fastcall **)(_DWORD, _DWORD))(**(_DWORD **)(v2 + 536) + 172))(*(_DWORD *)(v2 + 536), 0);\n    if ( a2 == 1 )\n    {\n      v4 = *(_DWORD *)(v2 + 540);\n      if ( !v4 )\n      {\nLABEL_7:\n        cocos2d::CCNode::stopAllActions(*(cocos2d::CCNode **)(v2 + 536));\n        result = (*(int (__fastcall **)(_DWORD, int))(**(_DWORD **)(v2 + 536) + 172))(*(_DWORD *)(v2 + 536), 1);\n        *(_DWORD *)(v2 + 548) = a2;\n        return result;\n      }\n      v5 = *(void (__fastcall **)(int, int))(*(_DWORD *)v4 + 480);\n      v6 = (*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v2 + 536) + 472))(*(_DWORD *)(v2 + 536));\n      v5(v4, v6);\n      v7 = *(cocos2d::CCSprite **)(v2 + 540);\n      isFlipX = cocos2d::CCSprite::isFlipX(*(cocos2d::CCSprite **)(v2 + 536));\n      cocos2d::CCSprite::setFlipX(v7, isFlipX);\n      v9 = *(_DWORD *)(v2 + 540);\n    }\n    else\n    {\n      v10 = *(_DWORD *)(v2 + 544);\n      v11 = (unsigned __int8 *)(*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v2 + 536) + 472))(*(_DWORD *)(v2 + 536));\n      CCPartAnimSprite::setColor(v10, *v11 | (v11[1] << 8) | (v11[2] << 16));\n      v12 = *(CCPartAnimSprite **)(v2 + 544);\n      v13 = cocos2d::CCSprite::isFlipX(*(cocos2d::CCSprite **)(v2 + 536));\n      CCPartAnimSprite::setFlipX(v12, v13);\n      v9 = *(_DWORD *)(v2 + 544);\n    }\n    *(_DWORD *)(v2 + 536) = v9;\n    goto LABEL_7;\n  }\n  return result;\n}", "assembly": "; \n; CCAnimatedSprite::switchToMode from 0x3c3534 to 0x3c35f2 (190 bytes)\n; \n; 3 xrefs:\n; > SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x3d8284\n; > SpriteAnimationManager::executeAnimation @ 0x3d839e\n; > SpriteAnimationManager::executeAnimation @ 0x3d8468\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 11:46:32 +0000\n; \nPUSH            {R3-R7,LR}                                             ; +0x0, 0x3c3534\nMOV             R4, R0                                                 ; +0x2, 0x3c3536\nLDR.W           R3, [R0,#0x224]                                        ; +0x4, 0x3c3538\nMOV             R5, R1                                                 ; +0x8, 0x3c353c\nCMP             R3, R1                                                 ; +0xa, 0x3c353e\nBEQ             locret_3C35F0                                          ; +0xc, 0x3c3540\nLDR.W           R0, [R0,#0x218]; this                                  ; +0xe, 0x3c3542\nBL              _ZN7cocos2d6CCNode14stopAllActionsEv; cocos2d::CCNode::stopAllActions(void) ; +0x12, 0x3c3546\nLDR.W           R0, [R4,#0x218]                                        ; +0x16, 0x3c354a\nMOVS            R1, #0                                                 ; +0x1a, 0x3c354e\nLDR             R3, [R0]                                               ; +0x1c, 0x3c3550\nLDR.W           R3, [R3,#0xAC]                                         ; +0x1e, 0x3c3552\nBLX             R3                                                     ; +0x22, 0x3c3556\nCMP             R5, #1                                                 ; +0x24, 0x3c3558\nBNE             loc_3C3596                                             ; +0x26, 0x3c355a\nLDR.W           R6, [R4,#0x21C]                                        ; +0x28, 0x3c355c\nCMP             R6, #0                                                 ; +0x2c, 0x3c3560\nBEQ             loc_3C35D6                                             ; +0x2e, 0x3c3562\nLDR             R3, [R6]                                               ; +0x30, 0x3c3564\nLDR.W           R0, [R4,#0x218]                                        ; +0x32, 0x3c3566\nLDR.W           R7, [R3,#0x1E0]                                        ; +0x36, 0x3c356a\nLDR             R3, [R0]                                               ; +0x3a, 0x3c356e\nLDR.W           R3, [R3,#0x1D8]                                        ; +0x3c, 0x3c3570\nBLX             R3                                                     ; +0x40, 0x3c3574\nMOV             R1, R0                                                 ; +0x42, 0x3c3576\nMOV             R0, R6                                                 ; +0x44, 0x3c3578\nBLX             R7                                                     ; +0x46, 0x3c357a\nLDR.W           R0, [R4,#0x218]; this                                  ; +0x48, 0x3c357c\nLDR.W           R6, [R4,#0x21C]                                        ; +0x4c, 0x3c3580\nBL              _ZN7cocos2d8CCSprite7isFlipXEv; cocos2d::CCSprite::isFlipX(void) ; +0x50, 0x3c3584\nMOV             R1, R0; bool                                           ; +0x54, 0x3c3588\nMOV             R0, R6; this                                           ; +0x56, 0x3c358a\nBL              _ZN7cocos2d8CCSprite8setFlipXEb; cocos2d::CCSprite::setFlipX(bool) ; +0x58, 0x3c358c\nLDR.W           R3, [R4,#0x21C]                                        ; +0x5c, 0x3c3590\nB               loc_3C35D2                                             ; +0x60, 0x3c3594\nLDR.W           R0, [R4,#0x218]                                        ; +0x62, 0x3c3596\nLDR.W           R6, [R4,#0x220]                                        ; +0x66, 0x3c359a\nLDR             R3, [R0]                                               ; +0x6a, 0x3c359e\nLDR.W           R3, [R3,#0x1D8]                                        ; +0x6c, 0x3c35a0\nBLX             R3                                                     ; +0x70, 0x3c35a4\nLDRB            R1, [R0,#1]                                            ; +0x72, 0x3c35a6\nLDRB            R3, [R0]                                               ; +0x74, 0x3c35a8\nORR.W           R3, R3, R1,LSL#8                                       ; +0x76, 0x3c35aa\nLDRB            R1, [R0,#2]                                            ; +0x7a, 0x3c35ae\nMOV             R0, R6                                                 ; +0x7c, 0x3c35b0\nORR.W           R1, R3, R1,LSL#16                                      ; +0x7e, 0x3c35b2\nBL              _ZN16CCPartAnimSprite8setColorEN7cocos2d10_ccColor3BE; CCPartAnimSprite::setColor(cocos2d::_ccColor3B) ; +0x82, 0x3c35b6\nLDR.W           R0, [R4,#0x218]; this                                  ; +0x86, 0x3c35ba\nLDR.W           R6, [R4,#0x220]                                        ; +0x8a, 0x3c35be\nBL              _ZN7cocos2d8CCSprite7isFlipXEv; cocos2d::CCSprite::isFlipX(void) ; +0x8e, 0x3c35c2\nMOV             R1, R0; bool                                           ; +0x92, 0x3c35c6\nMOV             R0, R6; this                                           ; +0x94, 0x3c35c8\nBL              _ZN16CCPartAnimSprite8setFlipXEb; CCPartAnimSprite::setFlipX(bool) ; +0x96, 0x3c35ca\nLDR.W           R3, [R4,#0x220]                                        ; +0x9a, 0x3c35ce\nSTR.W           R3, [R4,#0x218]                                        ; +0x9e, 0x3c35d2\nLDR.W           R0, [R4,#0x218]; this                                  ; +0xa2, 0x3c35d6\nBL              _ZN7cocos2d6CCNode14stopAllActionsEv; cocos2d::CCNode::stopAllActions(void) ; +0xa6, 0x3c35da\nLDR.W           R0, [R4,#0x218]                                        ; +0xaa, 0x3c35de\nMOVS            R1, #1                                                 ; +0xae, 0x3c35e2\nLDR             R3, [R0]                                               ; +0xb0, 0x3c35e4\nLDR.W           R3, [R3,#0xAC]                                         ; +0xb2, 0x3c35e6\nBLX             R3                                                     ; +0xb6, 0x3c35ea\nSTR.W           R5, [R4,#0x224]                                        ; +0xb8, 0x3c35ec\nPOP             {R3-R7,PC}                                             ; +0xbc, 0x3c35f0", "xrefs": ["SpriteAnimationManager::switchToFirstFrameOfAnimation @ 0x3d8284", "SpriteAnimationManager::executeAnimation @ 0x3d839e", "SpriteAnimationManager::executeAnimation @ 0x3d8468"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "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"}