{"type": "func", "start": 4298367640, "end": 4298367708, "name": "GameStatsManager::countUnlockedSecretChests", "pseudocode": "// \n// GameStatsManager::countUnlockedSecretChests from 0x10033e298 to 0x10033e2dc (68 bytes)\n// \n// 4 xrefs:\n// > SecretRewardsLayer::init @ 0x1002e8cb8\n// > SecretRewardsLayer::updateUnlockedLabel @ 0x1002e9b6c\n// > SecretRewardsLayer::updateUnlockedLabel @ 0x1002e9bbc\n// > SecretRewardsLayer::updateUnlockedGoldLabel @ 0x1002e9f64\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\nint __fastcall GameStatsManager::countUnlockedSecretChests(GameStatsManager *a1, GJRewardType a2)\n{\n  cocos2d::CCDictionary *m_treasureRoomChests; // x0\n  cocos2d::CCDictElement *m_pElements; // x8\n  void *next; // x9\n\n  m_treasureRoomChests = a1->m_treasureRoomChests;\n  if ( a2 )\n  {\n    if ( m_treasureRoomChests )\n    {\n      m_pElements = m_treasureRoomChests->m_pElements;\n      if ( m_pElements )\n      {\n        LODWORD(m_treasureRoomChests) = 0;\n        do\n        {\n          next = m_pElements->hh.next;\n          if ( m_pElements->m_pObject[1].m_uID == a2 )\n            LODWORD(m_treasureRoomChests) = (_DWORD)m_treasureRoomChests + 1;\n          m_pElements = (cocos2d::CCDictElement *)m_pElements->hh.next;\n        }\n        while ( next );\n      }\n      else\n      {\n        LODWORD(m_treasureRoomChests) = 0;\n      }\n    }\n  }\n  else\n  {\n    LODWORD(m_treasureRoomChests) = cocos2d::CCDictionary::count(m_treasureRoomChests);\n  }\n  return (int)m_treasureRoomChests;\n}", "assembly": "; \n; GameStatsManager::countUnlockedSecretChests from 0x10033e298 to 0x10033e2dc (68 bytes)\n; \n; 4 xrefs:\n; > SecretRewardsLayer::init @ 0x1002e8cb8\n; > SecretRewardsLayer::updateUnlockedLabel @ 0x1002e9b6c\n; > SecretRewardsLayer::updateUnlockedLabel @ 0x1002e9bbc\n; > SecretRewardsLayer::updateUnlockedGoldLabel @ 0x1002e9f64\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\nLDR             X0, [X0,#0x2F0]                                        ; +0x0, 0x10033e298\nCBZ             W1, loc_10033E2D0                                      ; +0x4, 0x10033e29c\nCBZ             X0, locret_10033E2CC                                   ; +0x8, 0x10033e2a0\nLDR             X8, [X0,#0x38]                                         ; +0xc, 0x10033e2a4\nCBZ             X8, loc_10033E2D4                                      ; +0x10, 0x10033e2a8\nMOV             W0, #0                                                 ; +0x14, 0x10033e2ac\nLDR             X9, [X8,#0x120]                                        ; +0x18, 0x10033e2b0\nLDR             X8, [X8,#0x108]                                        ; +0x1c, 0x10033e2b4\nLDR             W8, [X8,#0x40]                                         ; +0x20, 0x10033e2b8\nCMP             W8, W1                                                 ; +0x24, 0x10033e2bc\nCINC            W0, W0, EQ                                             ; +0x28, 0x10033e2c0\nMOV             X8, X9                                                 ; +0x2c, 0x10033e2c4\nCBNZ            X9, loc_10033E2B0                                      ; +0x30, 0x10033e2c8\nRET                                                                    ; +0x34, 0x10033e2cc\nB               cocos2d__CCDictionary__count                           ; +0x38, 0x10033e2d0\nMOV             W0, #0                                                 ; +0x3c, 0x10033e2d4\nRET                                                                    ; +0x40, 0x10033e2d8", "xrefs": ["SecretRewardsLayer::init @ 0x1002e8cb8", "SecretRewardsLayer::updateUnlockedLabel @ 0x1002e9b6c", "SecretRewardsLayer::updateUnlockedLabel @ 0x1002e9bbc", "SecretRewardsLayer::updateUnlockedGoldLabel @ 0x1002e9f64"], "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"}