//
// SupportLayer::onGetReward from 0x14066b100 to 0x14066b250 (336 bytes)
//
// 2 xrefs:
// > SupportLayer::customSetup @ 0x14066a3ed
// > ??> @ 0x140931fd0
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:35:52 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall SupportLayer::onGetReward(__int64 a1)
{
__int64 v2; // rcx
__int64 result; // rax
__int64 v4; // rbx
_QWORD *v5; // rdi
cocos2d::CCObject *v6; // rcx
__int128 v7; // [rsp+20h] [rbp-28h] BYREF
__int64 v8; // [rsp+30h] [rbp-18h]
__int64 v9; // [rsp+38h] [rbp-10h]
void *v10; // [rsp+68h] [rbp+20h]
v7 = 0;
v8 = 4;
v9 = 15;
strcpy((char *)&v7, "0023");
v2 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v10 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v2 = qword_14090BFE0;
}
result = GameStatsManager::unlockSpecialChest(v2, (__int64)&v7);
v4 = result;
if ( result )
{
v5 = RewardUnlockLayer::create(*(_DWORD *)(result + 64), 0);
(*(void (__fastcall **)(__int64, _QWORD *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v5, 100);
v6 = (cocos2d::CCObject *)v5[88];
if ( v6 )
cocos2d::CCObject::release(v6);
v5[88] = v4;
cocos2d::CCObject::retain((cocos2d::CCObject *)v4);
if ( !*(_BYTE *)(v4 + 80) || (result = *((unsigned int *)v5 + 174), *(_DWORD *)(v4 + 64) == (_DWORD)result) )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v5[90] + 336LL))(v5[90], 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v5[90] + 936LL))(v5[90], 0);
result = (*(__int64 (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v5[89] + 336LL))(v5[89], 0);
*((_BYTE *)v5 + 700) = 1;
if ( *((_BYTE *)v5 + 701) )
return (__int64)RewardUnlockLayer::playRewardEffect((cocos2d::CCNode *)v5);
}
}
return result;
}