//
// GameLevelManager::updateThread from 0x828194 to 0x8285e0 (1100 bytes)
//
// 22 xrefs:
// > GameLevelManager::addThreadMembers @ 0x832e08
// > ThreadOptionsPopup::onMuteRow @ 0xc64730
// > ThreadOptionsPopup::onPinRow @ 0xc64818
// > ThreadDescPopup::sendDescription @ 0xc685dc
// > ThreadViewPopup::requestDeleteMessage @ 0xc690e0
// > MemberListPopup::onAddPolicy @ 0xc6b438
// > MemberListPopup::FLAlert_Clicked @ 0xc6b5b0
// > MemberListPopup::FLAlert_Clicked @ 0xc6b63c
// > MemberListPopup::FLAlert_Clicked @ 0xc6b6d8
// > ThreadOptionsPopup::FLAlert_Clicked @ 0xc6c0e8
// > ThreadOptionsPopup::FLAlert_Clicked @ 0xc6c1f8
// > ThreadOptionsPopup::FLAlert_Clicked @ 0xc6c26c
// > ThreadOptionsPopup::FLAlert_Clicked @ 0xc6c324
// > InvitesPopup::acceptInvite @ 0xc6cb50
// > InvitesPopup::FLAlert_Clicked @ 0xc6cebc
// > MessageThreadsPage::onMarkRead @ 0xc734f4
// > MessageThreadsPage::FLAlert_Clicked @ 0xc736f8
// > MessageThreadsPage::FLAlert_Clicked @ 0xc73778
// > MessageThreadsPage::FLAlert_Clicked @ 0xc73800
// > ThreadDescPopup::onSave @ 0xc7ac30
// > RenameThreadPopup::onSave @ 0xc7b018
// > ??> @ 0xf8c08
//
// 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::updateThread(cocos2d::CCObject *a1, char *a2, int a3, char *a4)
{
unsigned int v5; // w20
__int64 v9; // x1
cocos2d::CCString *v10; // x0
const char *CString; // x0
char *v12; // x25
size_t v13; // x0
__int64 v14; // x26
__int64 v15; // x26
cocos2d::CCNode *v16; // x0
__int64 v17; // x27
cocos2d::CCObject *v18; // x26
size_t v19; // x0
cocos2d::CCString *v20; // x0
__int64 v21; // x0
cocos2d::CCString *v22; // x0
size_t v23; // x0
__int64 v24; // x1
char v25; // w0
__int64 v26; // x0
__int64 v27; // x1
char *v28; // x1
size_t v29; // x2
const char *v30; // x1
size_t v31; // x0
size_t v32; // x0
char *v33; // [xsp+68h] [xbp+68h]
char *v34; // [xsp+68h] [xbp+68h]
__int64 v35[2]; // [xsp+78h] [xbp+78h] BYREF
void *v36; // [xsp+88h] [xbp+88h]
__int64 v37; // [xsp+90h] [xbp+90h] BYREF
__int64 v38; // [xsp+98h] [xbp+98h]
void *v39; // [xsp+A0h] [xbp+A0h]
size_t v40[2]; // [xsp+A8h] [xbp+A8h] BYREF
void *v41; // [xsp+B8h] [xbp+B8h]
__int64 v42[2]; // [xsp+C0h] [xbp+C0h] BYREF
void *v43; // [xsp+D0h] [xbp+D0h]
__int64 v44[2]; // [xsp+D8h] [xbp+D8h] BYREF
void *v45; // [xsp+E8h] [xbp+E8h]
cocos2d::CCNode *v46; // [xsp+F0h] [xbp+F0h] BYREF
__int64 v47; // [xsp+F8h] [xbp+F8h]
void *v48; // [xsp+100h] [xbp+100h]
v5 = (unsigned int)a2;
if ( ((unsigned int)a2 & 0x80000000) != 0 || a3 <= 0 )
return 0;
if ( !(_DWORD)a2 && a3 != 3 )
{
if ( a3 != 1 )
return 0;
v9 = (unsigned __int8)*a4 >> 1;
if ( (*a4 & 1) != 0 )
v9 = *((_QWORD *)a4 + 1);
if ( !v9 )
return 0;
}
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"threadUpd_%i_%i",
(const char *)v5,
(unsigned int)a3);
CString = (const char *)cocos2d::CCString::getCString(v10);
v46 = nullptr;
v12 = (char *)CString;
v47 = 0;
v48 = nullptr;
v13 = strlen(CString);
v14 = *((_QWORD *)a1 + 136);
std::string::__init((__int64 *)&v46, v12, v13);
v15 = cocos2d::CCDictionary::objectForKey(v14, &v46);
v16 = (cocos2d::CCNode *)(unsigned __int8)v46;
if ( ((unsigned __int8)v46 & 1) != 0 )
{
operator delete(v48);
if ( !v15 )
goto LABEL_12;
return 0;
}
if ( v15 )
return 0;
LABEL_12:
v17 = *((_QWORD *)a1 + 136);
v18 = (cocos2d::CCObject *)cocos2d::CCNode::create(v16);
v46 = nullptr;
v47 = 0;
v48 = nullptr;
v19 = strlen(v12);
std::string::__init((__int64 *)&v46, v12, v19);
cocos2d::CCDictionary::setObject(v17, v18);
if ( ((unsigned __int8)v46 & 1) != 0 )
operator delete(v48);
GameLevelManager::getBasePostString(v35);
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
v21 = cocos2d::CCString::getCString(v20);
v22 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&threadID=%i&mode=%i&secret=%s",
(const char *)v5,
(unsigned int)a3,
v21);
v33 = (char *)cocos2d::CCString::getCString(v22);
v23 = strlen(v33);
std::string::append((__int64)v35, v33, v23);
v24 = (unsigned __int8)*a4 >> 1;
if ( (*a4 & 1) != 0 )
v24 = *((_QWORD *)a4 + 1);
if ( v24 )
{
std::string::append((__int64)v35, "&value=", 7u);
v25 = *a4;
v37 = 0;
v38 = 0;
v39 = nullptr;
if ( (v25 & 1) != 0 )
{
std::string::__init(&v37, *((void **)a4 + 2), *((_QWORD *)a4 + 1));
}
else
{
v26 = *(_QWORD *)a4;
v27 = *((_QWORD *)a4 + 1);
v39 = *((void **)a4 + 2);
v37 = v26;
v38 = v27;
}
LevelTools::base64EncodeString((__int64)&v37, v40);
if ( (v40[0] & 1) != 0 )
{
v28 = (char *)v41;
v29 = v40[1];
}
else
{
v29 = LOBYTE(v40[0]) >> 1;
v28 = (char *)v40 + 1;
}
std::string::append((__int64)v35, v28, v29);
if ( (v40[0] & 1) != 0 )
operator delete(v41);
if ( (v37 & 1) != 0 )
operator delete(v39);
}
v42[0] = 0;
v42[1] = 0;
v43 = nullptr;
std::string::__init(v42, "https://www.boomlings.com/database/updateGJThread.php", 0x35u);
v30 = (char *)v35 + 1;
if ( (v35[0] & 1) != 0 )
v30 = (const char *)v36;
v34 = (char *)v30;
v44[0] = 0;
v44[1] = 0;
v45 = nullptr;
v31 = strlen(v30);
std::string::__init(v44, v34, v31);
v46 = nullptr;
v47 = 0;
v48 = nullptr;
v32 = strlen(v12);
std::string::__init((__int64 *)&v46, v12, v32);
GameLevelManager::ProcessHttpRequest(a1, v42, (__int64)v44, (char *)&v46, 95);
if ( ((unsigned __int8)v46 & 1) != 0 )
operator delete(v48);
if ( (v44[0] & 1) != 0 )
operator delete(v45);
if ( (v42[0] & 1) != 0 )
operator delete(v43);
if ( (v35[0] & 1) != 0 )
operator delete(v36);
return 1;
}