// // GameLevelManager::purgeUnusedLevels from 0x8085f0 to 0x8088e0 (752 bytes) // // 3 xrefs: // > GameLevelManager::encodeDataTo @ 0x808ba0 // > GameLevelManager::dataLoaded @ 0x860cac // > @ 0x525d0 // // This function is hookable on this platform (idp: arm, 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 12:54:46 +0000 // __int64 __fastcall GameLevelManager::purgeUnusedLevels(cocos2d::CCDictionary **this) { unsigned int v2; // w21 cocos2d::CCArray *v3; // x23 int v4; // w0 cocos2d::CCString *v5; // x0 const char *CString; // x0 char *v7; // x26 size_t v8; // x0 size_t v9; // x20 __int64 v10; // x27 char *v11; // x3 __int64 v12; // x20 __int64 v14; // x1 unsigned __int64 v15; // x0 __int64 v16; // x22 char *v17; // x0 __int64 v18; // x20 size_t v19; // x0 __int64 v20; // [xsp+60h] [xbp+60h] BYREF size_t v21; // [xsp+68h] [xbp+68h] void *v22; // [xsp+70h] [xbp+70h] v2 = 0; v3 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(*(this + 95)); if ( (unsigned int)cocos2d::CCArray::count(v3) ) { while ( 1 ) { v4 = cocos2d::CCArray::count(v3); v5 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v3, v4 + ~v2); CString = (const char *)cocos2d::CCString::getCString(v5); v20 = 0; v21 = 0; v7 = (char *)CString; v22 = nullptr; v8 = strlen(CString); v9 = v8; v10 = (__int64)*(this + 95); if ( v8 > 0xFFFFFFFFFFFFFFEFLL ) sub_62C79C(); if ( v8 > 0x16 ) break; LOBYTE(v20) = 2 * v8; v11 = (char *)&v20 + 1; if ( v8 ) goto LABEL_29; LABEL_5: v11[v9] = 0; v12 = cocos2d::CCDictionary::objectForKey(v10, &v20); if ( (v20 & 1) != 0 ) operator delete(v22); if ( *(_BYTE *)(v12 + 1105) && *(int *)(v12 + 916) <= 0 ) { v14 = *(_BYTE *)(v12 + 1472) >> 1; if ( (*(_BYTE *)(v12 + 1472) & 1) != 0 ) v14 = *(_QWORD *)(v12 + 1480); if ( !v14 ) { if ( *(_BYTE *)(v12 + 1744) && GameLevelManager::dtShouldUploadLevel((GameLevelManager *)this, (GJGameLevel *)v12) ) { ++v2; goto LABEL_10; } if ( (int)GJGameLevel::getNormalPercent((GJGameLevel *)v12) <= 0 && *(int *)(v12 + 888) <= 0 && !*(_DWORD *)(v12 + 1296) && !*(_DWORD *)(v12 + 1336) && !*(_BYTE *)(v12 + 849) ) { goto LABEL_34; } if ( *(_DWORD *)(v12 + 948) - *(_DWORD *)(v12 + 952) <= 0 ) { if ( (int)GJGameLevel::getNormalPercent((GJGameLevel *)v12) <= 9 && *(_DWORD *)(v12 + 796) - *(_DWORD *)(v12 + 800) <= 4 && !*(_DWORD *)(v12 + 1296) && !*(_DWORD *)(v12 + 1336) ) { goto LABEL_34; } if ( *(_DWORD *)(v12 + 948) - *(_DWORD *)(v12 + 952) <= 0 && *(int *)(v12 + 900) <= 1 && (int)GJGameLevel::getNormalPercent((GJGameLevel *)v12) <= 99 && *(_DWORD *)(v12 + 796) - *(_DWORD *)(v12 + 800) <= 9 && !*(_DWORD *)(v12 + 1296) ) { if ( *(_DWORD *)(v12 + 1336) ) { ++v2; goto LABEL_10; } LABEL_34: v20 = 0; v21 = 0; v22 = nullptr; v18 = (__int64)*(this + 95); v19 = strlen(v7); std::string::__init(&v20, v7, v19); cocos2d::CCDictionary::removeObjectForKey(v18, &v20); if ( (v20 & 1) != 0 ) { ++v2; operator delete(v22); goto LABEL_10; } } } } } ++v2; LABEL_10: if ( v2 >= (unsigned int)cocos2d::CCArray::count(v3) ) return _stack_chk_guard; } v15 = (v8 + 16) & 0xFFFFFFFFFFFFFFF0LL; v16 = v15 | 1; v17 = (char *)operator new(v15); v20 = v16; v11 = v17; v22 = v17; v21 = v9; LABEL_29: v11 = (char *)memcpy(v11, v7, v9); goto LABEL_5; } return _stack_chk_guard; }
GD Web Decomp Icon

GD Web Decomp

Raw Source