{"type": "func", "start": 5373729136, "end": 5373729466, "name": "SupportLayer::onGetReward", "pseudocode": "// \n// SupportLayer::onGetReward from 0x1404c9970 to 0x1404c9aba (330 bytes)\n// \n// 2 xrefs:\n// > SupportLayer::customSetup @ 0x1404c8c9a\n// > <???> @ 0x1406dd310\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 SupportLayer::onGetReward(SupportLayer *a1, cocos2d::CCObject *a2)\n{\n  GameStatsManager *v3; // rcx\n  GJRewardItem *v4; // rax\n  GJRewardItem *v5; // rbx\n  RewardUnlockLayer *v6; // rdi\n  cocos2d::CCObject *m_rewardItem; // rcx\n  __int128 v8; // [rsp+20h] [rbp-28h] BYREF\n  __int64 v9; // [rsp+30h] [rbp-18h]\n  __int64 v10; // [rsp+38h] [rbp-10h]\n  void *v11; // [rsp+68h] [rbp+20h]\n\n  v8 = 0;\n  v9 = 4;\n  v10 = 15;\n  strcpy((char *)&v8, \"0023\");\n  v3 = (GameStatsManager *)qword_1406C2EE8;\n  if ( !qword_1406C2EE8 )\n  {\n    v11 = operator new(0x3E0u);\n    qword_1406C2EE8 = sub_1401D0AE0((__int64)v11);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n    v3 = (GameStatsManager *)qword_1406C2EE8;\n  }\n  v4 = GameStatsManager::unlockSpecialChest(v3, (__int64)&v8);\n  v5 = v4;\n  if ( v4 )\n  {\n    v6 = RewardUnlockLayer::create(v4->m_rewardType, nullptr);\n    a1->addChild_0(a1, v6, 100);\n    m_rewardItem = v6->m_rewardItem;\n    if ( m_rewardItem )\n      cocos2d::CCObject::release(m_rewardItem);\n    v6->m_rewardItem = v5;\n    cocos2d::CCObject::retain(v5);\n    if ( !v5->m_unk || v5->m_rewardType == v6->m_chestType )\n    {\n      v6->m_closeBtn->setVisible(v6->m_closeBtn, 0);\n      v6->m_closeBtn->setEnabled(v6->m_closeBtn, 0);\n      v6->m_wrongLabel->setVisible(v6->m_wrongLabel, 0);\n      v6->m_rewardCollected = 1;\n      if ( v6->m_animationPlayed )\n        RewardUnlockLayer::playRewardEffect(v6);\n    }\n  }\n}", "assembly": "; \n; SupportLayer::onGetReward from 0x1404c9970 to 0x1404c9aba (330 bytes)\n; \n; 2 xrefs:\n; > SupportLayer::customSetup @ 0x1404c8c9a\n; > <???> @ 0x1406dd310\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_0], rbx                                               ; +0x0, 0x1404c9970\nmov     [rsp+arg_8], rsi                                               ; +0x5, 0x1404c9975\npush    rdi                                                            ; +0xa, 0x1404c997a\nsub     rsp, 40h                                                       ; +0xb, 0x1404c997b\nmov     rsi, rcx                                                       ; +0xf, 0x1404c997f\nlea     rax, [rsp+48h+var_28]                                          ; +0x12, 0x1404c9982\nmov     [rsp+48h+arg_10], rax                                          ; +0x17, 0x1404c9987\nxorps   xmm0, xmm0                                                     ; +0x1c, 0x1404c998c\nmovups  [rsp+48h+var_28], xmm0                                         ; +0x1f, 0x1404c998f\nmov     [rsp+48h+var_18], 4                                            ; +0x24, 0x1404c9994\nmov     [rsp+48h+var_10], 0Fh                                          ; +0x2d, 0x1404c999d\nmov     eax, dword ptr cs:a0023; \"0023\"                                ; +0x36, 0x1404c99a6\nmov     dword ptr [rsp+48h+var_28], eax                                ; +0x3c, 0x1404c99ac\nmov     byte ptr [rsp+48h+var_28+4], 0                                 ; +0x40, 0x1404c99b0\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x45, 0x1404c99b5\ntest    rcx, rcx                                                       ; +0x4c, 0x1404c99bc\njnz     short loc_1404C99F0                                            ; +0x4f, 0x1404c99bf\nmov     ecx, 3E0h; Size                                                ; +0x51, 0x1404c99c1\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x56, 0x1404c99c6\nmov     [rsp+48h+arg_18], rax                                          ; +0x5b, 0x1404c99cb\nmov     rcx, rax                                                       ; +0x60, 0x1404c99d0\ncall    sub_1401D0AE0                                                  ; +0x63, 0x1404c99d3\nnop                                                                    ; +0x68, 0x1404c99d8\nmov     cs:qword_1406C2EE8, rax                                        ; +0x69, 0x1404c99d9\nmov     rdx, [rax]                                                     ; +0x70, 0x1404c99e0\nmov     rcx, rax                                                       ; +0x73, 0x1404c99e3\ncall    qword ptr [rdx+48h]                                            ; +0x76, 0x1404c99e6\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x79, 0x1404c99e9\nlea     rdx, [rsp+48h+var_28]                                          ; +0x80, 0x1404c99f0\ncall    GameStatsManager__unlockSpecialChest                           ; +0x85, 0x1404c99f5\nmov     rbx, rax                                                       ; +0x8a, 0x1404c99fa\ntest    rax, rax                                                       ; +0x8d, 0x1404c99fd\njz      loc_1404C9AAA                                                  ; +0x90, 0x1404c9a00\nxor     edx, edx                                                       ; +0x96, 0x1404c9a06\nmov     ecx, [rax+40h]                                                 ; +0x98, 0x1404c9a08\ncall    RewardUnlockLayer__create                                      ; +0x9b, 0x1404c9a0b\nmov     rdi, rax                                                       ; +0xa0, 0x1404c9a10\nmov     r9, [rsi]                                                      ; +0xa3, 0x1404c9a13\nmov     r8d, 64h ; 'd'                                                 ; +0xa6, 0x1404c9a16\nmov     rdx, rax                                                       ; +0xac, 0x1404c9a1c\nmov     rcx, rsi                                                       ; +0xaf, 0x1404c9a1f\ncall    qword ptr [r9+1B8h]                                            ; +0xb2, 0x1404c9a22\nmov     rcx, [rdi+2A0h]                                                ; +0xb9, 0x1404c9a29\ntest    rcx, rcx                                                       ; +0xc0, 0x1404c9a30\njz      short loc_1404C9A3B                                            ; +0xc3, 0x1404c9a33\ncall    cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0xc5, 0x1404c9a35\nmov     [rdi+2A0h], rbx                                                ; +0xcb, 0x1404c9a3b\nmov     rcx, rbx                                                       ; +0xd2, 0x1404c9a42\ncall    cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0xd5, 0x1404c9a45\ncmp     byte ptr [rbx+50h], 0                                          ; +0xdb, 0x1404c9a4b\njz      short loc_1404C9A5C                                            ; +0xdf, 0x1404c9a4f\nmov     eax, [rdi+298h]                                                ; +0xe1, 0x1404c9a51\ncmp     [rbx+40h], eax                                                 ; +0xe7, 0x1404c9a57\njnz     short loc_1404C9AAA                                            ; +0xea, 0x1404c9a5a\nmov     rcx, [rdi+2B0h]                                                ; +0xec, 0x1404c9a5c\nmov     rax, [rcx]                                                     ; +0xf3, 0x1404c9a63\nxor     edx, edx                                                       ; +0xf6, 0x1404c9a66\ncall    qword ptr [rax+140h]                                           ; +0xf8, 0x1404c9a68\nmov     rcx, [rdi+2B0h]                                                ; +0xfe, 0x1404c9a6e\nmov     rax, [rcx]                                                     ; +0x105, 0x1404c9a75\nxor     edx, edx                                                       ; +0x108, 0x1404c9a78\ncall    qword ptr [rax+398h]                                           ; +0x10a, 0x1404c9a7a\nmov     rcx, [rdi+2A8h]                                                ; +0x110, 0x1404c9a80\nmov     rax, [rcx]                                                     ; +0x117, 0x1404c9a87\nxor     edx, edx                                                       ; +0x11a, 0x1404c9a8a\ncall    qword ptr [rax+140h]                                           ; +0x11c, 0x1404c9a8c\nmov     byte ptr [rdi+29Ch], 1                                         ; +0x122, 0x1404c9a92\ncmp     byte ptr [rdi+29Dh], 0                                         ; +0x129, 0x1404c9a99\njz      short loc_1404C9AAA                                            ; +0x130, 0x1404c9aa0\nmov     rcx, rdi                                                       ; +0x132, 0x1404c9aa2\ncall    RewardUnlockLayer__playRewardEffect                            ; +0x135, 0x1404c9aa5\nmov     rbx, [rsp+48h+arg_0]                                           ; +0x13a, 0x1404c9aaa\nmov     rsi, [rsp+48h+arg_8]                                           ; +0x13f, 0x1404c9aaf\nadd     rsp, 40h                                                       ; +0x144, 0x1404c9ab4\npop     rdi                                                            ; +0x148, 0x1404c9ab8\nretn                                                                   ; +0x149, 0x1404c9ab9", "xrefs": ["SupportLayer::customSetup @ 0x1404c8c9a", "<???> @ 0x1406dd310"], "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"}