//
// GameLevelManager::getOnlineLevels from 0x82e020 to 0x82eba4 (2948 bytes)
//
// 4 xrefs:
// > LevelBrowserLayer::loadPage @ 0x7f8ec4
// > LevelBadgePopup::init @ 0xc77104
// > LevelPickerPopup::doPageRequest @ 0xc84b18
// > ??> @ 0x5c998
//
// 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:55:07 +0000
//
__int64 __fastcall GameLevelManager::getOnlineLevels(GameLevelManager *this, GJSearchObject *a2)
{
char *Key; // x24
unsigned int v6; // w27
GameLevelManager *v7; // x0
int v8; // w26
int v9; // w25
GameStatsManager *v10; // x0
char *v11; // x1
size_t v12; // x2
int v13; // w0
int v14; // w0
__int64 v15; // x0
__int64 v16; // x1
const char *v17; // x1
size_t v18; // x0
unsigned int v19; // w1
char v20; // w0
__int64 *v21; // x28
__int64 v22; // x0
__int64 v23; // x1
char v24; // w0
__int64 v25; // x0
__int64 v26; // x1
char *v27; // x26
char v28; // w0
__int64 v29; // x0
__int64 v30; // x1
char *v31; // x4
cocos2d::CCString *v32; // x0
size_t v33; // x0
cocos2d::CCString *v34; // x0
size_t v35; // x0
const char *v36; // x1
size_t v37; // x0
int v38; // w0
cocos2d::CCString *v39; // x0
size_t v40; // x0
const char *v41; // x1
size_t v42; // x0
size_t v43; // x0
GameManager *v44; // x22
GameManager *v45; // x0
unsigned __int8 GameVariable; // w0
cocos2d::CCArray *CompletedLevels; // x26
unsigned int i; // w22
__int64 v49; // x25
cocos2d::CCString *v50; // x0
size_t v51; // x0
int v52; // w0
int v53; // w1
char v54; // w0
__int64 v55; // x0
__int64 v56; // x1
const char *v57; // x0
GameManager *v58; // x0
int v59; // w25
__int64 v60; // x0
const char *v61; // x1
size_t v62; // x0
unsigned int ActiveDailyID; // w0
cocos2d::CCString *v64; // x0
size_t v65; // x0
char v66; // w0
__int64 v67; // x0
__int64 v68; // x1
int v69; // w1
char *v70; // x25
int v71; // [xsp+90h] [xbp+60h]
unsigned int v72; // [xsp+94h] [xbp+64h]
unsigned int v73; // [xsp+98h] [xbp+68h]
int v74; // [xsp+9Ch] [xbp+6Ch]
int v75; // [xsp+A8h] [xbp+78h]
int v76; // [xsp+ACh] [xbp+7Ch]
int v77; // [xsp+ACh] [xbp+7Ch]
_BOOL4 v78; // [xsp+B0h] [xbp+80h]
char *v79; // [xsp+B8h] [xbp+88h]
char *v80; // [xsp+B8h] [xbp+88h]
char *v81; // [xsp+B8h] [xbp+88h]
char *v82; // [xsp+B8h] [xbp+88h]
char *v83; // [xsp+B8h] [xbp+88h]
char *v84; // [xsp+B8h] [xbp+88h]
char *v85; // [xsp+B8h] [xbp+88h]
char *CString; // [xsp+B8h] [xbp+88h]
char *v87; // [xsp+B8h] [xbp+88h]
char *v88; // [xsp+B8h] [xbp+88h]
int v89; // [xsp+B8h] [xbp+88h]
unsigned int v90; // [xsp+C4h] [xbp+94h] BYREF
__int64 v91; // [xsp+C8h] [xbp+98h] BYREF
__int64 v92; // [xsp+D0h] [xbp+A0h]
char *v93; // [xsp+D8h] [xbp+A8h]
__int64 v94; // [xsp+E0h] [xbp+B0h] BYREF
__int64 v95; // [xsp+E8h] [xbp+B8h]
void *v96; // [xsp+F0h] [xbp+C0h]
__int64 v97; // [xsp+F8h] [xbp+C8h] BYREF
__int64 v98; // [xsp+100h] [xbp+D0h]
void *v99; // [xsp+108h] [xbp+D8h]
__int64 v100[2]; // [xsp+110h] [xbp+E0h] BYREF
void *v101; // [xsp+120h] [xbp+F0h]
__int64 v102; // [xsp+128h] [xbp+F8h] BYREF
__int64 v103; // [xsp+130h] [xbp+100h]
void *v104; // [xsp+138h] [xbp+108h]
__int64 v105; // [xsp+140h] [xbp+110h] BYREF
__int64 v106; // [xsp+148h] [xbp+118h]
void *v107; // [xsp+150h] [xbp+120h]
__int64 v108; // [xsp+158h] [xbp+128h] BYREF
__int64 v109; // [xsp+160h] [xbp+130h]
void *v110; // [xsp+168h] [xbp+138h]
__int64 v111[2]; // [xsp+170h] [xbp+140h] BYREF
void *v112; // [xsp+180h] [xbp+150h]
__int64 v113; // [xsp+188h] [xbp+158h] BYREF
__int64 v114; // [xsp+190h] [xbp+160h]
char *v115; // [xsp+198h] [xbp+168h]
__int64 v116[2]; // [xsp+1A0h] [xbp+170h] BYREF
void *v117; // [xsp+1B0h] [xbp+180h]
__int64 v118[2]; // [xsp+1B8h] [xbp+188h] BYREF
void *v119; // [xsp+1C8h] [xbp+198h]
__int64 v120; // [xsp+1D0h] [xbp+1A0h] BYREF
size_t v121; // [xsp+1D8h] [xbp+1A8h]
void *v122; // [xsp+1E0h] [xbp+1B0h]
Key = (char *)GJSearchObject::getKey(a2);
if ( GameLevelManager::isDLActive(this, Key) )
return _stack_chk_guard;
GameLevelManager::addDLToActive(this, Key);
v6 = *((unsigned __int8 *)a2 + 404);
if ( *((_BYTE *)a2 + 404) )
{
v75 = (unsigned __int8)GameLevelManager::vaultTimedType(*((_DWORD *)a2 + 79), &v90);
v91 = 0;
v92 = 0;
v93 = nullptr;
v7 = (GameLevelManager *)std::string::__init(&v91, "(", 1u);
if ( v75 )
{
if ( v90 == 1 )
{
v9 = 200000;
v8 = 100000;
}
else if ( v90 == 2 )
{
v9 = 0x7FFFFFFF;
v8 = 200000;
}
else
{
v8 = 0;
v9 = 100000;
}
v10 = (GameStatsManager *)GameStatsManager::sharedState((GameStatsManager *)v90);
GameStatsManager::getCompletedDailyIDs(&v120, v10, v8, v9);
if ( (v120 & 1) != 0 )
{
v11 = (char *)v122;
v12 = v121;
}
else
{
v12 = (unsigned __int8)v120 >> 1;
v11 = (char *)&v120 + 1;
}
std::string::append((__int64)&v91, v11, v12);
std::string::append((__int64)&v91, ")", 1u);
if ( (v120 & 1) != 0 )
{
v6 = v121 != 0;
operator delete(v122);
}
else
{
v6 = (int)(unsigned __int8)v120 >> 1 != 0;
}
v76 = 0;
goto LABEL_13;
}
v77 = 0;
LABEL_77:
v44 = (GameManager *)GameLevelManager::sharedState(v7);
v45 = (GameManager *)GameManager::sharedState(v44);
GameVariable = GameManager::getGameVariable(v45, "0073");
CompletedLevels = GameLevelManager::getCompletedLevels((cocos2d::CCDictionary **)v44, GameVariable);
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(CompletedLevels); ++i )
{
v49 = cocos2d::CCArray::objectAtIndex(CompletedLevels, i);
if ( i )
std::string::append((__int64)&v91, &byte_1169BE0, 1u);
v50 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)(*(_DWORD *)(v49 + 328) - *(_DWORD *)(v49 + 332)));
CString = (char *)cocos2d::CCString::getCString(v50);
v51 = strlen(CString);
std::string::append((__int64)&v91, CString, v51);
}
std::string::append((__int64)&v91, ")", 1u);
v52 = cocos2d::CCArray::count(CompletedLevels);
v53 = v77;
if ( !v52 )
v53 = 0;
v76 = v53;
if ( !v52 )
v6 = 0;
goto LABEL_13;
}
if ( *((_BYTE *)a2 + 405) )
{
v77 = 1;
v75 = (unsigned __int8)GameLevelManager::vaultTimedType(*((_DWORD *)a2 + 79), &v90);
v91 = 0;
v92 = 0;
v93 = nullptr;
v7 = (GameLevelManager *)std::string::__init(&v91, "(", 1u);
goto LABEL_77;
}
v76 = 0;
v75 = (unsigned __int8)GameLevelManager::vaultTimedType(*((_DWORD *)a2 + 79), &v90);
v91 = 0;
v92 = 0;
v93 = nullptr;
std::string::__init(&v91, "(", 1u);
LABEL_13:
v13 = *((_DWORD *)a2 + 79);
v72 = *((_DWORD *)a2 + 106);
v74 = *((unsigned __int8 *)a2 + 429);
v78 = 0;
v71 = *((unsigned __int8 *)a2 + 428);
if ( v13 == 5 )
{
v54 = *((_BYTE *)a2 + 320);
v96 = nullptr;
v94 = 0;
v95 = 0;
if ( (v54 & 1) != 0 )
{
std::string::__init(&v94, *((void **)a2 + 42), *((_QWORD *)a2 + 41));
}
else
{
v55 = *((_QWORD *)a2 + 40);
v56 = *((_QWORD *)a2 + 41);
v96 = *((void **)a2 + 42);
v94 = v55;
v95 = v56;
}
v57 = (char *)&v94 + 1;
if ( (v94 & 1) != 0 )
v57 = (const char *)v96;
v58 = (GameManager *)atoi(v57);
v59 = (int)v58;
v60 = GameManager::sharedState(v58);
v78 = v59 == *(_DWORD *)(v60 + 660) - *(_DWORD *)(v60 + 664);
if ( (v94 & 1) != 0 )
operator delete(v96);
v13 = *((_DWORD *)a2 + 79);
}
if ( !v13 )
{
v14 = *((unsigned __int8 *)a2 + 320);
v97 = 0;
v98 = 0;
v99 = nullptr;
if ( (v14 & 1) != 0 )
{
std::string::__init(&v97, *((void **)a2 + 42), *((_QWORD *)a2 + 41));
}
else
{
v15 = *((_QWORD *)a2 + 40);
v16 = *((_QWORD *)a2 + 41);
v99 = *((void **)a2 + 42);
v97 = v15;
v98 = v16;
}
v17 = (char *)&v97 + 1;
if ( (v97 & 1) != 0 )
v17 = (const char *)v99;
v79 = (char *)v17;
v120 = 0;
v121 = 0;
v122 = nullptr;
v18 = strlen(v17);
std::string::__init(&v120, v79, v18);
if ( (v97 & 1) != 0 )
operator delete(v99);
if ( (v120 & 1) != 0 )
operator delete(v122);
}
GameLevelManager::getBasePostString(v100);
v19 = *((_DWORD *)a2 + 79);
v20 = *((_BYTE *)a2 + 320);
v21 = (__int64 *)((char *)a2 + 320);
v102 = 0;
v103 = 0;
v104 = nullptr;
v73 = v19;
if ( (v20 & 1) != 0 )
{
std::string::__init(&v102, *((void **)a2 + 42), *((_QWORD *)a2 + 41));
}
else
{
v22 = *v21;
v23 = *((_QWORD *)a2 + 41);
v104 = *((void **)a2 + 42);
v102 = v22;
v103 = v23;
}
v80 = (char *)&v102 + 1;
if ( (v102 & 1) != 0 )
v80 = (char *)v104;
v24 = *((_BYTE *)a2 + 344);
v105 = 0;
v106 = 0;
v107 = nullptr;
if ( (v24 & 1) != 0 )
{
std::string::__init(&v105, *((void **)a2 + 45), *((_QWORD *)a2 + 44));
}
else
{
v25 = *((_QWORD *)a2 + 43);
v26 = *((_QWORD *)a2 + 44);
v107 = *((void **)a2 + 45);
v105 = v25;
v106 = v26;
}
v27 = (char *)&v105 + 1;
if ( (v105 & 1) != 0 )
v27 = (char *)v107;
v28 = *((_BYTE *)a2 + 368);
v108 = 0;
v109 = 0;
v110 = nullptr;
if ( (v28 & 1) != 0 )
{
std::string::__init(&v108, *((void **)a2 + 48), *((_QWORD *)a2 + 47));
}
else
{
v29 = *((_QWORD *)a2 + 46);
v30 = *((_QWORD *)a2 + 47);
v110 = *((void **)a2 + 48);
v108 = v29;
v109 = v30;
}
v31 = (char *)&v108 + 1;
if ( (v108 & 1) != 0 )
v31 = (char *)v110;
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",
(const char *)v73,
v80,
v27,
v31,
*((unsigned int *)a2 + 98),
*((unsigned int *)a2 + 100),
v6,
v76,
*((unsigned __int8 *)a2 + 406),
*((unsigned __int8 *)a2 + 407),
*((unsigned __int8 *)a2 + 408),
*((unsigned __int8 *)a2 + 409));
v81 = (char *)cocos2d::CCString::getCString(v32);
v33 = strlen(v81);
std::string::append((__int64)v100, v81, v33);
if ( (v108 & 1) != 0 )
operator delete(v110);
if ( (v105 & 1) != 0 )
operator delete(v107);
if ( (v102 & 1) != 0 )
operator delete(v104);
if ( v75 )
{
ActiveDailyID = GameLevelManager::getActiveDailyID((unsigned int *)this, v90);
v64 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&active=%i",
(const char *)ActiveDailyID);
v88 = (char *)cocos2d::CCString::getCString(v64);
v65 = strlen(v88);
std::string::append((__int64)v100, v88, v65);
}
if ( *((_BYTE *)a2 + 410) )
std::string::append((__int64)v100, "&epic=1", 7u);
if ( *((_BYTE *)a2 + 411) )
std::string::append((__int64)v100, "&legendary=1", 0xCu);
if ( *((_BYTE *)a2 + 412) )
std::string::append((__int64)v100, "&mythic=1", 9u);
if ( v78 )
std::string::append((__int64)v100, "&local=1", 8u);
if ( v74 )
{
std::string::append((__int64)v100, "&song=", 6u);
v34 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)v72);
v82 = (char *)cocos2d::CCString::getCString(v34);
v35 = strlen(v82);
std::string::append((__int64)v100, v82, v35);
if ( v71 )
std::string::append((__int64)v100, "&customSong=1", 0xDu);
}
GameLevelManager::writeSpecialFilters(a2, v111);
v36 = (char *)v111 + 1;
if ( (v111[0] & 1) != 0 )
v36 = (const char *)v112;
v83 = (char *)v36;
v37 = strlen(v36);
std::string::append((__int64)v100, v83, v37);
if ( (v111[0] & 1) != 0 )
operator delete(v112);
if ( v76 || v6 )
{
std::string::append((__int64)v100, "&completedLevels=", 0x11u);
v61 = (char *)&v91 + 1;
if ( (v91 & 1) != 0 )
v61 = v93;
v87 = (char *)v61;
v62 = strlen(v61);
std::string::append((__int64)v100, v87, v62);
}
v38 = *((_DWORD *)a2 + 79);
if ( v38 == 25 )
{
v66 = *((_BYTE *)a2 + 320);
v113 = 0;
v114 = 0;
v115 = nullptr;
if ( (v66 & 1) != 0 )
{
std::string::__init(&v113, *((void **)a2 + 42), *((_QWORD *)a2 + 41));
}
else
{
v67 = *v21;
v68 = *((_QWORD *)a2 + 41);
v115 = *((char **)a2 + 42);
v113 = v67;
v114 = v68;
}
if ( (v113 & 1) != 0 )
{
v70 = v115;
v89 = atoi(v115);
operator delete(v70);
v69 = v89;
}
else
{
v69 = atoi((const char *)&v113 + 1);
}
if ( !GameLevelManager::hasDownloadedList(this, v69) )
std::string::append((__int64)v100, "&inc=1", 6u);
v38 = *((_DWORD *)a2 + 79);
}
if ( v38 == 31 )
std::string::append((__int64)v100, "&hypeSecret=1", 0xDu);
std::string::append((__int64)v100, "&secret=", 8u);
v39 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
v84 = (char *)cocos2d::CCString::getCString(v39);
v40 = strlen(v84);
std::string::append((__int64)v100, v84, v40);
v116[0] = 0;
v116[1] = 0;
v117 = nullptr;
std::string::__init(v116, "https://www.boomlings.com/database/getGJLevels21.php", 0x34u);
v41 = (char *)v100 + 1;
if ( (v100[0] & 1) != 0 )
v41 = (const char *)v101;
v85 = (char *)v41;
v118[0] = 0;
v118[1] = 0;
v119 = nullptr;
v42 = strlen(v41);
std::string::__init(v118, v85, v42);
v120 = 0;
v121 = 0;
v122 = nullptr;
v43 = strlen(Key);
std::string::__init(&v120, Key, v43);
GameLevelManager::ProcessHttpRequest(this, v116, (__int64)v118, (char *)&v120, 2);
if ( (v120 & 1) != 0 )
operator delete(v122);
if ( (v118[0] & 1) != 0 )
operator delete(v119);
if ( (v116[0] & 1) != 0 )
operator delete(v117);
if ( (v100[0] & 1) != 0 )
operator delete(v101);
if ( (v91 & 1) != 0 )
operator delete(v93);
return _stack_chk_guard;
}