//
// GameLevelManager::getGJDailyLevelState from 0x72abc8 to 0x72b280 (1720 bytes)
//
// 3 xrefs:
// > DailyLevelPage::tryGetDailyStatus @ 0x912950
// > DailyLevelPage::init @ 0x914f1c
// > ??> @ 0x396d8
//
// 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
//
bool GameLevelManager::getGJDailyLevelState(GameLevelManager *a1, GJTimedLevelType a2)
{
bool v4; // w24
char *v5; // x1
char *v6; // x0
GameManager *v8; // x0
cocos2d::CCString *v9; // x0
char *CString; // x0
char *v11; // x0
cocos2d::CCString *v12; // x0
cocos2d::CCString *v13; // x0
size_t v14; // x0
void *v15; // x0
int *p_m_unknown2; // x0
char *v17; // x0
char *v18; // x0
char *v19; // x0
void *v20; // x0
void *v21; // x0
unsigned int *v22; // x1
int v23; // w2
unsigned int *v24; // x1
int v25; // w2
unsigned int *v26; // x1
int v27; // w2
unsigned int *v28; // x1
int v29; // w2
unsigned int *p_timeoutForConnect; // x1
int timeoutForConnect; // w2
unsigned int *v32; // x1
int v33; // w2
unsigned int *v34; // x1
int v35; // w2
unsigned int *v36; // x1
int v37; // w2
unsigned int *v38; // x1
int v39; // w2
char *v40; // [xsp+68h] [xbp+68h]
char *v41; // [xsp+68h] [xbp+68h]
char *v42; // [xsp+80h] [xbp+80h] BYREF
__int64 v43; // [xsp+88h] [xbp+88h] BYREF
__int64 v44; // [xsp+90h] [xbp+90h]
std::string v45; // [xsp+98h] [xbp+98h] BYREF
char *v46; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v47; // [xsp+A8h] [xbp+A8h] BYREF
const char *v48; // [xsp+B0h] [xbp+B0h] BYREF
const char *v49; // [xsp+B8h] [xbp+B8h] BYREF
cocos2d::extension::CCHttpClient *v50; // [xsp+C0h] [xbp+C0h] BYREF
std::string v51; // 0:x2.8
v42 = &byte_124B6C8;
if ( a2 == 1 )
{
sub_D1798C(&v42, "weekly_state", 12);
}
else if ( a2 == Event )
{
sub_D1798C(&v42, "event_state", 11);
}
else
{
sub_D1798C(&v42, "daily_state", 11);
}
v4 = 0;
if ( GameLevelManager::isDLActive(a1, v42) )
{
v5 = v42;
v6 = v42 - 24;
if ( v42 - 24 == (char *)&qword_124B6B0 )
return v4;
goto LABEL_19;
}
GameLevelManager::addDLToActive(a1, v42);
v8 = GameManager::sharedState();
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)(v8->m_chk.random - v8->m_chk.seed));
CString = (char *)cocos2d::CCString::getCString(v9);
sub_D153B8((int)&v43, CString);
sub_D153B8((int)&v45, "59182");
cocos2d::ZipUtils::base64EncodeEnc((cocos2d::ZipUtils *)&v43, &v45, v51);
v11 = (char *)v45.m_data.m_data - 24;
if ( (__int64 *)v45.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v38 = (unsigned int *)((char *)v45.m_data.m_data - 8);
do
v39 = __ldaxr(v38);
while ( __stlxr(v39 - 1, v38) );
}
else
{
v39 = *((_DWORD *)v45.m_data.m_data - 2);
*((_DWORD *)v45.m_data.m_data - 2) = v39 - 1;
}
if ( v39 <= 0 )
operator delete(v11);
}
GameLevelManager::getBasePostString(a1, (__int64)&v46);
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
v40 = (char *)cocos2d::CCString::getCString(v12);
gen_random(5, (__int64)&v47);
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&secret=%s&type=%i&chk=%s%s",
v40,
(unsigned int)a2,
v47,
v44);
v41 = (char *)cocos2d::CCString::getCString(v13);
v14 = strlen(v41);
sub_D15FD4(&v46, v41, v14);
v15 = (void *)(v47 - 24);
if ( (__int64 *)(v47 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v32 = (unsigned int *)(v47 - 8);
do
v33 = __ldaxr(v32);
while ( __stlxr(v33 - 1, v32) );
}
else
{
v33 = *(_DWORD *)(v47 - 8);
*(_DWORD *)(v47 - 8) = v33 - 1;
}
if ( v33 <= 0 )
operator delete(v15);
}
sub_D153B8((int)&v48, "https://www.boomlings.com/database/getGJDailyLevel.php");
sub_D153B8((int)&v49, v46);
sub_D18D28(&v50);
GameLevelManager::ProcessHttpRequest(a1, &v48, &v49, &v50, 48);
p_m_unknown2 = &v50[-1].m_unknown2;
if ( &v50[-1].m_unknown2 != (int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_timeoutForConnect = (unsigned int *)&v50[-1]._timeoutForConnect;
do
timeoutForConnect = __ldaxr(p_timeoutForConnect);
while ( __stlxr(timeoutForConnect - 1, p_timeoutForConnect) );
}
else
{
timeoutForConnect = v50[-1]._timeoutForConnect;
v50[-1]._timeoutForConnect = timeoutForConnect - 1;
}
if ( timeoutForConnect <= 0 )
operator delete(p_m_unknown2);
}
v17 = (char *)(v49 - 24);
if ( v49 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v36 = (unsigned int *)(v49 - 8);
do
v37 = __ldaxr(v36);
while ( __stlxr(v37 - 1, v36) );
}
else
{
v37 = *((_DWORD *)v49 - 2);
*((_DWORD *)v49 - 2) = v37 - 1;
}
if ( v37 <= 0 )
operator delete(v17);
}
v18 = (char *)(v48 - 24);
if ( v48 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v34 = (unsigned int *)(v48 - 8);
do
v35 = __ldaxr(v34);
while ( __stlxr(v35 - 1, v34) );
}
else
{
v35 = *((_DWORD *)v48 - 2);
*((_DWORD *)v48 - 2) = v35 - 1;
}
if ( v35 <= 0 )
operator delete(v18);
}
v19 = v46 - 24;
if ( v46 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v26 = (unsigned int *)(v46 - 8);
do
v27 = __ldaxr(v26);
while ( __stlxr(v27 - 1, v26) );
}
else
{
v27 = *((_DWORD *)v46 - 2);
*((_DWORD *)v46 - 2) = v27 - 1;
}
if ( v27 <= 0 )
operator delete(v19);
}
v20 = (void *)(v44 - 24);
if ( (__int64 *)(v44 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v28 = (unsigned int *)(v44 - 8);
do
v29 = __ldaxr(v28);
while ( __stlxr(v29 - 1, v28) );
}
else
{
v29 = *(_DWORD *)(v44 - 8);
*(_DWORD *)(v44 - 8) = v29 - 1;
}
if ( v29 <= 0 )
operator delete(v20);
}
v21 = (void *)(v43 - 24);
if ( (__int64 *)(v43 - 24) == &qword_124B6B0 )
goto LABEL_17;
if ( &pthread_create )
{
v24 = (unsigned int *)(v43 - 8);
do
v25 = __ldaxr(v24);
while ( __stlxr(v25 - 1, v24) );
}
else
{
v25 = *(_DWORD *)(v43 - 8);
*(_DWORD *)(v43 - 8) = v25 - 1;
}
if ( v25 > 0 )
{
LABEL_17:
v4 = 1;
}
else
{
v4 = 1;
operator delete(v21);
}
v5 = v42;
v6 = v42 - 24;
if ( v42 - 24 != (char *)&qword_124B6B0 )
{
LABEL_19:
if ( &pthread_create )
{
v22 = (unsigned int *)(v5 - 8);
do
v23 = __ldaxr(v22);
while ( __stlxr(v23 - 1, v22) );
}
else
{
v23 = *((_DWORD *)v5 - 2);
*((_DWORD *)v5 - 2) = v23 - 1;
}
if ( v23 <= 0 )
operator delete(v6);
}
return v4;
}