{"type": "func", "start": 4295460032, "end": 4295460274, "name": "GameStatsManager::unlockSpecialChest", "pseudocode": "// \n// GameStatsManager::unlockSpecialChest from 0x1000784c0 to 0x1000785b2 (242 bytes)\n// \n// 11 xrefs:\n// > GameStatsManager::unlockOnlineChest @ 0x100074838\n// > GameStatsManager::unlockGauntletChest @ 0x10007878e\n// > GameStatsManager::unlockPathChest @ 0x100078953\n// > GJShopLayer::dialogClosed @ 0x1003271d2\n// > GameManager::rewardedVideoHidden @ 0x100380612\n// > SupportLayer::onGetReward @ 0x10039a6eb\n// > SecretLayer4::onChest01 @ 0x1003b2efa\n// > FollowRewardPage::onSpecialItem @ 0x100420da3\n// > SecretLayer3::onChest01 @ 0x1004a5d77\n// > SecretLayer3::onChest02 @ 0x1004a5e47\n// > SecretRewardsLayer::onSpecialItem @ 0x100632ddc\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\nGJRewardItem *__fastcall GameStatsManager::unlockSpecialChest(GameStatsManager *a1, __int64 a2, __m128 a3)\n{\n  bool isSpecialChestUnlocked; // r15\n  GJRewardItem *v4; // r15\n  __m128 v6; // [rsp+0h] [rbp-60h] BYREF\n  void *__p; // [rsp+10h] [rbp-50h]\n  __m128 v8; // [rsp+20h] [rbp-40h] BYREF\n  void *v9; // [rsp+30h] [rbp-30h]\n\n  if ( (*(_BYTE *)a2 & 1) != 0 )\n  {\n    sub_100006B70(&v6, *(const void **)(a2 + 16), *(_QWORD *)(a2 + 8), *(double *)a3.i64);\n  }\n  else\n  {\n    __p = *(void **)(a2 + 16);\n    a3 = *(__m128 *)a2;\n    v6 = *(__m128 *)a2;\n  }\n  isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked((__int64)a1, (__int64)&v6, *(double *)a3.i64);\n  if ( (v6.i8[0] & 1) != 0 )\n    operator delete(__p);\n  if ( isSpecialChestUnlocked )\n    return nullptr;\n  if ( (*(_BYTE *)a2 & 1) != 0 )\n  {\n    sub_100006B70(&v8, *(const void **)(a2 + 16), *(_QWORD *)(a2 + 8), *(double *)a3.i64);\n  }\n  else\n  {\n    v9 = *(void **)(a2 + 16);\n    v8 = *(__m128 *)a2;\n  }\n  v4 = (GJRewardItem *)cocos2d::CCDictionary::objectForKey_1(a1->m_allSpecialChests, &v8);\n  if ( (v8.i8[0] & 1) != 0 )\n    operator delete(v9);\n  if ( !v4 )\n    return nullptr;\n  GameStatsManager::preProcessReward(a1, v4);\n  GameStatsManager::registerRewardsFromItem(a1, v4);\n  cocos2d::CCDictionary::setObject_1(a1->m_miscChests, v4, a2);\n  return v4;\n}", "assembly": "; \n; GameStatsManager::unlockSpecialChest from 0x1000784c0 to 0x1000785b2 (242 bytes)\n; \n; 11 xrefs:\n; > GameStatsManager::unlockOnlineChest @ 0x100074838\n; > GameStatsManager::unlockGauntletChest @ 0x10007878e\n; > GameStatsManager::unlockPathChest @ 0x100078953\n; > GJShopLayer::dialogClosed @ 0x1003271d2\n; > GameManager::rewardedVideoHidden @ 0x100380612\n; > SupportLayer::onGetReward @ 0x10039a6eb\n; > SecretLayer4::onChest01 @ 0x1003b2efa\n; > FollowRewardPage::onSpecialItem @ 0x100420da3\n; > SecretLayer3::onChest01 @ 0x1004a5d77\n; > SecretLayer3::onChest02 @ 0x1004a5e47\n; > SecretRewardsLayer::onSpecialItem @ 0x100632ddc\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\npush    rbp                                                            ; +0x0, 0x1000784c0\nmov     rbp, rsp                                                       ; +0x1, 0x1000784c1\npush    r15                                                            ; +0x4, 0x1000784c4\npush    r14                                                            ; +0x6, 0x1000784c6\npush    r12                                                            ; +0x8, 0x1000784c8\npush    rbx                                                            ; +0xa, 0x1000784ca\nsub     rsp, 40h                                                       ; +0xb, 0x1000784cb\nmov     rbx, rsi                                                       ; +0xf, 0x1000784cf\nmov     r14, rdi                                                       ; +0x12, 0x1000784d2\ntest    byte ptr [rsi], 1                                              ; +0x15, 0x1000784d5\njnz     short loc_1000784EB                                            ; +0x18, 0x1000784d8\nmov     rax, [rbx+10h]                                                 ; +0x1a, 0x1000784da\nmov     [rbp+__p], rax                                                 ; +0x1e, 0x1000784de\nmovups  xmm0, xmmword ptr [rbx]                                        ; +0x22, 0x1000784e2\nmovaps  [rbp+var_60], xmm0                                             ; +0x25, 0x1000784e5\njmp     short loc_1000784FC                                            ; +0x29, 0x1000784e9\nmov     rdx, [rbx+8]                                                   ; +0x2b, 0x1000784eb\nmov     rsi, [rbx+10h]                                                 ; +0x2f, 0x1000784ef\nlea     rdi, [rbp+var_60]                                              ; +0x33, 0x1000784f3\ncall    sub_100006B70                                                  ; +0x37, 0x1000784f7\nlea     r12, [rbp+__p]                                                 ; +0x3c, 0x1000784fc\nlea     rsi, [rbp+var_60]                                              ; +0x40, 0x100078500\nmov     rdi, r14                                                       ; +0x44, 0x100078504\ncall    GameStatsManager__isSpecialChestUnlocked                       ; +0x47, 0x100078507\nmov     r15d, eax                                                      ; +0x4c, 0x10007850c\ntest    byte ptr [rbp+var_60], 1                                       ; +0x4f, 0x10007850f\njz      short loc_10007851E                                            ; +0x53, 0x100078513\nmov     rdi, [rbp+__p]; __p                                            ; +0x55, 0x100078515\ncall    __ZdlPv; operator delete(void *)                               ; +0x59, 0x100078519\ntest    r15b, r15b                                                     ; +0x5e, 0x10007851e\njnz     short loc_10007859F                                            ; +0x61, 0x100078521\ntest    byte ptr [rbx], 1                                              ; +0x63, 0x100078523\njnz     short loc_100078539                                            ; +0x66, 0x100078526\nmov     rax, [rbx+10h]                                                 ; +0x68, 0x100078528\nmov     [rbp+var_30], rax                                              ; +0x6c, 0x10007852c\nmovups  xmm0, xmmword ptr [rbx]                                        ; +0x70, 0x100078530\nmovaps  [rbp+var_40], xmm0                                             ; +0x73, 0x100078533\njmp     short loc_10007854A                                            ; +0x77, 0x100078537\nmov     rdx, [rbx+8]                                                   ; +0x79, 0x100078539\nmov     rsi, [rbx+10h]                                                 ; +0x7d, 0x10007853d\nlea     rdi, [rbp+var_40]                                              ; +0x81, 0x100078541\ncall    sub_100006B70                                                  ; +0x85, 0x100078545\nlea     r12, [rbp+var_30]                                              ; +0x8a, 0x10007854a\nmov     rdi, [r14+168h]                                                ; +0x8e, 0x10007854e\nlea     rsi, [rbp+var_40]                                              ; +0x95, 0x100078555\ncall    cocos2d__CCDictionary__objectForKey_1                          ; +0x99, 0x100078559\nmov     r15, rax                                                       ; +0x9e, 0x10007855e\ntest    byte ptr [rbp+var_40], 1                                       ; +0xa1, 0x100078561\njz      short loc_100078570                                            ; +0xa5, 0x100078565\nmov     rdi, [rbp+var_30]; __p                                         ; +0xa7, 0x100078567\ncall    __ZdlPv; operator delete(void *)                               ; +0xab, 0x10007856b\ntest    r15, r15                                                       ; +0xb0, 0x100078570\njz      short loc_10007859F                                            ; +0xb3, 0x100078573\nmov     rdi, r14                                                       ; +0xb5, 0x100078575\nmov     rsi, r15                                                       ; +0xb8, 0x100078578\ncall    GameStatsManager__preProcessReward                             ; +0xbb, 0x10007857b\nmov     rdi, r14                                                       ; +0xc0, 0x100078580\nmov     rsi, r15                                                       ; +0xc3, 0x100078583\ncall    GameStatsManager__registerRewardsFromItem                      ; +0xc6, 0x100078586\nmov     rdi, [r14+308h]                                                ; +0xcb, 0x10007858b\nmov     rsi, r15                                                       ; +0xd2, 0x100078592\nmov     rdx, rbx                                                       ; +0xd5, 0x100078595\ncall    cocos2d__CCDictionary__setObject_1                             ; +0xd8, 0x100078598\njmp     short loc_1000785A2                                            ; +0xdd, 0x10007859d\nxor     r15d, r15d                                                     ; +0xdf, 0x10007859f\nmov     rax, r15                                                       ; +0xe2, 0x1000785a2\nadd     rsp, 40h                                                       ; +0xe5, 0x1000785a5\npop     rbx                                                            ; +0xe9, 0x1000785a9\npop     r12                                                            ; +0xea, 0x1000785aa\npop     r14                                                            ; +0xec, 0x1000785ac\npop     r15                                                            ; +0xee, 0x1000785ae\npop     rbp                                                            ; +0xf0, 0x1000785b0\nretn                                                                   ; +0xf1, 0x1000785b1", "xrefs": ["GameStatsManager::unlockOnlineChest @ 0x100074838", "GameStatsManager::unlockGauntletChest @ 0x10007878e", "GameStatsManager::unlockPathChest @ 0x100078953", "GJShopLayer::dialogClosed @ 0x1003271d2", "GameManager::rewardedVideoHidden @ 0x100380612", "SupportLayer::onGetReward @ 0x10039a6eb", "SecretLayer4::onChest01 @ 0x1003b2efa", "FollowRewardPage::onSpecialItem @ 0x100420da3", "SecretLayer3::onChest01 @ 0x1004a5d77", "SecretLayer3::onChest02 @ 0x1004a5e47", "SecretRewardsLayer::onSpecialItem @ 0x100632ddc"], "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"}