//
// GameLevelManager::getThreadMessages from 0x826578 to 0x826a64 (1260 bytes)
//
// 7 xrefs:
// > ThreadViewPopup::requestMessages @ 0xc658b0
// > ThreadViewPopup::refetchLatest @ 0xc65f40
// > ThreadViewPopup::onAutoRefresh @ 0xc68ff4
// > ThreadViewPopup::goToDate @ 0xc867b0
// > ThreadViewPopup::openAt @ 0xc86a70
// > ThreadViewPopup::threadMessagesFinished @ 0xc8af50
// > ??> @ 0x42580
//
// 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:04 +0000
//
__int64 __fastcall GameLevelManager::getThreadMessages(
cocos2d::CCObject *a1,
char *a2,
__int64 a3,
__int64 a4,
unsigned int a5,
const char *a6,
char *a7)
{
unsigned int v7; // w20
__int64 v14; // x5
cocos2d::CCString *v15; // x0
const char *CString; // x0
char *v17; // x28
size_t v18; // x0
__int64 v19; // x1
cocos2d::CCNode *v20; // x0
__int64 v22; // x1
size_t v23; // x0
cocos2d::CCString *v24; // x0
__int64 v25; // x0
cocos2d::CCString *v26; // x0
size_t v27; // x0
cocos2d::CCString *v28; // x0
size_t v29; // x0
cocos2d::CCString *v30; // x0
size_t v31; // x0
const char *v32; // x1
size_t v33; // x0
size_t v34; // x0
char v35; // w0
__int64 v36; // x0
__int64 v37; // x1
char *v38; // x1
size_t v39; // x2
void *v40; // [xsp+68h] [xbp+68h]
char *v41; // [xsp+68h] [xbp+68h]
char *v42; // [xsp+68h] [xbp+68h]
int v43; // [xsp+70h] [xbp+70h]
char *v44; // [xsp+70h] [xbp+70h]
cocos2d::CCObject *v45; // [xsp+78h] [xbp+78h]
cocos2d::CCObject *v46; // [xsp+78h] [xbp+78h]
cocos2d::CCObject *v47; // [xsp+78h] [xbp+78h]
cocos2d::CCObject *v48; // [xsp+78h] [xbp+78h]
__int64 v49[2]; // [xsp+88h] [xbp+88h] BYREF
void *v50; // [xsp+98h] [xbp+98h]
__int64 v51; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v52; // [xsp+A8h] [xbp+A8h]
void *v53; // [xsp+B0h] [xbp+B0h]
size_t v54[2]; // [xsp+B8h] [xbp+B8h] BYREF
void *v55; // [xsp+C8h] [xbp+C8h]
__int64 v56[2]; // [xsp+D0h] [xbp+D0h] BYREF
void *v57; // [xsp+E0h] [xbp+E0h]
__int64 v58[2]; // [xsp+E8h] [xbp+E8h] BYREF
void *v59; // [xsp+F8h] [xbp+F8h]
__int64 v60; // [xsp+100h] [xbp+100h] BYREF
__int64 v61; // [xsp+108h] [xbp+108h]
void *v62; // [xsp+110h] [xbp+110h]
v7 = (unsigned int)a2;
if ( (int)a2 <= 0 || a3 < 0 || a4 < 0 || ((unsigned __int64)a6 & 0x8000000000000000LL) != 0 )
return 0;
if ( a6 )
goto LABEL_6;
v22 = (unsigned __int8)*a7 >> 1;
if ( (*a7 & 1) != 0 )
v22 = *((_QWORD *)a7 + 1);
if ( !v22 )
{
LABEL_6:
v43 = 0;
v14 = 0;
}
else
{
v43 = 1;
v14 = 1;
}
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"threadMsgs_%i_%lli_%lli_%lli_%i",
(const char *)v7,
a3,
a4,
a6,
v14);
CString = (const char *)cocos2d::CCString::getCString(v15);
v60 = 0;
v17 = (char *)CString;
v45 = *((cocos2d::CCObject **)a1 + 136);
v61 = 0;
v62 = nullptr;
v18 = strlen(CString);
std::string::__init(&v60, v17, v18);
v19 = cocos2d::CCDictionary::objectForKey(v45, &v60);
v20 = (cocos2d::CCNode *)(unsigned __int8)v60;
if ( (v60 & 1) != 0 )
{
v46 = (cocos2d::CCObject *)v19;
operator delete(v62);
if ( v46 )
return 0;
}
else if ( v19 )
{
return 0;
}
v40 = *((void **)a1 + 136);
v47 = (cocos2d::CCObject *)cocos2d::CCNode::create(v20);
v60 = 0;
v61 = 0;
v62 = nullptr;
v23 = strlen(v17);
std::string::__init(&v60, v17, v23);
cocos2d::CCDictionary::setObject((int)v40, v47);
if ( (v60 & 1) != 0 )
operator delete(v62);
GameLevelManager::getBasePostString(v49);
v24 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
v25 = cocos2d::CCString::getCString(v24);
v26 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&threadID=%i&beforeID=%lli&afterID=%lli&secret=%s",
(const char *)v7,
a3,
a4,
v25);
v41 = (char *)cocos2d::CCString::getCString(v26);
v27 = strlen(v41);
std::string::append((__int64)v49, v41, v27);
if ( (a5 & 0x80000000) == 0 )
{
v28 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"&mv=%i", (const char *)a5);
v42 = (char *)cocos2d::CCString::getCString(v28);
v29 = strlen(v42);
std::string::append((__int64)v49, v42, v29);
}
if ( a6 )
{
v30 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"&aroundID=%lli", a6);
v44 = (char *)cocos2d::CCString::getCString(v30);
v31 = strlen(v44);
std::string::append((__int64)v49, v44, v31);
}
else if ( v43 )
{
std::string::append((__int64)v49, "&date=", 6u);
v35 = *a7;
v51 = 0;
v52 = 0;
v53 = nullptr;
if ( (v35 & 1) != 0 )
{
std::string::__init(&v51, *((void **)a7 + 2), *((_QWORD *)a7 + 1));
}
else
{
v36 = *(_QWORD *)a7;
v37 = *((_QWORD *)a7 + 1);
v53 = *((void **)a7 + 2);
v51 = v36;
v52 = v37;
}
LevelTools::base64EncodeString((__int64)&v51, v54);
if ( (v54[0] & 1) != 0 )
{
v38 = (char *)v55;
v39 = v54[1];
}
else
{
v39 = LOBYTE(v54[0]) >> 1;
v38 = (char *)v54 + 1;
}
std::string::append((__int64)v49, v38, v39);
if ( (v54[0] & 1) != 0 )
operator delete(v55);
if ( (v51 & 1) != 0 )
operator delete(v53);
}
v56[0] = 0;
v56[1] = 0;
v57 = nullptr;
std::string::__init(v56, "https://www.boomlings.com/database/getGJThreadMessages.php", 0x3Au);
v32 = (char *)v49 + 1;
if ( (v49[0] & 1) != 0 )
v32 = (const char *)v50;
v48 = (cocos2d::CCObject *)v32;
v58[0] = 0;
v58[1] = 0;
v59 = nullptr;
v33 = strlen(v32);
std::string::__init(v58, v48, v33);
v60 = 0;
v61 = 0;
v62 = nullptr;
v34 = strlen(v17);
std::string::__init(&v60, v17, v34);
GameLevelManager::ProcessHttpRequest(a1, v56, (__int64)v58, (char *)&v60, 93);
if ( (v60 & 1) != 0 )
operator delete(v62);
if ( (v58[0] & 1) != 0 )
operator delete(v59);
if ( (v56[0] & 1) != 0 )
operator delete(v57);
if ( (v49[0] & 1) != 0 )
operator delete(v50);
return 1;
}