// // GameLevelManager::limitSavedLevels from 0x4ade60 to 0x4ae006 (422 bytes) // // 2 xrefs: // > GameLevelManager::encodeDataTo @ 0x4ae302 // > GameLevelManager::dataLoaded @ 0x4dd6ea // // This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False! // // 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:50:00 +0000 // unsigned int __fastcall GameLevelManager::limitSavedLevels(cocos2d::CCDictionary **this) { unsigned int v2; // r4 int v3; // r9 size_t **SavedLevels; // r8 cocos2d::CCArray *v5; // r10 GameManager *v6; // r0 int v7; // r5 cocos2d::CCString *v8; // r0 const char *CString; // r0 size_t v10; // r0 cocos2d::CCObject *v11; // r5 GameManager *v12; // r0 unsigned int v13; // r6 GameManager *GameVariable; // r0 int v15; // r9 GameManager *v16; // r0 GameManager *v17; // r0 int v18; // r0 bool v19; // cc char v20; // r3 GameManager *v21; // r0 unsigned int result; // r0 unsigned int v23; // r4 cocos2d::CCArray *v24; // r10 int v25; // r0 cocos2d::CCString *v26; // r0 const char *v27; // r0 int v28; // r11 size_t v29; // r0 int v30; // r11 char v31; // r3 const char *v32; // [sp+4h] [bp-18h] const char *v33; // [sp+4h] [bp-18h] int v34; // [sp+8h] [bp-14h] BYREF int v35; // [sp+Ch] [bp-10h] int v36; // [sp+10h] [bp-Ch] v2 = 0; v3 = 0; SavedLevels = GameLevelManager::getSavedLevels(this, 0, 0); v5 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(*(this + 147)); while ( 1 ) { v6 = (GameManager *)cocos2d::CCArray::count(v5); if ( v2 >= (unsigned int)v6 ) break; v7 = (int)*(this + 147); v8 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v5, v2); CString = (const char *)cocos2d::CCString::getCString(v8); v34 = 0; v35 = 0; v36 = 0; v32 = CString; v10 = strlen(CString); std::string::__init(&v34, v32, v10); v11 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(v7, &v34); std::string::~string((int)&v34); if ( !*((_BYTE *)v11 + 917) && GameLevelManager::isPastDailyCopy((GameLevelManager *)this, v11) ) { cocos2d::CCArray::addObject((cocos2d::CCArray *)SavedLevels, v11); v3 = 1; } ++v2; } if ( v3 ) qsort((void *)SavedLevels[13][3], *SavedLevels[13], 4u, savedLevelCompare); v12 = (GameManager *)GameManager::sharedState(v6); v13 = 0; GameVariable = (GameManager *)GameManager::getGameVariable(v12, "0042"); if ( GameVariable ) v15 = 100; else v15 = 10; v16 = (GameManager *)GameManager::sharedState(GameVariable); if ( GameManager::getGameVariable(v16, "0119") ) v15 = -1; while ( 1 ) { v17 = (GameManager *)cocos2d::CCArray::count((cocos2d::CCArray *)SavedLevels); if ( v13 >= (unsigned int)v17 ) break; v18 = cocos2d::CCArray::objectAtIndex((cocos2d::CCArray *)SavedLevels, v13); v19 = (int)v13++ <= v15; v20 = !v19; *(_BYTE *)(v18 + 916) = v20; } v21 = (GameManager *)GameManager::sharedState(v17); result = GameManager::getGameVariable(v21, "0127"); v23 = result; if ( !result ) { v24 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(*(this + 168)); while ( 1 ) { result = cocos2d::CCArray::count(v24); if ( v23 >= result ) break; v25 = cocos2d::CCArray::count(v24); v26 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v24, ~v23 + v25); v27 = (const char *)cocos2d::CCString::getCString(v26); v34 = 0; v35 = 0; v36 = 0; v28 = (int)*(this + 168); v33 = v27; v29 = strlen(v27); std::string::__init(&v34, v33, v29); v30 = cocos2d::CCDictionary::objectForKey(v28, &v34); std::string::~string((int)&v34); v19 = (int)(v23 + v13) <= v15; ++v23; v31 = !v19; *(_BYTE *)(v30 + 916) = v31; } } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source