{"type": "func", "start": 4295222544, "end": 4295222786, "name": "GameStatsManager::unlockSpecialChest", "pseudocode": "// \n// GameStatsManager::unlockSpecialChest from 0x10003e510 to 0x10003e602 (242 bytes)\n// \n// 11 xrefs:\n// > GameStatsManager::unlockOnlineChest @ 0x10003a408\n// > GameStatsManager::unlockGauntletChest @ 0x10003e7de\n// > GameStatsManager::unlockPathChest @ 0x10003e9a3\n// > GJShopLayer::dialogClosed @ 0x1003128e2\n// > GameManager::rewardedVideoHidden @ 0x100369982\n// > SupportLayer::onGetReward @ 0x10038417b\n// > SecretLayer4::onChest01 @ 0x10039c2fa\n// > FollowRewardPage::onSpecialItem @ 0x10040d9a2\n// > SecretLayer3::onChest01 @ 0x10049ed47\n// > SecretLayer3::onChest02 @ 0x10049ee17\n// > SecretRewardsLayer::onSpecialItem @ 0x10070fa0c\n// \n// This function is hookable on this platform (idp: pc, 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 12:19:35 +0000\n// \n\n__int64 __fastcall GameStatsManager::unlockSpecialChest(__int64 a1, __int64 a2, __m128 a3)\n{\n  bool isSpecialChestUnlocked; // r15\n  __int64 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_10001AD30(&v6, *(const void **)(a2 + 16), *(_QWORD *)(a2 + 8));\n  }\n  else\n  {\n    __p = *(void **)(a2 + 16);\n    a3 = *(__m128 *)a2;\n    v6 = *(__m128 *)a2;\n  }\n  isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked(a1, (__int64)&v6);\n  if ( (v6.i8[0] & 1) != 0 )\n    operator delete(__p);\n  if ( isSpecialChestUnlocked )\n    return 0;\n  if ( (*(_BYTE *)a2 & 1) != 0 )\n  {\n    sub_10001AD30(&v8, *(const void **)(a2 + 16), *(_QWORD *)(a2 + 8));\n  }\n  else\n  {\n    v9 = *(void **)(a2 + 16);\n    a3 = *(__m128 *)a2;\n    v8 = *(__m128 *)a2;\n  }\n  v4 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 360), &v8);\n  if ( (v8.i8[0] & 1) != 0 )\n    operator delete(v9);\n  if ( !v4 )\n    return 0;\n  GameStatsManager::preProcessReward(a1, v4, a3);\n  GameStatsManager::registerRewardsFromItem(a1, v4, a3);\n  cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 784), v4, a2);\n  return v4;\n}", "assembly": "; \n; GameStatsManager::unlockSpecialChest from 0x10003e510 to 0x10003e602 (242 bytes)\n; \n; 11 xrefs:\n; > GameStatsManager::unlockOnlineChest @ 0x10003a408\n; > GameStatsManager::unlockGauntletChest @ 0x10003e7de\n; > GameStatsManager::unlockPathChest @ 0x10003e9a3\n; > GJShopLayer::dialogClosed @ 0x1003128e2\n; > GameManager::rewardedVideoHidden @ 0x100369982\n; > SupportLayer::onGetReward @ 0x10038417b\n; > SecretLayer4::onChest01 @ 0x10039c2fa\n; > FollowRewardPage::onSpecialItem @ 0x10040d9a2\n; > SecretLayer3::onChest01 @ 0x10049ed47\n; > SecretLayer3::onChest02 @ 0x10049ee17\n; > SecretRewardsLayer::onSpecialItem @ 0x10070fa0c\n; \n; This function is hookable on this platform (idp: pc, 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 12:19:35 +0000\n; \npush    rbp                                                            ; +0x0, 0x10003e510\nmov     rbp, rsp                                                       ; +0x1, 0x10003e511\npush    r15                                                            ; +0x4, 0x10003e514\npush    r14                                                            ; +0x6, 0x10003e516\npush    r12                                                            ; +0x8, 0x10003e518\npush    rbx                                                            ; +0xa, 0x10003e51a\nsub     rsp, 40h                                                       ; +0xb, 0x10003e51b\nmov     rbx, rsi                                                       ; +0xf, 0x10003e51f\nmov     r14, rdi                                                       ; +0x12, 0x10003e522\ntest    byte ptr [rsi], 1                                              ; +0x15, 0x10003e525\njnz     short loc_10003E53B                                            ; +0x18, 0x10003e528\nmov     rax, [rbx+10h]                                                 ; +0x1a, 0x10003e52a\nmov     [rbp+__p], rax                                                 ; +0x1e, 0x10003e52e\nmovups  xmm0, xmmword ptr [rbx]                                        ; +0x22, 0x10003e532\nmovaps  [rbp+var_60], xmm0                                             ; +0x25, 0x10003e535\njmp     short loc_10003E54C                                            ; +0x29, 0x10003e539\nmov     rdx, [rbx+8]                                                   ; +0x2b, 0x10003e53b\nmov     rsi, [rbx+10h]                                                 ; +0x2f, 0x10003e53f\nlea     rdi, [rbp+var_60]                                              ; +0x33, 0x10003e543\ncall    sub_10001AD30                                                  ; +0x37, 0x10003e547\nlea     r12, [rbp+__p]                                                 ; +0x3c, 0x10003e54c\nlea     rsi, [rbp+var_60]                                              ; +0x40, 0x10003e550\nmov     rdi, r14                                                       ; +0x44, 0x10003e554\ncall    GameStatsManager__isSpecialChestUnlocked                       ; +0x47, 0x10003e557\nmov     r15d, eax                                                      ; +0x4c, 0x10003e55c\ntest    byte ptr [rbp+var_60], 1                                       ; +0x4f, 0x10003e55f\njz      short loc_10003E56E                                            ; +0x53, 0x10003e563\nmov     rdi, [rbp+__p]; __p                                            ; +0x55, 0x10003e565\ncall    __ZdlPv; operator delete(void *)                               ; +0x59, 0x10003e569\ntest    r15b, r15b                                                     ; +0x5e, 0x10003e56e\njnz     short loc_10003E5EF                                            ; +0x61, 0x10003e571\ntest    byte ptr [rbx], 1                                              ; +0x63, 0x10003e573\njnz     short loc_10003E589                                            ; +0x66, 0x10003e576\nmov     rax, [rbx+10h]                                                 ; +0x68, 0x10003e578\nmov     [rbp+var_30], rax                                              ; +0x6c, 0x10003e57c\nmovups  xmm0, xmmword ptr [rbx]                                        ; +0x70, 0x10003e580\nmovaps  [rbp+var_40], xmm0                                             ; +0x73, 0x10003e583\njmp     short loc_10003E59A                                            ; +0x77, 0x10003e587\nmov     rdx, [rbx+8]                                                   ; +0x79, 0x10003e589\nmov     rsi, [rbx+10h]                                                 ; +0x7d, 0x10003e58d\nlea     rdi, [rbp+var_40]                                              ; +0x81, 0x10003e591\ncall    sub_10001AD30                                                  ; +0x85, 0x10003e595\nlea     r12, [rbp+var_30]                                              ; +0x8a, 0x10003e59a\nmov     rdi, [r14+168h]                                                ; +0x8e, 0x10003e59e\nlea     rsi, [rbp+var_40]                                              ; +0x95, 0x10003e5a5\ncall    cocos2d__CCDictionary__objectForKey                            ; +0x99, 0x10003e5a9\nmov     r15, rax                                                       ; +0x9e, 0x10003e5ae\ntest    byte ptr [rbp+var_40], 1                                       ; +0xa1, 0x10003e5b1\njz      short loc_10003E5C0                                            ; +0xa5, 0x10003e5b5\nmov     rdi, [rbp+var_30]; __p                                         ; +0xa7, 0x10003e5b7\ncall    __ZdlPv; operator delete(void *)                               ; +0xab, 0x10003e5bb\ntest    r15, r15                                                       ; +0xb0, 0x10003e5c0\njz      short loc_10003E5EF                                            ; +0xb3, 0x10003e5c3\nmov     rdi, r14                                                       ; +0xb5, 0x10003e5c5\nmov     rsi, r15                                                       ; +0xb8, 0x10003e5c8\ncall    GameStatsManager__preProcessReward                             ; +0xbb, 0x10003e5cb\nmov     rdi, r14                                                       ; +0xc0, 0x10003e5d0\nmov     rsi, r15                                                       ; +0xc3, 0x10003e5d3\ncall    GameStatsManager__registerRewardsFromItem                      ; +0xc6, 0x10003e5d6\nmov     rdi, [r14+310h]                                                ; +0xcb, 0x10003e5db\nmov     rsi, r15                                                       ; +0xd2, 0x10003e5e2\nmov     rdx, rbx                                                       ; +0xd5, 0x10003e5e5\ncall    cocos2d__CCDictionary__setObject                               ; +0xd8, 0x10003e5e8\njmp     short loc_10003E5F2                                            ; +0xdd, 0x10003e5ed\nxor     r15d, r15d                                                     ; +0xdf, 0x10003e5ef\nmov     rax, r15                                                       ; +0xe2, 0x10003e5f2\nadd     rsp, 40h                                                       ; +0xe5, 0x10003e5f5\npop     rbx                                                            ; +0xe9, 0x10003e5f9\npop     r12                                                            ; +0xea, 0x10003e5fa\npop     r14                                                            ; +0xec, 0x10003e5fc\npop     r15                                                            ; +0xee, 0x10003e5fe\npop     rbp                                                            ; +0xf0, 0x10003e600\nretn                                                                   ; +0xf1, 0x10003e601", "xrefs": ["GameStatsManager::unlockOnlineChest @ 0x10003a408", "GameStatsManager::unlockGauntletChest @ 0x10003e7de", "GameStatsManager::unlockPathChest @ 0x10003e9a3", "GJShopLayer::dialogClosed @ 0x1003128e2", "GameManager::rewardedVideoHidden @ 0x100369982", "SupportLayer::onGetReward @ 0x10038417b", "SecretLayer4::onChest01 @ 0x10039c2fa", "FollowRewardPage::onSpecialItem @ 0x10040d9a2", "SecretLayer3::onChest01 @ 0x10049ed47", "SecretLayer3::onChest02 @ 0x10049ee17", "SecretRewardsLayer::onSpecialItem @ 0x10070fa0c"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "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"}