//
// GameLevelManager::getThreadMessages from 0x4bf784 to 0x4bfa20 (668 bytes)
//
// 6 xrefs:
// > ThreadViewPopup::requestMessages @ 0x74947a
// > ThreadViewPopup::onAutoRefresh @ 0x749aa4
// > ThreadViewPopup::refetchLatest @ 0x749b6a
// > ThreadViewPopup::goToDate @ 0x75bec6
// > ThreadViewPopup::openAt @ 0x75c06a
// > ThreadViewPopup::threadMessagesFinished @ 0x75ebb2
//
// 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:22 +0000
//
int __fastcall GameLevelManager::getThreadMessages(
GameManager *a1,
const char *a2,
int a3,
int a4,
int a5,
int a6,
char *a7,
__int64 a8,
unsigned __int8 *a9)
{
const char *v10; // r11
int v12; // r4
int v13; // r4
_BOOL4 v14; // r4
cocos2d::CCString *v15; // r0
const char *CString; // r0
int v17; // r6
const char *v18; // r7
size_t v19; // r0
int v20; // r6
cocos2d::CCNode *v21; // r0
cocos2d::CCObject *v22; // r0
size_t v23; // r0
cocos2d::CCString *v24; // r0
int v25; // r0
cocos2d::CCString *v26; // r0
char *v27; // r0
const char *v28; // r1
cocos2d::CCString *v29; // r0
char *v30; // r0
cocos2d::CCString *v31; // r0
char *v32; // r0
char *v33; // r1
size_t v34; // r2
size_t v35; // r0
size_t v36; // r0
cocos2d::CCObject *v40; // [sp+28h] [bp-5Ch]
int v41; // [sp+2Ch] [bp-58h]
char *v42[3]; // [sp+34h] [bp-50h] BYREF
int v43[3]; // [sp+40h] [bp-44h] BYREF
_DWORD v44[3]; // [sp+4Ch] [bp-38h] BYREF
int v45[3]; // [sp+58h] [bp-2Ch] BYREF
int v46[3]; // [sp+64h] [bp-20h] BYREF
int v47; // [sp+70h] [bp-14h] BYREF
int v48; // [sp+74h] [bp-10h]
int v49; // [sp+78h] [bp-Ch]
v10 = (const char *)HIDWORD(a8);
if ( (int)a2 <= 0 || a4 < 0 || a6 < 0 || a8 < 0 )
return 0;
if ( a8 )
{
v14 = 0;
}
else
{
v12 = *a9;
v13 = (v12 & 1) != 0 ? *((_DWORD *)a9 + 1) : v12 >> 1;
v14 = v13 != 0;
}
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"threadMsgs_%i_%lli_%lli_%lli_%i",
a2,
a3,
a4,
a5,
a6,
a8,
v14);
CString = (const char *)cocos2d::CCString::getCString(v15);
v47 = 0;
v48 = 0;
v49 = 0;
v17 = *((_DWORD *)a1 + 187);
v18 = CString;
v19 = strlen(CString);
std::string::__init(&v47, v18, v19);
v20 = cocos2d::CCDictionary::objectForKey(v17, &v47);
v21 = (cocos2d::CCNode *)std::string::~string((int)&v47);
if ( v20 )
return 0;
v41 = *((_DWORD *)a1 + 187);
v22 = (cocos2d::CCObject *)cocos2d::CCNode::create(v21);
v47 = 0;
v48 = 0;
v49 = 0;
v40 = v22;
v23 = strlen(v18);
std::string::__init(&v47, v18, v23);
cocos2d::CCDictionary::setObject(v41, v40);
std::string::~string((int)&v47);
GameLevelManager::getBasePostString((GameLevelManager *)v42);
v24 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&a1i2r3e45s789g[9]);
v25 = cocos2d::CCString::getCString(v24);
v26 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&threadID=%i&beforeID=%lli&afterID=%lli&secret=%s",
a2,
a3,
a4,
a5,
a6,
v25);
v27 = (char *)cocos2d::CCString::getCString(v26);
std::string::append(v42, v27);
if ( (int)a7 >= 0 )
{
v29 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"&mv=%i", a7);
v30 = (char *)cocos2d::CCString::getCString(v29);
std::string::append(v42, v30);
}
if ( a8 )
{
v31 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"&aroundID=%lli", v28, a8);
v32 = (char *)cocos2d::CCString::getCString(v31);
std::string::append(v42, v32);
}
else if ( v14 )
{
std::string::append(v42, "&date=");
std::string::basic_string(v43, (int)a9);
LevelTools::base64EncodeString(v44, v43);
if ( (v44[0] & 1) != 0 )
{
v33 = (char *)v44[2];
v34 = v44[1];
}
else
{
v34 = (int)LOBYTE(v44[0]) >> 1;
v33 = (char *)v44 + 1;
}
std::string::append(v42, v33, v34);
std::string::~string((int)v44);
std::string::~string((int)v43);
}
memset(v45, 0, sizeof(v45));
std::string::__init(v45, "https://www.boomlings.com/database/getGJThreadMessages.php", 0x3Au);
v46[0] = 0;
v46[1] = 0;
if ( ((int)v42[0] & 1) == 0 )
v10 = (char *)v42 + 1;
v46[2] = 0;
if ( ((int)v42[0] & 1) != 0 )
v10 = v42[2];
v35 = strlen(v10);
std::string::__init(v46, v10, v35);
v47 = 0;
v48 = 0;
v49 = 0;
v36 = strlen(v18);
std::string::__init(&v47, v18, v36);
GameLevelManager::ProcessHttpRequest(a1, v45, (int)v46, (int)&v47, 93);
std::string::~string((int)&v47);
std::string::~string((int)v46);
std::string::~string((int)v45);
std::string::~string((int)v42);
return 1;
}