// // GameStatsManager::unlockGoldChest from 0x7bc19c to 0x7bc328 (396 bytes) // // 2 xrefs: // > SecretRewardsLayer::onGoldChest @ 0xa64400 // > @ 0x948d8 // // 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 // GJRewardItem *GameStatsManager::unlockGoldChest(GameStatsManager *a1, int a2) { GJRewardItem *RewardForSecretChest; // x19 int Stat; // w0 cocos2d::CCDictionary *m_treasureRoomChests; // x20 cocos2d::CCString *v7; // x0 char *CString; // x0 void *v9; // x0 unsigned int *v11; // x2 int v12; // w1 __int64 v13; // [xsp+50h] [xbp+50h] BYREF if ( GameStatsManager::isSecretChestUnlocked(a1, a2) ) return nullptr; RewardForSecretChest = GameStatsManager::getRewardForSecretChest(a1, a2); if ( !RewardForSecretChest ) return nullptr; Stat = GameStatsManager::getStat(a1, "43"); if ( Stat <= 0 ) return nullptr; GameStatsManager::setStat(a1, "43", Stat - 1); GameStatsManager::preProcessReward(a1, RewardForSecretChest); GameStatsManager::registerRewardsFromItem(a1, RewardForSecretChest); m_treasureRoomChests = a1->m_treasureRoomChests; v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat( (cocos2d::CCString *)"%i", (const char *)(unsigned int)a2); CString = (char *)cocos2d::CCString::getCString(v7); sub_D153B8((int)&v13, CString); cocos2d::CCDictionary::setObject((int)m_treasureRoomChests, RewardForSecretChest); v9 = (void *)(v13 - 24); if ( (__int64 *)(v13 - 24) != &qword_124B6B0 ) { if ( &pthread_create ) { v11 = (unsigned int *)(v13 - 8); do v12 = __ldaxr(v11); while ( __stlxr(v12 - 1, v11) ); } else { v12 = *(_DWORD *)(v13 - 8); *(_DWORD *)(v13 - 8) = v12 - 1; } if ( v12 <= 0 ) operator delete(v9); } return RewardForSecretChest; }
GD Web Decomp Icon

GD Web Decomp

Raw Source