{"type": "func", "start": 5370717664, "end": 5370717874, "name": "GameStatsManager::unlockSpecialChest", "pseudocode": "// \n// GameStatsManager::unlockSpecialChest from 0x1401ea5e0 to 0x1401ea6b2 (210 bytes)\n// \n// 11 xrefs:\n// > FollowRewardPage::onSpecialItem @ 0x14013cf30\n// > GameStatsManager::unlockOnlineChest @ 0x1401ea7dc\n// > GauntletSelectLayer::onPlay @ 0x1401fadf9\n// > GJPathRewardPopup::onClaim @ 0x14028a486\n// > GJShopLayer::dialogClosed @ 0x1402ae885\n// > SecretRewardsLayer::onSpecialItem @ 0x1403d6dfc\n// > SecretLayer3::onChest01 @ 0x1403eb5a1\n// > SecretLayer3::onChest02 @ 0x1403eb721\n// > SecretLayer4::onChest01 @ 0x1403f0c84\n// > SupportLayer::onGetReward @ 0x1404c99f5\n// > <???> @ 0x1406cc66c\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\nGJRewardItem *__fastcall GameStatsManager::unlockSpecialChest(GameStatsManager *a1, __int64 a2)\n{\n  _QWORD *v4; // rax\n  GJRewardItem *v5; // rsi\n  __int64 v7; // [rsp+20h] [rbp-58h]\n  _BYTE v8[32]; // [rsp+28h] [rbp-50h] BYREF\n  __int64 v9; // [rsp+48h] [rbp-30h]\n\n  v9 = a2;\n  v4 = (_QWORD *)sub_14003BDB0((__int64)v8, a2);\n  if ( GameStatsManager::isSpecialChestUnlocked((__int64)a1, v4)\n    || (v7 = sub_14003BDB0((__int64)v8, a2),\n        v5 = (GJRewardItem *)cocos2d::CCDictionary::objectForKey(a1->m_allSpecialChests, v7),\n        sub_14003A830(v7),\n        !v5) )\n  {\n    sub_14003A830(a2);\n    return nullptr;\n  }\n  else\n  {\n    GameStatsManager::preProcessReward(a1, v5);\n    GameStatsManager::registerRewardsFromItem(a1, v5);\n    cocos2d::CCDictionary::setObject(a1->m_miscChests, v5, a2);\n    sub_14003A830(a2);\n    return v5;\n  }\n}", "assembly": "; \n; GameStatsManager::unlockSpecialChest from 0x1401ea5e0 to 0x1401ea6b2 (210 bytes)\n; \n; 11 xrefs:\n; > FollowRewardPage::onSpecialItem @ 0x14013cf30\n; > GameStatsManager::unlockOnlineChest @ 0x1401ea7dc\n; > GauntletSelectLayer::onPlay @ 0x1401fadf9\n; > GJPathRewardPopup::onClaim @ 0x14028a486\n; > GJShopLayer::dialogClosed @ 0x1402ae885\n; > SecretRewardsLayer::onSpecialItem @ 0x1403d6dfc\n; > SecretLayer3::onChest01 @ 0x1403eb5a1\n; > SecretLayer3::onChest02 @ 0x1403eb721\n; > SecretLayer4::onChest01 @ 0x1403f0c84\n; > SupportLayer::onGetReward @ 0x1404c99f5\n; > <???> @ 0x1406cc66c\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_10], rbx                                              ; +0x0, 0x1401ea5e0\npush    rbp                                                            ; +0x5, 0x1401ea5e5\npush    rsi                                                            ; +0x6, 0x1401ea5e6\npush    rdi                                                            ; +0x7, 0x1401ea5e7\nsub     rsp, 60h                                                       ; +0x8, 0x1401ea5e8\nmov     rax, cs:__security_cookie                                      ; +0xc, 0x1401ea5ec\nxor     rax, rsp                                                       ; +0x13, 0x1401ea5f3\nmov     [rsp+78h+var_28], rax                                          ; +0x16, 0x1401ea5f6\nmov     rdi, rdx                                                       ; +0x1b, 0x1401ea5fb\nmov     rbp, rcx                                                       ; +0x1e, 0x1401ea5fe\nmov     [rsp+78h+var_30], rdx                                          ; +0x21, 0x1401ea601\nlea     rcx, [rsp+78h+var_50]                                          ; +0x26, 0x1401ea606\ncall    sub_14003BDB0                                                  ; +0x2b, 0x1401ea60b\nmov     rdx, rax                                                       ; +0x30, 0x1401ea610\nmov     rcx, rbp                                                       ; +0x33, 0x1401ea613\ncall    GameStatsManager__isSpecialChestUnlocked                       ; +0x36, 0x1401ea616\ntest    al, al                                                         ; +0x3b, 0x1401ea61b\njnz     short loc_1401EA68B                                            ; +0x3d, 0x1401ea61d\nmov     rdx, rdi                                                       ; +0x3f, 0x1401ea61f\nlea     rcx, [rsp+78h+var_50]                                          ; +0x42, 0x1401ea622\ncall    sub_14003BDB0                                                  ; +0x47, 0x1401ea627\nmov     rbx, rax                                                       ; +0x4c, 0x1401ea62c\nmov     [rsp+78h+var_58], rax                                          ; +0x4f, 0x1401ea62f\nmov     rdx, rax                                                       ; +0x54, 0x1401ea634\nmov     rcx, [rbp+170h]                                                ; +0x57, 0x1401ea637\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 &) ; +0x5e, 0x1401ea63e\nmov     rsi, rax                                                       ; +0x64, 0x1401ea644\nmov     rcx, rbx                                                       ; +0x67, 0x1401ea647\ncall    sub_14003A830                                                  ; +0x6a, 0x1401ea64a\ntest    rsi, rsi                                                       ; +0x6f, 0x1401ea64f\njz      short loc_1401EA68B                                            ; +0x72, 0x1401ea652\nmov     rdx, rsi                                                       ; +0x74, 0x1401ea654\nmov     rcx, rbp                                                       ; +0x77, 0x1401ea657\ncall    GameStatsManager__preProcessReward                             ; +0x7a, 0x1401ea65a\nmov     rdx, rsi                                                       ; +0x7f, 0x1401ea65f\nmov     rcx, rbp                                                       ; +0x82, 0x1401ea662\ncall    GameStatsManager__registerRewardsFromItem                      ; +0x85, 0x1401ea665\nmov     r8, rdi                                                        ; +0x8a, 0x1401ea66a\nmov     rdx, rsi                                                       ; +0x8d, 0x1401ea66d\nmov     rcx, [rbp+370h]                                                ; +0x90, 0x1401ea670\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 &) ; +0x97, 0x1401ea677\nnop                                                                    ; +0x9d, 0x1401ea67d\nmov     rcx, rdi                                                       ; +0x9e, 0x1401ea67e\ncall    sub_14003A830                                                  ; +0xa1, 0x1401ea681\nmov     rax, rsi                                                       ; +0xa6, 0x1401ea686\njmp     short loc_1401EA695                                            ; +0xa9, 0x1401ea689\nmov     rcx, rdi                                                       ; +0xab, 0x1401ea68b\ncall    sub_14003A830                                                  ; +0xae, 0x1401ea68e\nxor     eax, eax                                                       ; +0xb3, 0x1401ea693\nmov     rcx, [rsp+78h+var_28]                                          ; +0xb5, 0x1401ea695\nxor     rcx, rsp; StackCookie                                          ; +0xba, 0x1401ea69a\ncall    __security_check_cookie                                        ; +0xbd, 0x1401ea69d\nmov     rbx, [rsp+78h+arg_10]                                          ; +0xc2, 0x1401ea6a2\nadd     rsp, 60h                                                       ; +0xca, 0x1401ea6aa\npop     rdi                                                            ; +0xce, 0x1401ea6ae\npop     rsi                                                            ; +0xcf, 0x1401ea6af\npop     rbp                                                            ; +0xd0, 0x1401ea6b0\nretn                                                                   ; +0xd1, 0x1401ea6b1", "xrefs": ["FollowRewardPage::onSpecialItem @ 0x14013cf30", "GameStatsManager::unlockOnlineChest @ 0x1401ea7dc", "GauntletSelectLayer::onPlay @ 0x1401fadf9", "GJPathRewardPopup::onClaim @ 0x14028a486", "GJShopLayer::dialogClosed @ 0x1402ae885", "SecretRewardsLayer::onSpecialItem @ 0x1403d6dfc", "SecretLayer3::onChest01 @ 0x1403eb5a1", "SecretLayer3::onChest02 @ 0x1403eb721", "SecretLayer4::onChest01 @ 0x1403f0c84", "SupportLayer::onGetReward @ 0x1404c99f5", "<???> @ 0x1406cc66c"], "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"}