{"type": "func", "start": 5370755040, "end": 5370755374, "name": "GameStatsManager::removeErrorFromSpecialChests", "pseudocode": "// \n// GameStatsManager::removeErrorFromSpecialChests from 0x1401f37e0 to 0x1401f392e (334 bytes)\n// \n// 3 xrefs:\n// > GameStatsManager::recountSpecialStats @ 0x1401e45b3\n// > GameStatsManager::dataLoaded @ 0x1401f3502\n// > <???> @ 0x1406cc6fc\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\n// Hidden C++ exception states: #wind=1\nvoid GameStatsManager::removeErrorFromSpecialChests(GameStatsManager *a1)\n{\n  cocos2d::CCArray *v2; // rsi\n  unsigned int i; // ebx\n  cocos2d::CCString *v4; // rax\n  const char *CString; // rax\n  size_t v6; // r8\n  void *v7; // rcx\n  __int128 v8; // [rsp+20h] [rbp-38h] BYREF\n  __int64 v9; // [rsp+30h] [rbp-28h]\n  unsigned __int64 v10; // [rsp+38h] [rbp-20h]\n\n  GameStatsManager::processOnlineChests(a1);\n  v2 = cocos2d::CCDictionary::allKeys(a1->m_miscChests);\n  for ( i = 0; i < cocos2d::CCArray::count(v2); ++i )\n  {\n    v4 = cocos2d::CCArray::stringAtIndex(v2, i);\n    CString = cocos2d::CCString::getCString(v4);\n    v8 = 0;\n    v9 = 0;\n    v10 = 0;\n    v6 = -1;\n    do\n      ++v6;\n    while ( CString[v6] );\n    sub_14003A930(&v8, CString, v6);\n    if ( !cocos2d::CCDictionary::objectForKey(a1->m_allSpecialChests, &v8)\n      && !cocos2d::CCDictionary::objectForKey(a1->m_wraithChests, &v8) )\n    {\n      cocos2d::CCDictionary::removeObjectForKey(a1->m_miscChests, &v8);\n    }\n    if ( v10 > 0xF )\n    {\n      v7 = (void *)v8;\n      if ( v10 + 1 >= 0x1000 )\n      {\n        v7 = *(void **)(v8 - 8);\n        if ( (unsigned __int64)(v8 - (_QWORD)v7 - 8) > 0x1F )\n          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v7);\n    }\n  }\n}", "assembly": "; \n; GameStatsManager::removeErrorFromSpecialChests from 0x1401f37e0 to 0x1401f392e (334 bytes)\n; \n; 3 xrefs:\n; > GameStatsManager::recountSpecialStats @ 0x1401e45b3\n; > GameStatsManager::dataLoaded @ 0x1401f3502\n; > <???> @ 0x1406cc6fc\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\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1401f37e0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1401f37e5\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x1401f37ea\npush    rdi                                                            ; +0xf, 0x1401f37ef\nsub     rsp, 50h                                                       ; +0x10, 0x1401f37f0\nmov     rax, cs:__security_cookie                                      ; +0x14, 0x1401f37f4\nxor     rax, rsp                                                       ; +0x1b, 0x1401f37fb\nmov     [rsp+58h+var_18], rax                                          ; +0x1e, 0x1401f37fe\nmov     rdi, rcx                                                       ; +0x23, 0x1401f3803\ncall    GameStatsManager__processOnlineChests                          ; +0x26, 0x1401f3806\nmov     rcx, [rdi+370h]                                                ; +0x2b, 0x1401f380b\ncall    cs:?allKeys@CCDictionary@cocos2d@@QEAAPEAVCCArray@2@XZ; cocos2d::CCDictionary::allKeys(void) ; +0x32, 0x1401f3812\nmov     rsi, rax                                                       ; +0x38, 0x1401f3818\nxor     ebp, ebp                                                       ; +0x3b, 0x1401f381b\nmov     ebx, ebp                                                       ; +0x3d, 0x1401f381d\nmov     rcx, rax                                                       ; +0x3f, 0x1401f381f\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x42, 0x1401f3822\ntest    eax, eax                                                       ; +0x48, 0x1401f3828\njz      loc_1401F3905                                                  ; +0x4a, 0x1401f382a\nmov     edx, ebx                                                       ; +0x50, 0x1401f3830\nmov     rcx, rsi                                                       ; +0x52, 0x1401f3832\ncall    cs:?stringAtIndex@CCArray@cocos2d@@QEAAPEAVCCString@2@I@Z; cocos2d::CCArray::stringAtIndex(uint) ; +0x55, 0x1401f3835\nmov     rcx, rax                                                       ; +0x5b, 0x1401f383b\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x5e, 0x1401f383e\nxorps   xmm0, xmm0                                                     ; +0x64, 0x1401f3844\nmovups  [rsp+58h+var_38], xmm0                                         ; +0x67, 0x1401f3847\nmov     [rsp+58h+var_28], rbp                                          ; +0x6c, 0x1401f384c\nmov     [rsp+58h+var_20], rbp                                          ; +0x71, 0x1401f3851\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x76, 0x1401f3856\nnop     dword ptr [rax]                                                ; +0x7d, 0x1401f385d\ninc     r8                                                             ; +0x80, 0x1401f3860\ncmp     byte ptr [rax+r8], 0                                           ; +0x83, 0x1401f3863\njnz     short loc_1401F3860                                            ; +0x88, 0x1401f3868\nmov     rdx, rax                                                       ; +0x8a, 0x1401f386a\nlea     rcx, [rsp+58h+var_38]                                          ; +0x8d, 0x1401f386d\ncall    sub_14003A930                                                  ; +0x92, 0x1401f3872\nnop                                                                    ; +0x97, 0x1401f3877\nlea     rdx, [rsp+58h+var_38]                                          ; +0x98, 0x1401f3878\nmov     rcx, [rdi+170h]                                                ; +0x9d, 0x1401f387d\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0xa4, 0x1401f3884\ntest    rax, rax                                                       ; +0xaa, 0x1401f388a\njnz     short loc_1401F38B9                                            ; +0xad, 0x1401f388d\nlea     rdx, [rsp+58h+var_38]                                          ; +0xaf, 0x1401f388f\nmov     rcx, [rdi+380h]                                                ; +0xb4, 0x1401f3894\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0xbb, 0x1401f389b\ntest    rax, rax                                                       ; +0xc1, 0x1401f38a1\njnz     short loc_1401F38B9                                            ; +0xc4, 0x1401f38a4\nlea     rdx, [rsp+58h+var_38]                                          ; +0xc6, 0x1401f38a6\nmov     rcx, [rdi+370h]                                                ; +0xcb, 0x1401f38ab\ncall    cs:?removeObjectForKey@CCDictionary@cocos2d@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::removeObjectForKey(std::string const &) ; +0xd2, 0x1401f38b2\nnop                                                                    ; +0xd8, 0x1401f38b8\nmov     rdx, [rsp+58h+var_20]                                          ; +0xd9, 0x1401f38b9\ncmp     rdx, 0Fh                                                       ; +0xde, 0x1401f38be\njbe     short loc_1401F38F2                                            ; +0xe2, 0x1401f38c2\ninc     rdx                                                            ; +0xe4, 0x1401f38c4\nmov     rcx, qword ptr [rsp+58h+var_38]                                ; +0xe7, 0x1401f38c7\nmov     rax, rcx                                                       ; +0xec, 0x1401f38cc\ncmp     rdx, 1000h                                                     ; +0xef, 0x1401f38cf\njb      short loc_1401F38ED                                            ; +0xf6, 0x1401f38d6\nadd     rdx, 27h ; '''                                                 ; +0xf8, 0x1401f38d8\nmov     rcx, [rcx-8]; Block                                            ; +0xfc, 0x1401f38dc\nsub     rax, rcx                                                       ; +0x100, 0x1401f38e0\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x103, 0x1401f38e3\ncmp     rax, 1Fh                                                       ; +0x107, 0x1401f38e7\nja      short loc_1401F3927                                            ; +0x10b, 0x1401f38eb\ncall    j_j_free                                                       ; +0x10d, 0x1401f38ed\ninc     ebx                                                            ; +0x112, 0x1401f38f2\nmov     rcx, rsi                                                       ; +0x114, 0x1401f38f4\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x117, 0x1401f38f7\ncmp     ebx, eax                                                       ; +0x11d, 0x1401f38fd\njb      loc_1401F3830                                                  ; +0x11f, 0x1401f38ff\nmov     rcx, [rsp+58h+var_18]                                          ; +0x125, 0x1401f3905\nxor     rcx, rsp; StackCookie                                          ; +0x12a, 0x1401f390a\ncall    __security_check_cookie                                        ; +0x12d, 0x1401f390d\nmov     rbx, [rsp+58h+arg_8]                                           ; +0x132, 0x1401f3912\nmov     rbp, [rsp+58h+arg_10]                                          ; +0x137, 0x1401f3917\nmov     rsi, [rsp+58h+arg_18]                                          ; +0x13c, 0x1401f391c\nadd     rsp, 50h                                                       ; +0x141, 0x1401f3921\npop     rdi                                                            ; +0x145, 0x1401f3925\nretn                                                                   ; +0x146, 0x1401f3926\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x147, 0x1401f3927\ndb 0CCh                                                                ; +0x14d, 0x1401f392d", "xrefs": ["GameStatsManager::recountSpecialStats @ 0x1401e45b3", "GameStatsManager::dataLoaded @ 0x1401f3502", "<???> @ 0x1406cc6fc"], "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"}