{"type": "func", "start": 5370716048, "end": 5370716317, "name": "GameStatsManager::linkSpecialChestUnlocks", "pseudocode": "// \n// GameStatsManager::linkSpecialChestUnlocks from 0x1401e9f90 to 0x1401ea09d (269 bytes)\n// \n// 4 xrefs:\n// > GameStatsManager::createSpecialChestItems @ 0x1401e9f1d\n// > GameStatsManager::unlockOnlineChest @ 0x1401ea824\n// > GameStatsManager::processOnlineChests @ 0x1401f374f\n// > <???> @ 0x1406cc624\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=2\nvoid __fastcall GameStatsManager::linkSpecialChestUnlocks(__int64 a1, __int64 a2, void **a3)\n{\n  cocos2d::CCArray *v5; // rsi\n  unsigned int v6; // ebx\n  struct cocos2d::CCObject *v7; // rax\n  __int64 v8; // rcx\n  __int64 v9; // rax\n  void **v10; // rcx\n  void *v11; // rdx\n  _BYTE v12[16]; // [rsp+20h] [rbp-58h] BYREF\n  void **v13; // [rsp+30h] [rbp-48h]\n  _QWORD v14[4]; // [rsp+38h] [rbp-40h] BYREF\n\n  v13 = a3;\n  if ( a2 )\n  {\n    v5 = *(cocos2d::CCArray **)(a2 + 72);\n    if ( v5 )\n    {\n      v6 = 0;\n      if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a2 + 72)) )\n      {\n        do\n        {\n          v7 = cocos2d::CCArray::objectAtIndex(v5, v6);\n          if ( LODWORD(v7[1].__vftable) == 9 )\n          {\n            GameStatsManager::getItemKey(v8, v14, v7[1].m_uID, HIDWORD(v7[1].__vftable));\n            v9 = cocos2d::CCString::create(a3);\n            cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 376), v9, v14);\n            v10 = (void **)(*(_QWORD *)sub_1401F4F70(a1 + 448, v12, v14) + 48LL);\n            if ( v10 != a3 )\n            {\n              v11 = a3;\n              if ( (unsigned __int64)a3[3] > 0xF )\n                v11 = *a3;\n              sub_14003CCE0(v10, v11, (size_t)a3[2]);\n            }\n            sub_14003A830((__int64)v14);\n          }\n          ++v6;\n        }\n        while ( v6 < cocos2d::CCArray::count(v5) );\n      }\n    }\n  }\n  sub_14003A830((__int64)a3);\n}", "assembly": "; \n; GameStatsManager::linkSpecialChestUnlocks from 0x1401e9f90 to 0x1401ea09d (269 bytes)\n; \n; 4 xrefs:\n; > GameStatsManager::createSpecialChestItems @ 0x1401e9f1d\n; > GameStatsManager::unlockOnlineChest @ 0x1401ea824\n; > GameStatsManager::processOnlineChests @ 0x1401f374f\n; > <???> @ 0x1406cc624\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_18], rbx                                              ; +0x0, 0x1401e9f90\npush    rbp                                                            ; +0x5, 0x1401e9f95\npush    rsi                                                            ; +0x6, 0x1401e9f96\npush    rdi                                                            ; +0x7, 0x1401e9f97\nsub     rsp, 60h                                                       ; +0x8, 0x1401e9f98\nmov     rax, cs:__security_cookie                                      ; +0xc, 0x1401e9f9c\nxor     rax, rsp                                                       ; +0x13, 0x1401e9fa3\nmov     [rsp+78h+var_20], rax                                          ; +0x16, 0x1401e9fa6\nmov     rdi, r8                                                        ; +0x1b, 0x1401e9fab\nmov     rbp, rcx                                                       ; +0x1e, 0x1401e9fae\nmov     [rsp+78h+var_48], r8                                           ; +0x21, 0x1401e9fb1\ntest    rdx, rdx                                                       ; +0x26, 0x1401e9fb6\njz      loc_1401EA078                                                  ; +0x29, 0x1401e9fb9\nmov     rsi, [rdx+48h]                                                 ; +0x2f, 0x1401e9fbf\ntest    rsi, rsi                                                       ; +0x33, 0x1401e9fc3\njz      loc_1401EA078                                                  ; +0x36, 0x1401e9fc6\nxor     ebx, ebx                                                       ; +0x3c, 0x1401e9fcc\nmov     rcx, rsi                                                       ; +0x3e, 0x1401e9fce\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x41, 0x1401e9fd1\ntest    eax, eax                                                       ; +0x47, 0x1401e9fd7\njz      loc_1401EA078                                                  ; +0x49, 0x1401e9fd9\nnop                                                                    ; +0x4f, 0x1401e9fdf\nmov     edx, ebx                                                       ; +0x50, 0x1401e9fe0\nmov     rcx, rsi                                                       ; +0x52, 0x1401e9fe2\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x55, 0x1401e9fe5\ncmp     dword ptr [rax+38h], 9                                         ; +0x5b, 0x1401e9feb\njnz     short loc_1401EA065                                            ; +0x5f, 0x1401e9fef\nmov     r9d, [rax+3Ch]                                                 ; +0x61, 0x1401e9ff1\nmov     r8d, [rax+40h]                                                 ; +0x65, 0x1401e9ff5\nlea     rdx, [rsp+78h+var_40]                                          ; +0x69, 0x1401e9ff9\ncall    GameStatsManager__getItemKey                                   ; +0x6e, 0x1401e9ffe\nnop                                                                    ; +0x73, 0x1401ea003\nmov     rcx, rdi                                                       ; +0x74, 0x1401ea004\ncall    cs:?create@CCString@cocos2d@@SAPEAV12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCString::create(std::string const &) ; +0x77, 0x1401ea007\nmov     rdx, rax                                                       ; +0x7d, 0x1401ea00d\nlea     r8, [rsp+78h+var_40]                                           ; +0x80, 0x1401ea010\nmov     rcx, [rbp+178h]                                                ; +0x85, 0x1401ea015\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0x8c, 0x1401ea01c\nlea     rcx, [rbp+1C0h]                                                ; +0x92, 0x1401ea022\nlea     r8, [rsp+78h+var_40]                                           ; +0x99, 0x1401ea029\nlea     rdx, [rsp+78h+var_58]                                          ; +0x9e, 0x1401ea02e\ncall    sub_1401F4F70                                                  ; +0xa3, 0x1401ea033\nmov     rcx, [rax]                                                     ; +0xa8, 0x1401ea038\nadd     rcx, 30h ; '0'; void *                                         ; +0xab, 0x1401ea03b\ncmp     rcx, rdi                                                       ; +0xaf, 0x1401ea03f\njz      short loc_1401EA05B                                            ; +0xb2, 0x1401ea042\nmov     rdx, rdi                                                       ; +0xb4, 0x1401ea044\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0xb7, 0x1401ea047\njbe     short loc_1401EA051                                            ; +0xbc, 0x1401ea04c\nmov     rdx, [rdi]; Src                                                ; +0xbe, 0x1401ea04e\nmov     r8, [rdi+10h]; Size                                            ; +0xc1, 0x1401ea051\ncall    sub_14003CCE0                                                  ; +0xc5, 0x1401ea055\nnop                                                                    ; +0xca, 0x1401ea05a\nlea     rcx, [rsp+78h+var_40]                                          ; +0xcb, 0x1401ea05b\ncall    sub_14003A830                                                  ; +0xd0, 0x1401ea060\ninc     ebx                                                            ; +0xd5, 0x1401ea065\nmov     rcx, rsi                                                       ; +0xd7, 0x1401ea067\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xda, 0x1401ea06a\ncmp     ebx, eax                                                       ; +0xe0, 0x1401ea070\njb      loc_1401E9FE0                                                  ; +0xe2, 0x1401ea072\nmov     rcx, rdi                                                       ; +0xe8, 0x1401ea078\ncall    sub_14003A830                                                  ; +0xeb, 0x1401ea07b\nmov     rcx, [rsp+78h+var_20]                                          ; +0xf0, 0x1401ea080\nxor     rcx, rsp; StackCookie                                          ; +0xf5, 0x1401ea085\ncall    __security_check_cookie                                        ; +0xf8, 0x1401ea088\nmov     rbx, [rsp+78h+arg_18]                                          ; +0xfd, 0x1401ea08d\nadd     rsp, 60h                                                       ; +0x105, 0x1401ea095\npop     rdi                                                            ; +0x109, 0x1401ea099\npop     rsi                                                            ; +0x10a, 0x1401ea09a\npop     rbp                                                            ; +0x10b, 0x1401ea09b\nretn                                                                   ; +0x10c, 0x1401ea09c", "xrefs": ["GameStatsManager::createSpecialChestItems @ 0x1401e9f1d", "GameStatsManager::unlockOnlineChest @ 0x1401ea824", "GameStatsManager::processOnlineChests @ 0x1401f374f", "<???> @ 0x1406cc624"], "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"}