{"type": "func", "start": 4299017456, "end": 4299017524, "name": "GameStatsManager::countUnlockedSecretChests", "pseudocode": "// \n// GameStatsManager::countUnlockedSecretChests from 0x1003dccf0 to 0x1003dcd34 (68 bytes)\n// \n// 4 xrefs:\n// > SecretRewardsLayer::init @ 0x100383e40\n// > SecretRewardsLayer::updateUnlockedLabel @ 0x100384cf4\n// > SecretRewardsLayer::updateUnlockedLabel @ 0x100384d44\n// > sub_1003850CC @ 0x1003850ec\n// \n// This function is hookable on this platform (idp: arm, 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 11:04:19 +0000\n// \n\n__int64 __fastcall GameStatsManager::countUnlockedSecretChests(__int64 a1, int a2)\n{\n  __int64 result; // x0\n  __int64 v3; // x8\n  __int64 v4; // x9\n\n  result = *(_QWORD *)(a1 + 760);\n  if ( !a2 )\n    return cocos2d::CCDictionary::count(result);\n  if ( result )\n  {\n    v3 = *(_QWORD *)(result + 56);\n    if ( v3 )\n    {\n      LODWORD(result) = 0;\n      do\n      {\n        v4 = *(_QWORD *)(v3 + 288);\n        if ( *(_DWORD *)(*(_QWORD *)(v3 + 264) + 64LL) == a2 )\n          result = (unsigned int)(result + 1);\n        else\n          result = (unsigned int)result;\n        v3 = *(_QWORD *)(v3 + 288);\n      }\n      while ( v4 );\n    }\n    else\n    {\n      return 0;\n    }\n  }\n  return result;\n}", "assembly": "; \n; GameStatsManager::countUnlockedSecretChests from 0x1003dccf0 to 0x1003dcd34 (68 bytes)\n; \n; 4 xrefs:\n; > SecretRewardsLayer::init @ 0x100383e40\n; > SecretRewardsLayer::updateUnlockedLabel @ 0x100384cf4\n; > SecretRewardsLayer::updateUnlockedLabel @ 0x100384d44\n; > sub_1003850CC @ 0x1003850ec\n; \n; This function is hookable on this platform (idp: arm, 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 11:04:19 +0000\n; \nLDR             X0, [X0,#0x2F8]                                        ; +0x0, 0x1003dccf0\nCBZ             W1, loc_1003DCD28                                      ; +0x4, 0x1003dccf4\nCBZ             X0, locret_1003DCD24                                   ; +0x8, 0x1003dccf8\nLDR             X8, [X0,#0x38]                                         ; +0xc, 0x1003dccfc\nCBZ             X8, loc_1003DCD2C                                      ; +0x10, 0x1003dcd00\nMOV             W0, #0                                                 ; +0x14, 0x1003dcd04\nLDR             X9, [X8,#0x120]                                        ; +0x18, 0x1003dcd08\nLDR             X8, [X8,#0x108]                                        ; +0x1c, 0x1003dcd0c\nLDR             W8, [X8,#0x40]                                         ; +0x20, 0x1003dcd10\nCMP             W8, W1                                                 ; +0x24, 0x1003dcd14\nCINC            W0, W0, EQ                                             ; +0x28, 0x1003dcd18\nMOV             X8, X9                                                 ; +0x2c, 0x1003dcd1c\nCBNZ            X9, loc_1003DCD08                                      ; +0x30, 0x1003dcd20\nRET                                                                    ; +0x34, 0x1003dcd24\nB               cocos2d__CCDictionary__count                           ; +0x38, 0x1003dcd28\nMOV             W0, #0                                                 ; +0x3c, 0x1003dcd2c\nRET                                                                    ; +0x40, 0x1003dcd30", "xrefs": ["SecretRewardsLayer::init @ 0x100383e40", "SecretRewardsLayer::updateUnlockedLabel @ 0x100384cf4", "SecretRewardsLayer::updateUnlockedLabel @ 0x100384d44", "sub_1003850CC @ 0x1003850ec"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "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"}