// // GameStatsManager::preProcessReward from 0x1401e1ad0 to 0x1401e1d60 (656 bytes) // // 5 xrefs: // > GameStatsManager::unlockSpecialChest @ 0x1401ea65a // > GameStatsManager::unlockSecretChest @ 0x1401eaa13 // > RewardsPage::rewardsStatusFinished @ 0x1403cd5be // > SecretRewardsLayer::onGoldChest @ 0x1403d751b // > @ 0x1406cc540 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // // Hidden C++ exception states: #wind=3 void GameStatsManager::preProcessReward(GameStatsManager *a1, GJRewardItem *a2) { int v3; // r14d cocos2d::CCArray *m_rewardObjects; // rdi int v5; // r12d unsigned int v6; // ebx struct cocos2d::CCObject *v7; // rbp __int64 v8; // rax int Stat; // r15d __int64 v10; // rax int m_nLuaID; // ecx cocos2d::CCArray *v12; // rcx cocos2d::CCObject *v13; // rax cocos2d::CCArray *v14; // rbx cocos2d::CCArray *v15; // rcx unsigned int v16; // ebx struct cocos2d::CCObject *v17; // rdi _BYTE v19[32]; // [rsp+30h] [rbp-88h] BYREF _BYTE v20[32]; // [rsp+50h] [rbp-68h] BYREF v3 = 0; m_rewardObjects = a2->m_rewardObjects; if ( m_rewardObjects ) { v5 = 0; v6 = 0; if ( cocos2d::CCArray::count(a2->m_rewardObjects) ) { do { v7 = cocos2d::CCArray::objectAtIndex(m_rewardObjects, v6); switch ( LODWORD(v7[1].__vftable) ) { case 1: case 2: case 3: case 4: case 5: case 0xA: case 0xB: case 0xC: case 0xD: case 0xE: v8 = GJRewardItem::rewardItemToStat(v20); if ( *(_QWORD *)(v8 + 24) > 0xFu ) v8 = *(_QWORD *)v8; if ( GameStatsManager::getStat(a1, (const char *)v8) <= 100 ) { v10 = GJRewardItem::rewardItemToStat(v19); v3 |= 1u; if ( *(_QWORD *)(v10 + 24) > 0xFu ) v10 = *(_QWORD *)v10; Stat = GameStatsManager::getStat(a1, (const char *)v10); } else { Stat = 100; } if ( (v3 & 1) != 0 ) { v3 &= ~1u; sub_14003A830((__int64)v19); } sub_14003A830((__int64)v20); m_nLuaID = v7[1].m_nLuaID; if ( m_nLuaID + Stat < 100 ) goto LABEL_16; v5 += m_nLuaID + Stat - 100; v7[1].m_nLuaID = 100 - Stat; if ( 100 - Stat > 0 ) goto LABEL_16; cocos2d::CCArray::removeObjectAtIndex(m_rewardObjects, v6, 1); break; default: LABEL_16: ++v6; break; } } while ( v6 < cocos2d::CCArray::count(m_rewardObjects) ); if ( v5 > 0 ) { v12 = a2->m_rewardObjects; if ( !v12 ) { v13 = (cocos2d::CCObject *)cocos2d::CCArray::create(0); v14 = (cocos2d::CCArray *)v13; v12 = a2->m_rewardObjects; if ( v12 != v13 ) { if ( v13 ) cocos2d::CCObject::retain(v13); v15 = a2->m_rewardObjects; if ( v15 ) cocos2d::CCObject::release(v15); a2->m_rewardObjects = v14; v12 = v14; } } v16 = 0; if ( cocos2d::CCArray::count(v12) ) { while ( 1 ) { v17 = cocos2d::CCArray::objectAtIndex(a2->m_rewardObjects, v16); if ( LODWORD(v17[1].__vftable) == 7 ) break; if ( ++v16 >= cocos2d::CCArray::count(a2->m_rewardObjects) ) goto LABEL_29; } } else { LABEL_29: v17 = (struct cocos2d::CCObject *)operator new(0x48u); cocos2d::CCObject::CCObject(v17); v17->__vftable = (cocos2d::CCObject_vtbl *)&GJRewardObject::`vftable'; LODWORD(v17[1].__vftable) = 7; *(_QWORD *)&v17[1].m_uID = 0; cocos2d::CCObject::autorelease(v17); cocos2d::CCArray::addObject(a2->m_rewardObjects, v17); } v17[1].m_nLuaID = (int)(float)((float)((float)v5 * 100.0) + (float)v17[1].m_nLuaID); } } } }
GD Web Decomp Icon

GD Web Decomp

Raw Source