//
// GameLevelManager::getOnlineLevels from 0x4c0db4 to 0x4c1354 (1440 bytes)
//
// 3 xrefs:
// > LevelBrowserLayer::loadPage @ 0x4a6b54
// > LevelBadgePopup::init @ 0x7524d2
// > LevelPickerPopup::doPageRequest @ 0x75ac90
//
// 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:24 +0000
//
int __fastcall GameLevelManager::getOnlineLevels(GameLevelManager *this, GJSearchObject *a2)
{
cocos2d::CCArray *CompletedLevels; // r8
int result; // r0
int v6; // r2
int v7; // r3
int v8; // r11
int v9; // r10
int v10; // r0
GameStatsManager *v11; // r0
int v12; // r9
int v13; // r0
char *v14; // r1
size_t v15; // r2
int v16; // r3
GameManager *v17; // r7
GameManager *v18; // r0
int GameVariable; // r0
unsigned int i; // r7
int v21; // r9
cocos2d::CCString *v22; // r0
char *CString; // r0
const char *v24; // r0
GameManager *v25; // r7
int v26; // r0
const char *v27; // r9
size_t v28; // r0
char *v29; // r8
char *v30; // r7
char *v31; // r3
cocos2d::CCString *v32; // r0
char *v33; // r0
const char *ActiveDailyID; // r0
cocos2d::CCString *v35; // r0
char *v36; // r0
cocos2d::CCString *v37; // r0
char *v38; // r0
char *v39; // r1
char *v40; // r1
const char *v41; // r0
int v42; // r6
cocos2d::CCString *v43; // r0
char *v44; // r0
size_t v45; // r0
size_t v46; // r0
char *Key; // [sp+2Ch] [bp-B8h]
int v48; // [sp+30h] [bp-B4h]
char *v49; // [sp+34h] [bp-B0h]
cocos2d::CCString *v50; // [sp+38h] [bp-ACh]
int v51; // [sp+3Ch] [bp-A8h]
char *v52; // [sp+40h] [bp-A4h]
int v53; // [sp+48h] [bp-9Ch] BYREF
int v54[2]; // [sp+4Ch] [bp-98h] BYREF
char *v55; // [sp+54h] [bp-90h]
int v56[3]; // [sp+58h] [bp-8Ch] BYREF
int v57[3]; // [sp+64h] [bp-80h] BYREF
char *v58[3]; // [sp+70h] [bp-74h] BYREF
int v59[3]; // [sp+7Ch] [bp-68h] BYREF
int v60[3]; // [sp+88h] [bp-5Ch] BYREF
int v61[3]; // [sp+94h] [bp-50h] BYREF
char v62; // [sp+A0h] [bp-44h] BYREF
char v63; // [sp+A1h] [bp-43h] BYREF
char *v64; // [sp+A8h] [bp-3Ch]
int v65[3]; // [sp+ACh] [bp-38h] BYREF
int v66[3]; // [sp+B8h] [bp-2Ch] BYREF
int v67[3]; // [sp+C4h] [bp-20h] BYREF
int v68; // [sp+D0h] [bp-14h] BYREF
size_t v69; // [sp+D4h] [bp-10h]
char *v70; // [sp+D8h] [bp-Ch]
Key = (char *)GJSearchObject::getKey(a2);
result = GameLevelManager::isDLActive(this, Key);
if ( result )
return result;
GameLevelManager::addDLToActive(this, Key, v6, v7);
v8 = *((unsigned __int8 *)a2 + 316);
if ( *((_BYTE *)a2 + 316) )
v9 = 0;
else
v9 = *((unsigned __int8 *)a2 + 317);
v10 = GameLevelManager::vaultTimedType(*((_DWORD *)a2 + 66), &v53);
v54[0] = 0;
v54[1] = 0;
v55 = nullptr;
v48 = v10;
v11 = (GameStatsManager *)std::string::__init(v54, "(", 1u);
if ( v48 )
{
if ( v8 )
{
if ( v53 == 1 )
{
v12 = 100000;
}
else if ( v53 == 2 )
{
v12 = 200000;
}
else
{
v12 = 0;
}
v13 = GameStatsManager::sharedState(v11);
CompletedLevels = (cocos2d::CCArray *)&v68;
GameStatsManager::getCompletedDailyIDs((GameStatsManager *)&v68, v13, v12);
if ( (v68 & 1) != 0 )
{
v14 = v70;
v15 = v69;
}
else
{
v15 = (int)(unsigned __int8)v68 >> 1;
v14 = (char *)&v68 + 1;
}
std::string::append(v54, v14, v15);
std::string::append(v54, ")");
v9 = 0;
if ( (v68 & 1) != 0 )
v16 = v69;
else
v16 = (int)(unsigned __int8)v68 >> 1;
v8 = v16;
if ( v16 )
v8 = 1;
std::string::~string((int)&v68);
goto LABEL_30;
}
}
else if ( v8 )
{
goto LABEL_22;
}
if ( v9 )
{
LABEL_22:
v17 = (GameManager *)GameLevelManager::sharedState(v11);
v18 = (GameManager *)GameManager::sharedState(v17);
GameVariable = GameManager::getGameVariable(v18, "0073");
CompletedLevels = GameLevelManager::getCompletedLevels((cocos2d::CCDictionary **)v17, GameVariable);
for ( i = 0; i < cocos2d::CCArray::count(CompletedLevels); ++i )
{
v21 = cocos2d::CCArray::objectAtIndex(CompletedLevels, i);
if ( i )
std::string::append(v54, ",");
v22 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(*(_DWORD *)(v21 + 268) - *(_DWORD *)(v21 + 272)));
CString = (char *)cocos2d::CCString::getCString(v22);
std::string::append(v54, CString);
}
std::string::append(v54, ")");
if ( cocos2d::CCArray::count(CompletedLevels) )
goto LABEL_30;
v9 = 0;
}
v8 = v9;
LABEL_30:
v49 = *((char **)a2 + 84);
v50 = (cocos2d::CCString *)*((unsigned __int8 *)a2 + 341);
v51 = *((unsigned __int8 *)a2 + 340);
if ( *((_DWORD *)a2 + 66) == 5 )
{
std::string::basic_string(v56, (int)a2 + 268);
if ( (v56[0] & 1) != 0 )
v24 = (const char *)v56[2];
else
v24 = (char *)v56 + 1;
v25 = (GameManager *)atoi(v24);
v26 = GameManager::sharedState(v25);
v27 = (const char *)(v25 == (GameManager *)(*(_DWORD *)(v26 + 464) - *(_DWORD *)(v26 + 468)));
std::string::~string((int)v56);
}
else
{
v27 = nullptr;
}
if ( !*((_DWORD *)a2 + 66) )
{
std::string::basic_string(v57, (int)a2 + 268);
if ( (v57[0] & 1) == 0 )
CompletedLevels = (cocos2d::CCArray *)((char *)v57 + 1);
v68 = 0;
if ( (v57[0] & 1) != 0 )
CompletedLevels = (cocos2d::CCArray *)v57[2];
v69 = 0;
v70 = nullptr;
v28 = strlen((const char *)CompletedLevels);
std::string::__init(&v68, CompletedLevels, v28);
std::string::~string((int)v57);
std::string::~string((int)&v68);
}
GameLevelManager::getBasePostString((GameLevelManager *)v58);
v52 = *((char **)a2 + 66);
std::string::basic_string(v59, (int)a2 + 268);
if ( (v59[0] & 1) != 0 )
v29 = (char *)v59[2];
else
v29 = (char *)v59 + 1;
std::string::basic_string(v60, (int)a2 + 280);
if ( (v60[0] & 1) != 0 )
v30 = (char *)v60[2];
else
v30 = (char *)v60 + 1;
std::string::basic_string(v61, (int)a2 + 292);
if ( (v61[0] & 1) != 0 )
v31 = (char *)v61[2];
else
v31 = (char *)v61 + 1;
v32 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&type=%i&str=%s&diff=%s&len=%s&page=%i&total=%i&uncompleted=%i&onlyC"
"ompleted=%i&featured=%i&original=%i&twoPlayer=%i&coins=%i",
v52,
v29,
v30,
v31,
*((_DWORD *)a2 + 76),
*((_DWORD *)a2 + 78),
v8,
v9,
*((unsigned __int8 *)a2 + 318),
*((unsigned __int8 *)a2 + 319),
*((unsigned __int8 *)a2 + 320),
*((unsigned __int8 *)a2 + 321));
v33 = (char *)cocos2d::CCString::getCString(v32);
std::string::append(v58, v33);
std::string::~string((int)v61);
std::string::~string((int)v60);
std::string::~string((int)v59);
if ( v48 )
{
ActiveDailyID = (const char *)GameLevelManager::getActiveDailyID(this, v53);
v35 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"&active=%i", ActiveDailyID);
v36 = (char *)cocos2d::CCString::getCString(v35);
std::string::append(v58, v36);
}
if ( *((_BYTE *)a2 + 322) )
std::string::append(v58, "&epic=1");
if ( *((_BYTE *)a2 + 323) )
std::string::append(v58, "&legendary=1");
if ( *((_BYTE *)a2 + 324) )
std::string::append(v58, "&mythic=1");
if ( v27 )
std::string::append(v58, "&local=1");
if ( v50 )
{
std::string::append(v58, "&song=");
v37 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v49);
v38 = (char *)cocos2d::CCString::getCString(v37);
std::string::append(v58, v38);
if ( v51 )
std::string::append(v58, "&customSong=1");
}
GameLevelManager::writeSpecialFilters((GameLevelManager *)&v62, this, (int)a2);
if ( (v62 & 1) != 0 )
v39 = v64;
else
v39 = &v63;
std::string::append(v58, v39);
std::string::~string((int)&v62);
if ( v8 || v9 )
{
std::string::append(v58, "&completedLevels=");
if ( (v54[0] & 1) != 0 )
v40 = v55;
else
v40 = (char *)v54 + 1;
std::string::append(v58, v40);
}
if ( *((_DWORD *)a2 + 66) == 25 )
{
std::string::basic_string(v65, (int)a2 + 268);
v41 = (v65[0] & 1) != 0 ? (const char *)v65[2] : (char *)v65 + 1;
v42 = atoi(v41);
std::string::~string((int)v65);
if ( !GameLevelManager::hasDownloadedList(this, v42) )
std::string::append(v58, "&inc=1");
}
if ( *((_DWORD *)a2 + 66) == 31 )
std::string::append(v58, "&hypeSecret=1");
std::string::append(v58, "&secret=");
v43 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&a1i2r3e45s789g[9]);
v44 = (char *)cocos2d::CCString::getCString(v43);
std::string::append(v58, v44);
memset(v66, 0, sizeof(v66));
std::string::__init(v66, "https://www.boomlings.com/database/getGJLevels21.php", 0x34u);
v67[0] = 0;
v67[1] = 0;
if ( ((int)v58[0] & 1) == 0 )
v27 = (char *)v58 + 1;
v67[2] = 0;
if ( ((int)v58[0] & 1) != 0 )
v27 = v58[2];
v45 = strlen(v27);
std::string::__init(v67, v27, v45);
v68 = 0;
v69 = 0;
v70 = nullptr;
v46 = strlen(Key);
std::string::__init(&v68, Key, v46);
GameLevelManager::ProcessHttpRequest(this, v66, (int)v67, (int)&v68, 2);
std::string::~string((int)&v68);
std::string::~string((int)v67);
std::string::~string((int)v66);
std::string::~string((int)v58);
return std::string::~string((int)v54);
}