{"type": "func", "start": 5372819056, "end": 5372819430, "name": "SecretLayer3::onChest02", "pseudocode": "// \n// SecretLayer3::onChest02 from 0x1403eb670 to 0x1403eb7e6 (374 bytes)\n// \n// 2 xrefs:\n// > SecretLayer3::init @ 0x1403eb19b\n// > <???> @ 0x1406d8078\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\nvoid SecretLayer3::onChest02(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, \"0002\");\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::onChest02 from 0x1403eb670 to 0x1403eb7e6 (374 bytes)\n; \n; 2 xrefs:\n; > SecretLayer3::init @ 0x1403eb19b\n; > <???> @ 0x1406d8078\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, 0x1403eb670\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x1403eb675\npush    rdi                                                            ; +0xa, 0x1403eb67a\nsub     rsp, 40h                                                       ; +0xb, 0x1403eb67b\nmov     rbx, rdx                                                       ; +0xf, 0x1403eb67f\nmov     rsi, rcx                                                       ; +0x12, 0x1403eb682\ncmp     byte ptr [rcx+1A8h], 0                                         ; +0x15, 0x1403eb685\njnz     loc_1403EB7D6                                                  ; +0x1c, 0x1403eb68c\nmov     rax, [rdx]                                                     ; +0x22, 0x1403eb692\nxor     edx, edx                                                       ; +0x25, 0x1403eb695\nmov     rcx, rbx                                                       ; +0x27, 0x1403eb697\ncall    qword ptr [rax+398h]                                           ; +0x2a, 0x1403eb69a\nmov     rax, [rbx]                                                     ; +0x30, 0x1403eb6a0\nxor     edx, edx                                                       ; +0x33, 0x1403eb6a3\nmov     rcx, rbx                                                       ; +0x35, 0x1403eb6a5\ncall    qword ptr [rax+140h]                                           ; +0x38, 0x1403eb6a8\nlea     rax, [rsp+48h+var_28]                                          ; +0x3e, 0x1403eb6ae\nmov     [rsp+48h+arg_0], rax                                           ; +0x43, 0x1403eb6b3\nxorps   xmm0, xmm0                                                     ; +0x48, 0x1403eb6b8\nmovups  [rsp+48h+var_28], xmm0                                         ; +0x4b, 0x1403eb6bb\nmov     [rsp+48h+var_18], 4                                            ; +0x50, 0x1403eb6c0\nmov     [rsp+48h+var_10], 0Fh                                          ; +0x59, 0x1403eb6c9\nmov     eax, dword ptr cs:a0002; \"0002\"                                ; +0x62, 0x1403eb6d2\nmov     dword ptr [rsp+48h+var_28], eax                                ; +0x68, 0x1403eb6d8\nmov     byte ptr [rsp+48h+var_28+4], 0                                 ; +0x6c, 0x1403eb6dc\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x71, 0x1403eb6e1\ntest    rcx, rcx                                                       ; +0x78, 0x1403eb6e8\njnz     short loc_1403EB71C                                            ; +0x7b, 0x1403eb6eb\nmov     ecx, 3E0h; Size                                                ; +0x7d, 0x1403eb6ed\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x82, 0x1403eb6f2\nmov     [rsp+48h+arg_10], rax                                          ; +0x87, 0x1403eb6f7\nmov     rcx, rax                                                       ; +0x8c, 0x1403eb6fc\ncall    sub_1401D0AE0                                                  ; +0x8f, 0x1403eb6ff\nnop                                                                    ; +0x94, 0x1403eb704\nmov     cs:qword_1406C2EE8, rax                                        ; +0x95, 0x1403eb705\nmov     rdx, [rax]                                                     ; +0x9c, 0x1403eb70c\nmov     rcx, rax                                                       ; +0x9f, 0x1403eb70f\ncall    qword ptr [rdx+48h]                                            ; +0xa2, 0x1403eb712\nmov     rcx, cs:qword_1406C2EE8                                        ; +0xa5, 0x1403eb715\nlea     rdx, [rsp+48h+var_28]                                          ; +0xac, 0x1403eb71c\ncall    GameStatsManager__unlockSpecialChest                           ; +0xb1, 0x1403eb721\nmov     rbx, rax                                                       ; +0xb6, 0x1403eb726\ntest    rax, rax                                                       ; +0xb9, 0x1403eb729\njz      loc_1403EB7D6                                                  ; +0xbc, 0x1403eb72c\nxor     edx, edx                                                       ; +0xc2, 0x1403eb732\nmov     ecx, [rax+40h]                                                 ; +0xc4, 0x1403eb734\ncall    RewardUnlockLayer__create                                      ; +0xc7, 0x1403eb737\nmov     rdi, rax                                                       ; +0xcc, 0x1403eb73c\nmov     r9, [rsi]                                                      ; +0xcf, 0x1403eb73f\nmov     r8d, 64h ; 'd'                                                 ; +0xd2, 0x1403eb742\nmov     rdx, rax                                                       ; +0xd8, 0x1403eb748\nmov     rcx, rsi                                                       ; +0xdb, 0x1403eb74b\ncall    qword ptr [r9+1B8h]                                            ; +0xde, 0x1403eb74e\nmov     rcx, [rdi+2A0h]                                                ; +0xe5, 0x1403eb755\ntest    rcx, rcx                                                       ; +0xec, 0x1403eb75c\njz      short loc_1403EB767                                            ; +0xef, 0x1403eb75f\ncall    cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0xf1, 0x1403eb761\nmov     [rdi+2A0h], rbx                                                ; +0xf7, 0x1403eb767\nmov     rcx, rbx                                                       ; +0xfe, 0x1403eb76e\ncall    cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x101, 0x1403eb771\ncmp     byte ptr [rbx+50h], 0                                          ; +0x107, 0x1403eb777\njz      short loc_1403EB788                                            ; +0x10b, 0x1403eb77b\nmov     eax, [rdi+298h]                                                ; +0x10d, 0x1403eb77d\ncmp     [rbx+40h], eax                                                 ; +0x113, 0x1403eb783\njnz     short loc_1403EB7D6                                            ; +0x116, 0x1403eb786\nmov     rcx, [rdi+2B0h]                                                ; +0x118, 0x1403eb788\nmov     rax, [rcx]                                                     ; +0x11f, 0x1403eb78f\nxor     edx, edx                                                       ; +0x122, 0x1403eb792\ncall    qword ptr [rax+140h]                                           ; +0x124, 0x1403eb794\nmov     rcx, [rdi+2B0h]                                                ; +0x12a, 0x1403eb79a\nmov     rax, [rcx]                                                     ; +0x131, 0x1403eb7a1\nxor     edx, edx                                                       ; +0x134, 0x1403eb7a4\ncall    qword ptr [rax+398h]                                           ; +0x136, 0x1403eb7a6\nmov     rcx, [rdi+2A8h]                                                ; +0x13c, 0x1403eb7ac\nmov     rax, [rcx]                                                     ; +0x143, 0x1403eb7b3\nxor     edx, edx                                                       ; +0x146, 0x1403eb7b6\ncall    qword ptr [rax+140h]                                           ; +0x148, 0x1403eb7b8\nmov     byte ptr [rdi+29Ch], 1                                         ; +0x14e, 0x1403eb7be\ncmp     byte ptr [rdi+29Dh], 0                                         ; +0x155, 0x1403eb7c5\njz      short loc_1403EB7D6                                            ; +0x15c, 0x1403eb7cc\nmov     rcx, rdi                                                       ; +0x15e, 0x1403eb7ce\ncall    RewardUnlockLayer__playRewardEffect                            ; +0x161, 0x1403eb7d1\nmov     rbx, [rsp+48h+arg_8]                                           ; +0x166, 0x1403eb7d6\nmov     rsi, [rsp+48h+arg_18]                                          ; +0x16b, 0x1403eb7db\nadd     rsp, 40h                                                       ; +0x170, 0x1403eb7e0\npop     rdi                                                            ; +0x174, 0x1403eb7e4\nretn                                                                   ; +0x175, 0x1403eb7e5", "xrefs": ["SecretLayer3::init @ 0x1403eb19b", "<???> @ 0x1406d8078"], "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"}