{"type": "func", "start": 5372818672, "end": 5372819046, "name": "SecretLayer3::onChest01", "pseudocode": "// \n// SecretLayer3::onChest01 from 0x1403eb4f0 to 0x1403eb666 (374 bytes)\n// \n// 2 xrefs:\n// > SecretLayer3::init @ 0x1403eaec8\n// > <???> @ 0x1406d806c\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 SecretLayer3::onChest01(SecretLayer3 *a1, cocos2d::CCObject *a2)\n{\n  GameStatsManager *v4; // rcx\n  GJRewardItem *v5; // rax\n  GJRewardItem *v6; // rbx\n  RewardUnlockLayer *v7; // rdi\n  cocos2d::CCObject *m_rewardItem; // rcx\n  __int128 v9; // [rsp+20h] [rbp-28h] BYREF\n  __int64 v10; // [rsp+30h] [rbp-18h]\n  __int64 v11; // [rsp+38h] [rbp-10h]\n  void *v12; // [rsp+60h] [rbp+18h]\n\n  if ( !a1->m_lockInput )\n  {\n    ((void (__fastcall *)(cocos2d::CCObject *, _QWORD))a2->__vftable[12].getTag)(a2, 0);\n    ((void (__fastcall *)(cocos2d::CCObject *, _QWORD))a2->__vftable[4].update)(a2, 0);\n    v9 = 0;\n    v10 = 4;\n    v11 = 15;\n    strcpy((char *)&v9, \"0001\");\n    v4 = (GameStatsManager *)qword_1406C2EE8;\n    if ( !qword_1406C2EE8 )\n    {\n      v12 = operator new(0x3E0u);\n      qword_1406C2EE8 = sub_1401D0AE0((__int64)v12);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n      v4 = (GameStatsManager *)qword_1406C2EE8;\n    }\n    v5 = GameStatsManager::unlockSpecialChest(v4, (__int64)&v9);\n    v6 = v5;\n    if ( v5 )\n    {\n      v7 = RewardUnlockLayer::create(v5->m_rewardType, nullptr);\n      a1->addChild_0(a1, v7, 100);\n      m_rewardItem = v7->m_rewardItem;\n      if ( m_rewardItem )\n        cocos2d::CCObject::release(m_rewardItem);\n      v7->m_rewardItem = v6;\n      cocos2d::CCObject::retain(v6);\n      if ( !v6->m_unk || v6->m_rewardType == v7->m_chestType )\n      {\n        v7->m_closeBtn->setVisible(v7->m_closeBtn, 0);\n        v7->m_closeBtn->setEnabled(v7->m_closeBtn, 0);\n        v7->m_wrongLabel->setVisible(v7->m_wrongLabel, 0);\n        v7->m_rewardCollected = 1;\n        if ( v7->m_animationPlayed )\n          RewardUnlockLayer::playRewardEffect(v7);\n      }\n    }\n  }\n}", "assembly": "; \n; SecretLayer3::onChest01 from 0x1403eb4f0 to 0x1403eb666 (374 bytes)\n; \n; 2 xrefs:\n; > SecretLayer3::init @ 0x1403eaec8\n; > <???> @ 0x1406d806c\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, 0x1403eb4f0\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x1403eb4f5\npush    rdi                                                            ; +0xa, 0x1403eb4fa\nsub     rsp, 40h                                                       ; +0xb, 0x1403eb4fb\nmov     rbx, rdx                                                       ; +0xf, 0x1403eb4ff\nmov     rsi, rcx                                                       ; +0x12, 0x1403eb502\ncmp     byte ptr [rcx+1A8h], 0                                         ; +0x15, 0x1403eb505\njnz     loc_1403EB656                                                  ; +0x1c, 0x1403eb50c\nmov     rax, [rdx]                                                     ; +0x22, 0x1403eb512\nxor     edx, edx                                                       ; +0x25, 0x1403eb515\nmov     rcx, rbx                                                       ; +0x27, 0x1403eb517\ncall    qword ptr [rax+398h]                                           ; +0x2a, 0x1403eb51a\nmov     rax, [rbx]                                                     ; +0x30, 0x1403eb520\nxor     edx, edx                                                       ; +0x33, 0x1403eb523\nmov     rcx, rbx                                                       ; +0x35, 0x1403eb525\ncall    qword ptr [rax+140h]                                           ; +0x38, 0x1403eb528\nlea     rax, [rsp+48h+var_28]                                          ; +0x3e, 0x1403eb52e\nmov     [rsp+48h+arg_0], rax                                           ; +0x43, 0x1403eb533\nxorps   xmm0, xmm0                                                     ; +0x48, 0x1403eb538\nmovups  [rsp+48h+var_28], xmm0                                         ; +0x4b, 0x1403eb53b\nmov     [rsp+48h+var_18], 4                                            ; +0x50, 0x1403eb540\nmov     [rsp+48h+var_10], 0Fh                                          ; +0x59, 0x1403eb549\nmov     eax, dword ptr cs:a0001; \"0001\"                                ; +0x62, 0x1403eb552\nmov     dword ptr [rsp+48h+var_28], eax                                ; +0x68, 0x1403eb558\nmov     byte ptr [rsp+48h+var_28+4], 0                                 ; +0x6c, 0x1403eb55c\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x71, 0x1403eb561\ntest    rcx, rcx                                                       ; +0x78, 0x1403eb568\njnz     short loc_1403EB59C                                            ; +0x7b, 0x1403eb56b\nmov     ecx, 3E0h; Size                                                ; +0x7d, 0x1403eb56d\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x82, 0x1403eb572\nmov     [rsp+48h+arg_10], rax                                          ; +0x87, 0x1403eb577\nmov     rcx, rax                                                       ; +0x8c, 0x1403eb57c\ncall    sub_1401D0AE0                                                  ; +0x8f, 0x1403eb57f\nnop                                                                    ; +0x94, 0x1403eb584\nmov     cs:qword_1406C2EE8, rax                                        ; +0x95, 0x1403eb585\nmov     rdx, [rax]                                                     ; +0x9c, 0x1403eb58c\nmov     rcx, rax                                                       ; +0x9f, 0x1403eb58f\ncall    qword ptr [rdx+48h]                                            ; +0xa2, 0x1403eb592\nmov     rcx, cs:qword_1406C2EE8                                        ; +0xa5, 0x1403eb595\nlea     rdx, [rsp+48h+var_28]                                          ; +0xac, 0x1403eb59c\ncall    GameStatsManager__unlockSpecialChest                           ; +0xb1, 0x1403eb5a1\nmov     rbx, rax                                                       ; +0xb6, 0x1403eb5a6\ntest    rax, rax                                                       ; +0xb9, 0x1403eb5a9\njz      loc_1403EB656                                                  ; +0xbc, 0x1403eb5ac\nxor     edx, edx                                                       ; +0xc2, 0x1403eb5b2\nmov     ecx, [rax+40h]                                                 ; +0xc4, 0x1403eb5b4\ncall    RewardUnlockLayer__create                                      ; +0xc7, 0x1403eb5b7\nmov     rdi, rax                                                       ; +0xcc, 0x1403eb5bc\nmov     r9, [rsi]                                                      ; +0xcf, 0x1403eb5bf\nmov     r8d, 64h ; 'd'                                                 ; +0xd2, 0x1403eb5c2\nmov     rdx, rax                                                       ; +0xd8, 0x1403eb5c8\nmov     rcx, rsi                                                       ; +0xdb, 0x1403eb5cb\ncall    qword ptr [r9+1B8h]                                            ; +0xde, 0x1403eb5ce\nmov     rcx, [rdi+2A0h]                                                ; +0xe5, 0x1403eb5d5\ntest    rcx, rcx                                                       ; +0xec, 0x1403eb5dc\njz      short loc_1403EB5E7                                            ; +0xef, 0x1403eb5df\ncall    cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0xf1, 0x1403eb5e1\nmov     [rdi+2A0h], rbx                                                ; +0xf7, 0x1403eb5e7\nmov     rcx, rbx                                                       ; +0xfe, 0x1403eb5ee\ncall    cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x101, 0x1403eb5f1\ncmp     byte ptr [rbx+50h], 0                                          ; +0x107, 0x1403eb5f7\njz      short loc_1403EB608                                            ; +0x10b, 0x1403eb5fb\nmov     eax, [rdi+298h]                                                ; +0x10d, 0x1403eb5fd\ncmp     [rbx+40h], eax                                                 ; +0x113, 0x1403eb603\njnz     short loc_1403EB656                                            ; +0x116, 0x1403eb606\nmov     rcx, [rdi+2B0h]                                                ; +0x118, 0x1403eb608\nmov     rax, [rcx]                                                     ; +0x11f, 0x1403eb60f\nxor     edx, edx                                                       ; +0x122, 0x1403eb612\ncall    qword ptr [rax+140h]                                           ; +0x124, 0x1403eb614\nmov     rcx, [rdi+2B0h]                                                ; +0x12a, 0x1403eb61a\nmov     rax, [rcx]                                                     ; +0x131, 0x1403eb621\nxor     edx, edx                                                       ; +0x134, 0x1403eb624\ncall    qword ptr [rax+398h]                                           ; +0x136, 0x1403eb626\nmov     rcx, [rdi+2A8h]                                                ; +0x13c, 0x1403eb62c\nmov     rax, [rcx]                                                     ; +0x143, 0x1403eb633\nxor     edx, edx                                                       ; +0x146, 0x1403eb636\ncall    qword ptr [rax+140h]                                           ; +0x148, 0x1403eb638\nmov     byte ptr [rdi+29Ch], 1                                         ; +0x14e, 0x1403eb63e\ncmp     byte ptr [rdi+29Dh], 0                                         ; +0x155, 0x1403eb645\njz      short loc_1403EB656                                            ; +0x15c, 0x1403eb64c\nmov     rcx, rdi                                                       ; +0x15e, 0x1403eb64e\ncall    RewardUnlockLayer__playRewardEffect                            ; +0x161, 0x1403eb651\nmov     rbx, [rsp+48h+arg_8]                                           ; +0x166, 0x1403eb656\nmov     rsi, [rsp+48h+arg_18]                                          ; +0x16b, 0x1403eb65b\nadd     rsp, 40h                                                       ; +0x170, 0x1403eb660\npop     rdi                                                            ; +0x174, 0x1403eb664\nretn                                                                   ; +0x175, 0x1403eb665", "xrefs": ["SecretLayer3::init @ 0x1403eaec8", "<???> @ 0x1406d806c"], "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"}