{"type": "func", "start": 5241856, "end": 5242024, "name": "FollowRewardPage::switchToOpenedState", "pseudocode": "// \n// FollowRewardPage::switchToOpenedState from 0x4ffc00 to 0x4ffca8 (168 bytes)\n// \n// 2 xrefs:\n// > FollowRewardPage::init @ 0x5004a8\n// > FollowRewardPage::onSpecialItem @ 0x5007e8\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 FollowRewardPage::switchToOpenedState(FollowRewardPage *a1, CCMenuItemSpriteExtra *a2)\n{\n  GJChestSprite *v3; // r4\n  int v4; // r0\n  _DWORD *v5; // r2\n  int **v6; // r4\n  int **v7; // r5\n  int *v8; // r6\n  int *v9; // t1\n  int v10; // r3\n  void (__fastcall *v11)(int *, _DWORD *); // r3\n  _DWORD v12[2]; // [sp+0h] [bp-8h] BYREF\n\n  v12[0] = a1;\n  v12[1] = a2;\n  v3 = (GJChestSprite *)a2->getNormalImage(a2);\n  v3->m_dark = 0;\n  GJChestSprite::switchToState(v3, Opened, 1);\n  v4 = (int)v3->getChildren(v3);\n  if ( v4 )\n  {\n    v5 = *(_DWORD **)(v4 + 52);\n    if ( *v5 )\n    {\n      v6 = (int **)v5[3];\n      v7 = &(&v6[*v5])[-1];\n      while ( v6 <= v7 )\n      {\n        v9 = *v6++;\n        v8 = v9;\n        if ( !v9 )\n          break;\n        (*(void (__fastcall **)(int *, int))(*v8 + 448))(v8, 150);\n        v10 = *v8;\n        LOWORD(v12[0]) = -26986;\n        v11 = *(void (__fastcall **)(int *, _DWORD *))(v10 + 472);\n        BYTE2(v12[0]) = -106;\n        v11(v8, v12);\n      }\n    }\n  }\n  a2->setEnabled(a2, 0);\n}", "assembly": "; \n; FollowRewardPage::switchToOpenedState from 0x4ffc00 to 0x4ffca8 (168 bytes)\n; \n; 2 xrefs:\n; > FollowRewardPage::init @ 0x5004a8\n; > FollowRewardPage::onSpecialItem @ 0x5007e8\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\nPUSH.W          {R0,R1,R4-R10,LR}                                      ; +0x0, 0x4ffc00\nMOV             R0, R1                                                 ; +0x4, 0x4ffc04\nLDR.W           R8, =(__stack_chk_guard_ptr - 0x4FFC10)                ; +0x6, 0x4ffc06\nMOV             R7, R1                                                 ; +0xa, 0x4ffc0a\nADD             R8, PC; __stack_chk_guard_ptr                          ; +0xc, 0x4ffc0c\nLDR.W           R8, [R8]; __stack_chk_guard                            ; +0xe, 0x4ffc0e\nLDR.W           R3, [R8]                                               ; +0x12, 0x4ffc12\nSTR             R3, [SP,#8+var_4]                                      ; +0x16, 0x4ffc16\nLDR             R3, [R1]                                               ; +0x18, 0x4ffc18\nLDR.W           R3, [R3,#0x210]                                        ; +0x1a, 0x4ffc1a\nBLX             R3                                                     ; +0x1e, 0x4ffc1e\nMOVS            R3, #0                                                 ; +0x20, 0x4ffc20\nMOVS            R1, #4                                                 ; +0x22, 0x4ffc22\nMOVS            R2, #1                                                 ; +0x24, 0x4ffc24\nMOV             R4, R0                                                 ; +0x26, 0x4ffc26\nSTRB.W          R3, [R0,#0x204]                                        ; +0x28, 0x4ffc28\nBL              _ZN13GJChestSprite13switchToStateE16ChestSpriteStateb; GJChestSprite::switchToState(ChestSpriteState,bool) ; +0x2c, 0x4ffc2c\nLDR             R3, [R4]                                               ; +0x30, 0x4ffc30\nMOV             R0, R4                                                 ; +0x32, 0x4ffc32\nLDR.W           R3, [R3,#0xEC]                                         ; +0x34, 0x4ffc34\nBLX             R3                                                     ; +0x38, 0x4ffc38\nCBNZ            R0, loc_4FFC56                                         ; +0x3a, 0x4ffc3a\nLDR             R3, [R7]                                               ; +0x3c, 0x4ffc3c\nMOV             R0, R7                                                 ; +0x3e, 0x4ffc3e\nMOVS            R1, #0                                                 ; +0x40, 0x4ffc40\nLDR.W           R3, [R3,#0x208]                                        ; +0x42, 0x4ffc42\nBLX             R3                                                     ; +0x46, 0x4ffc46\nLDR             R2, [SP,#8+var_4]                                      ; +0x48, 0x4ffc48\nLDR.W           R3, [R8]                                               ; +0x4a, 0x4ffc4a\nCMP             R2, R3                                                 ; +0x4e, 0x4ffc4e\nBEQ             loc_4FFCA2                                             ; +0x50, 0x4ffc50\nBLX             __stack_chk_fail                                       ; +0x52, 0x4ffc52\nLDR             R2, [R0,#0x34]                                         ; +0x56, 0x4ffc56\nLDR             R3, [R2]                                               ; +0x58, 0x4ffc58\nCMP             R3, #0                                                 ; +0x5a, 0x4ffc5a\nBEQ             loc_4FFC3C                                             ; +0x5c, 0x4ffc5c\nADD.W           R3, R3, #0x40000000                                    ; +0x5e, 0x4ffc5e\nLDR             R4, [R2,#0xC]                                          ; +0x62, 0x4ffc62\nSUBS            R3, #1                                                 ; +0x64, 0x4ffc64\nMOV.W           R9, #0x96                                              ; +0x66, 0x4ffc66\nMOV             R10, SP                                                ; +0x6a, 0x4ffc6a\nADD.W           R5, R4, R3,LSL#2                                       ; +0x6c, 0x4ffc6c\nCMP             R4, R5                                                 ; +0x70, 0x4ffc70\nBHI             loc_4FFC3C                                             ; +0x72, 0x4ffc72\nLDR.W           R6, [R4],#4                                            ; +0x74, 0x4ffc74\nCMP             R6, #0                                                 ; +0x78, 0x4ffc78\nBEQ             loc_4FFC3C                                             ; +0x7a, 0x4ffc7a\nLDR             R3, [R6]                                               ; +0x7c, 0x4ffc7c\nMOV             R0, R6                                                 ; +0x7e, 0x4ffc7e\nMOVS            R1, #0x96                                              ; +0x80, 0x4ffc80\nLDR.W           R3, [R3,#0x1C0]                                        ; +0x82, 0x4ffc82\nBLX             R3                                                     ; +0x86, 0x4ffc86\nLDR             R3, [R6]                                               ; +0x88, 0x4ffc88\nMOV             R0, R6                                                 ; +0x8a, 0x4ffc8a\nSTRB.W          R9, [SP,#8+var_8]                                      ; +0x8c, 0x4ffc8c\nSTRB.W          R9, [SP,#8+var_7]                                      ; +0x90, 0x4ffc90\nMOV             R1, R10                                                ; +0x94, 0x4ffc94\nLDR.W           R3, [R3,#0x1D8]                                        ; +0x96, 0x4ffc96\nSTRB.W          R9, [SP,#8+var_6]                                      ; +0x9a, 0x4ffc9a\nBLX             R3                                                     ; +0x9e, 0x4ffc9e\nB               loc_4FFC70                                             ; +0xa0, 0x4ffca0\nADD             SP, SP, #8                                             ; +0xa2, 0x4ffca2\nPOP.W           {R4-R10,PC}                                            ; +0xa4, 0x4ffca4", "xrefs": ["FollowRewardPage::init @ 0x5004a8", "FollowRewardPage::onSpecialItem @ 0x5007e8"], "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"}