// // RewardsPage::init from 0x10021a220 to 0x10021ae11 (3057 bytes) // // 2 xrefs: // > RewardsPage::create @ 0x10021a1dc // > @ 0x1008df890 // // 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 // bool __fastcall RewardsPage::init(RewardsPage *a1) { bool result; // al cocos2d::CCLayer *v3; // rax cocos2d::extension::CCScale9Sprite *v4; // r14 cocos2d::CCSprite *v5; // r14 cocos2d::CCSprite *v6; // r12 cocos2d::CCSprite *v7; // r12 cocos2d::CCSprite *v8; // r12 cocos2d::CCSprite *v9; // r15 cocos2d::CCSprite *v10; // rax CCMenuItemSpriteExtra *v11; // r14 int v12; // edx int v13; // ecx int v14; // r8d int v15; // r9d cocos2d::CCMenu *v16; // r15 GameStatsManager *v17; // rax bool v18; // r14 GameStatsManager *v19; // rax GameStatsManager *v20; // rax GameStatsManager *v21; // rax GameStatsManager *v22; // rax GameStatsManager *v23; // r14 CCMenuItemSpriteExtra *v24; // r15 cocos2d::CCMenu *m_buttonMenu; // r12 cocos2d::CCScaleTo *v26; // rax unsigned int v27; // r14d cocos2d::CCScaleTo *v28; // rax unsigned int v29; // eax int v30; // ecx int v31; // r8d int v32; // r9d cocos2d::CCActionInterval *v33; // rax cocos2d::CCRepeatForever *v34; // rax cocos2d::CCLabelBMFont *v35; // rax cocos2d::CCLabelBMFont *m_leftLabel; // r13 cocos2d::CCLabelBMFont *v37; // rax cocos2d::CCLabelBMFont *m_rightLabel; // r14 cocos2d::CCString *v39; // rax const char *CString; // rax cocos2d::CCSprite *v41; // r14 CCMenuItemSpriteExtra *v42; // rax CCMenuItemSpriteExtra *m_rightChest; // r15 cocos2d::CCLayer *m_mainLayer; // r13 cocos2d::CCString *v45; // rax const char *v46; // rax cocos2d::CCSprite *v47; // r14 CCMenuItemSpriteExtra *v48; // rax std::string *p_m_selectSound; // rdi CCMenuItemSpriteExtra *m_leftChest; // r14 cocos2d::CCLayer *v51; // r12 GameStatsManager *v52; // rax GameLevelManager *v53; // rax char v54; // [rsp+0h] [rbp-140h] char v55; // [rsp+0h] [rbp-140h] _BYTE v56[8]; // [rsp+8h] [rbp-138h] BYREF _BYTE v57[8]; // [rsp+10h] [rbp-130h] BYREF void *v58[3]; // [rsp+18h] [rbp-128h] BYREF char v59; // [rsp+30h] [rbp-110h] BYREF char v60[15]; // [rsp+31h] [rbp-10Fh] BYREF void *v61; // [rsp+40h] [rbp-100h] char v62; // [rsp+48h] [rbp-F8h] BYREF char v63[15]; // [rsp+49h] [rbp-F7h] BYREF void *v64; // [rsp+58h] [rbp-E8h] char v65; // [rsp+60h] [rbp-E0h] BYREF char v66[15]; // [rsp+61h] [rbp-DFh] BYREF void *v67; // [rsp+70h] [rbp-D0h] char v68; // [rsp+78h] [rbp-C8h] BYREF char v69[15]; // [rsp+79h] [rbp-C7h] BYREF void *v70; // [rsp+88h] [rbp-B8h] char v71; // [rsp+90h] [rbp-B0h] BYREF char v72[15]; // [rsp+91h] [rbp-AFh] BYREF void *v73; // [rsp+A0h] [rbp-A0h] std::string __str; // [rsp+A8h] [rbp-98h] BYREF std::string v75; // [rsp+C0h] [rbp-80h] BYREF char v76; // [rsp+D8h] [rbp-68h] BYREF cocos2d::CCMenu *v77; // [rsp+E0h] [rbp-60h] char v78; // [rsp+E8h] [rbp-58h] BYREF cocos2d::ccColor4B v79[4]; // [rsp+F0h] [rbp-50h] BYREF cocos2d::CCSprite *v80; // [rsp+100h] [rbp-40h] bool v81; // [rsp+10Fh] [rbp-31h] float v82; // [rsp+110h] [rbp-30h] BYREF float v83; // [rsp+114h] [rbp-2Ch] double v84; // 0:xmm0_8.8 double v85; // 0:xmm0_8.8 double v86; // 0:xmm0_8.8 double v87; // 0:xmm0_8.8 double v88; // 0:xmm0_8.8 cocos2d::CCRect v89; // 0:xmm0_8.8,8:xmm1_8.8 FLAlertLayer::incrementForcePrio(a1); v79[0] = (cocos2d::ccColor4B)-1778384896; result = cocos2d::CCLayerColor::initWithColor(a1, v79); if ( result ) { v81 = result; ((void (__fastcall *)(RewardsPage *, __int64))a1->setTouchEnabled)(a1, 1); ((void (__fastcall *)(RewardsPage *, __int64))a1->setKeypadEnabled)(a1, 1); cocos2d::CCDirector::sharedDirector(); *(cocos2d::CCSize *)&v84 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v82); v3 = cocos2d::CCLayer::create(); a1->m_mainLayer = v3; ((void (__fastcall *)(RewardsPage *, cocos2d::CCLayer *, double))a1->addChild)(a1, v3, v84); v89.origin = 0; v89.size = 0; sub_10028CC00(v79, 0.0, 0.0, 80.0, 80.0); v4 = cocos2d::extension::CCScale9Sprite::create_2("GJ_square02.png", v89); ((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, __int64))v4->setOpacity)(v4, 255); sub_10028CBF0(v79, 340.0, 220.0); ((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, cocos2d::ccColor4B *))v4->setContentSize)(v4, v79); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v4, 0xFFFFFFFFLL); sub_10028CBE0(v79, v82 * 0.5, v83 * 0.5); ((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, cocos2d::ccColor4B *))v4->setPosition)(v4, v79); v5 = cocos2d::CCSprite::createWithSpriteFrameName("rewardsLabel_001.png"); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v5, 20); sub_10028CBE0(v79, v82 * 0.5, (float)((float)(v83 * 0.5) + 110.0) + -32.0); ((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::ccColor4B *))v5->setPosition)(v5, v79); v6 = cocos2d::CCSprite::createWithSpriteFrameName("rewardCorner_001.png"); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v6, 8); sub_10028CBE0(v79, (float)(v82 * 0.5) + -145.0, (float)(v83 * 0.5) + -85.0); ((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::ccColor4B *))v6->setPosition)(v6, v79); v7 = cocos2d::CCSprite::createWithSpriteFrameName("rewardCorner_001.png"); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v7, 8); cocos2d::CCSprite::setFlipY(v7, 1); sub_10028CBE0(v79, (float)(v82 * 0.5) + -145.0, (float)(v83 * 0.5) + 85.0); ((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::ccColor4B *))v7->setPosition)(v7, v79); v8 = cocos2d::CCSprite::createWithSpriteFrameName("rewardCorner_001.png"); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v8, 8); cocos2d::CCSprite::setFlipX(v8, 1); cocos2d::CCSprite::setFlipY(v8, 1); sub_10028CBE0(v79, (float)(v82 * 0.5) + 145.0, (float)(v83 * 0.5) + 85.0); ((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::ccColor4B *))v8->setPosition)(v8, v79); v9 = cocos2d::CCSprite::createWithSpriteFrameName("rewardCorner_001.png"); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v9, 8); cocos2d::CCSprite::setFlipX(v9, 1); sub_10028CBE0(v79, (float)(v82 * 0.5) + 145.0, (float)(v83 * 0.5) + -85.0); ((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::ccColor4B *))v9->setPosition)(v9, v79); a1->m_joystickConnected = -1; v10 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png"); v11 = CCMenuItemSpriteExtra::create( v10, nullptr, a1, (cocos2d::SEL_MenuHandler)(unsigned __int64)RewardsPage::onClose); CCMenuItemSpriteExtra::setSizeMult(v11, 1.6); v16 = (cocos2d::CCMenu *)sub_100792C50((_DWORD)v11, 0, v12, v13, v14, v15); a1->m_buttonMenu = v16; sub_10028CBE0(&v78, (float)((float)(v82 * 0.5) + -170.0) + 10.0, (float)((float)(v83 * 0.5) + 110.0) + -10.0); *(cocos2d::CCPoint *)&v85 = cocos2d::CCNode::convertToNodeSpace( (cocos2d::CCNode *)v79, (const cocos2d::CCPoint *)v16); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::ccColor4B *, double))v11->setPosition)(v11, v79, v85); v17 = GameStatsManager::sharedState(); v59 = 8; strcpy(v60, "0007"); v18 = 1; if ( GameStatsManager::isSpecialChestUnlocked((__int64)v17, (__int64)&v59, v85) ) { v19 = GameStatsManager::sharedState(); v62 = 8; strcpy(v63, "0008"); if ( GameStatsManager::isSpecialChestUnlocked((__int64)v19, (__int64)&v62, v85) ) { v20 = GameStatsManager::sharedState(); v65 = 8; strcpy(v66, "0009"); if ( GameStatsManager::isSpecialChestUnlocked((__int64)v20, (__int64)&v65, v85) ) { v21 = GameStatsManager::sharedState(); v68 = 8; strcpy(v69, "0010"); if ( GameStatsManager::isSpecialChestUnlocked((__int64)v21, (__int64)&v68, v85) ) { v22 = GameStatsManager::sharedState(); v71 = 8; strcpy(v72, "0011"); if ( GameStatsManager::isSpecialChestUnlocked((__int64)v22, (__int64)&v71, v85) ) { v23 = GameStatsManager::sharedState(); sub_100030790(v58, "0024", v85); v18 = !GameStatsManager::isSpecialChestUnlocked((__int64)v23, (__int64)v58, v85); if ( ((__int64)v58[0] & 1) != 0 ) operator delete(v58[2]); } if ( (v71 & 1) != 0 ) operator delete(v73); } if ( (v68 & 1) != 0 ) operator delete(v70); } if ( (v65 & 1) != 0 ) operator delete(v67); } if ( (v62 & 1) != 0 ) operator delete(v64); } if ( (v59 & 1) != 0 ) operator delete(v61); if ( v18 ) { v80 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_freeChestBtn_001.png"); v24 = CCMenuItemSpriteExtra::create( v80, nullptr, a1, (cocos2d::SEL_MenuHandler)(unsigned __int64)RewardsPage::onFreeStuff); CCMenuItemSpriteExtra::setSizeMult(v24, 1.6); ((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)( a1->m_buttonMenu, v24); m_buttonMenu = a1->m_buttonMenu; sub_10028CBE0(&v78, (float)((float)(v82 * 0.5) + 170.0) + -10.0, (float)((float)(v83 * 0.5) + 110.0) + -10.0); *(cocos2d::CCPoint *)&v86 = cocos2d::CCNode::convertToNodeSpace( (cocos2d::CCNode *)v79, (const cocos2d::CCPoint *)m_buttonMenu); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::ccColor4B *, double))v24->setPosition)(v24, v79, v86); v26 = cocos2d::CCScaleTo::create_1(0.5, 1.1); v27 = (unsigned int)cocos2d::CCEaseInOut::create(v26, 2.0); v28 = cocos2d::CCScaleTo::create_1(0.5, 1.0); v29 = (unsigned int)cocos2d::CCEaseInOut::create(v28, 2.0); v33 = (cocos2d::CCActionInterval *)sub_1003B5760(v27, v29, 0, v30, v31, v32); v34 = cocos2d::CCRepeatForever::create(v33); cocos2d::CCNode::runAction(v80, v34); } ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, a1->m_buttonMenu, 10); sub_10028CBE0(v79, v82 * 0.5, (float)(v83 * 0.5) + -24.0); v35 = cocos2d::CCLabelBMFont::create_3("00:00:00", "bigFont.fnt"); a1->m_leftLabel = v35; ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v35, 20); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))a1->m_leftLabel->setScale)(a1->m_leftLabel, 0.5); m_leftLabel = a1->m_leftLabel; sub_10028CBE0(&v76, -70.0, -50.0); sub_10028CCE0(&v78, v79); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *))m_leftLabel->setPosition)(m_leftLabel, &v78); v37 = cocos2d::CCLabelBMFont::create_3("00:00:00", "bigFont.fnt"); a1->m_rightLabel = v37; ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v37, 20); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))a1->m_rightLabel->setScale)(a1->m_rightLabel, 0.5); m_rightLabel = a1->m_rightLabel; sub_10028CBE0(&v76, 70.0, -50.0); sub_10028CCE0(&v78, v79); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *))m_rightLabel->setPosition)(m_rightLabel, &v78); v39 = (cocos2d::CCString *)sub_1007AB580("chest_%02d_%02d_001.png", v54); CString = cocos2d::CCString::getCString(v39); v41 = cocos2d::CCSprite::createWithSpriteFrameName(CString); v42 = CCMenuItemSpriteExtra::create( v41, nullptr, a1, (cocos2d::SEL_MenuHandler)(unsigned __int64)RewardsPage::onReward); a1->m_rightChest = v42; __str.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)28; strcpy(__str.__r_.__value_.__s.__data_, "chestClick.ogg"); std::string::operator=((std::string *)&v42->m_selectSound, &__str); v80 = v41; if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 ) operator delete(__str.__r_.__value_.__l.__data_); ((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))a1->m_rightChest->setTag)(a1->m_rightChest, 2); ((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)( a1->m_buttonMenu, a1->m_rightChest); m_rightChest = a1->m_rightChest; v77 = a1->m_buttonMenu; m_mainLayer = a1->m_mainLayer; sub_10028CBE0(v57, 70.0, 14.0); sub_10028CCE0(v56, v79); cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)&v76, (const cocos2d::CCPoint *)m_mainLayer); *(cocos2d::CCPoint *)&v87 = cocos2d::CCNode::convertToNodeSpace( (cocos2d::CCNode *)&v78, (const cocos2d::CCPoint *)v77); ((void (__fastcall *)(CCMenuItemSpriteExtra *, char *, double))m_rightChest->setPosition)(m_rightChest, &v78, v87); a1->m_rightChest->m_scaleMultiplier = 1.08; v45 = (cocos2d::CCString *)sub_1007AB580("chest_%02d_%02d_001.png", v55); v46 = cocos2d::CCString::getCString(v45); v47 = cocos2d::CCSprite::createWithSpriteFrameName(v46); LODWORD(v80) = *(_DWORD *)(((__int64 (__fastcall *)(cocos2d::CCSprite *, __int64))v80->getContentSize)(v80, 1) + 4); v48 = CCMenuItemSpriteExtra::create( v47, nullptr, a1, (cocos2d::SEL_MenuHandler)(unsigned __int64)RewardsPage::onReward); a1->m_leftChest = v48; ((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v48->setTag)(v48, 1); p_m_selectSound = (std::string *)&a1->m_leftChest->m_selectSound; v75.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)28; strcpy(v75.__r_.__value_.__s.__data_, "chestClick.ogg"); std::string::operator=(p_m_selectSound, &v75); *(float *)&v80 = *(float *)&v80 * 0.19999999; if ( (*(_BYTE *)&v75.__r_.__value_.__s.0 & 1) != 0 ) operator delete(v75.__r_.__value_.__l.__data_); ((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)( a1->m_buttonMenu, a1->m_leftChest); m_leftChest = a1->m_leftChest; v77 = a1->m_buttonMenu; v51 = a1->m_mainLayer; sub_10028CBE0(v57, -70.0, (float)(*(float *)&v80 * -0.5) + 14.0); sub_10028CCE0(v56, v79); cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)&v76, (const cocos2d::CCPoint *)v51); *(cocos2d::CCPoint *)&v88 = cocos2d::CCNode::convertToNodeSpace( (cocos2d::CCNode *)&v78, (const cocos2d::CCPoint *)v77); ((void (__fastcall *)(CCMenuItemSpriteExtra *, char *, double))m_leftChest->setPosition)(m_leftChest, &v78, v88); a1->m_leftChest->m_scaleMultiplier = 1.08; GameLevelManager::sharedState()->m_GJRewardDelegate = &a1->GJRewardDelegate; v52 = GameStatsManager::sharedState(); if ( GameStatsManager::areRewardsLoaded(v52) ) { RewardsPage::updateTimers(a1, *(float *)&v88); } else { ((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))a1->m_leftLabel->setVisible)(a1->m_leftLabel, 0); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))a1->m_rightLabel->setVisible)(a1->m_rightLabel, 0); v53 = GameLevelManager::sharedState(); GameLevelManager::getGJRewards(v53, 0); } cocos2d::CCNode::schedule_1(a1, (cocos2d::SEL_SCHEDULE)(unsigned __int64)RewardsPage::updateTimers, 1.0); return v81; } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source