//
// GameLevelManager::sendThreadMessage from 0x4bf0ac to 0x4bf4b6 (1034 bytes)
//
// 2 xrefs:
// > NewThreadPopup::onSend @ 0x75511a
// > ThreadViewPopup::onSend @ 0x75dd8a
//
// 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:21 +0000
//
int __fastcall GameLevelManager::sendThreadMessage(
int a1,
const char *a2,
const char *a3,
char *a4,
unsigned __int8 *a5,
__int64 a6,
unsigned __int8 *a7,
char a8,
unsigned __int8 *a9,
unsigned __int8 *a10)
{
int v15; // r3
int v16; // r3
cocos2d::CCObject *v17; // r3
cocos2d::CCNode *v18; // r0
cocos2d::CCObject *v19; // r0
char v20; // r3
cocos2d::CCString *v21; // r0
int CString; // r0
cocos2d::CCString *v23; // r0
char *v24; // r0
const char *v25; // r1
char *v26; // r1
size_t v27; // r2
size_t v28; // r0
int v29; // r3
int v30; // r3
int v31; // r3
int v32; // r3
char *v33; // r2
cocos2d::CCString *v34; // r0
char *v35; // r0
int v36; // r3
int v37; // r3
char *v38; // r1
size_t v39; // r2
int v40; // r3
int v41; // r3
char *v42; // r1
size_t v43; // r2
int v44; // r3
int v45; // r3
char *v46; // r1
size_t v47; // r2
cocos2d::CCString *v48; // r0
char *v49; // r0
cocos2d::CCObject *v50; // [sp+1Ch] [bp-C0h]
cocos2d::CCObject *v51; // [sp+1Ch] [bp-C0h]
cocos2d::CCObject *v52; // [sp+1Ch] [bp-C0h]
int v53; // [sp+20h] [bp-BCh]
char *v54[3]; // [sp+2Ch] [bp-B0h] BYREF
int v55[3]; // [sp+38h] [bp-A4h] BYREF
_DWORD v56[3]; // [sp+44h] [bp-98h] BYREF
int v57[3]; // [sp+50h] [bp-8Ch] BYREF
_DWORD v58[3]; // [sp+5Ch] [bp-80h] BYREF
int v59[3]; // [sp+68h] [bp-74h] BYREF
_DWORD v60[3]; // [sp+74h] [bp-68h] BYREF
int v61[3]; // [sp+80h] [bp-5Ch] BYREF
_DWORD v62[3]; // [sp+8Ch] [bp-50h] BYREF
int v63[3]; // [sp+98h] [bp-44h] BYREF
_DWORD v64[3]; // [sp+A4h] [bp-38h] BYREF
int v65[3]; // [sp+B0h] [bp-2Ch] BYREF
int v66[3]; // [sp+BCh] [bp-20h] BYREF
int v67; // [sp+C8h] [bp-14h] BYREF
int v68; // [sp+CCh] [bp-10h]
int v69; // [sp+D0h] [bp-Ch]
if ( (int)a2 < 0 )
return 0;
v15 = *a5;
if ( (v15 & 1) != 0 )
v16 = *((_DWORD *)a5 + 1);
else
v16 = v15 >> 1;
if ( v16 )
{
if ( a2 )
goto LABEL_13;
if ( (int)a3 > 0 )
{
LABEL_12:
if ( a8 )
goto LABEL_13;
goto LABEL_33;
}
LABEL_28:
v29 = *a7;
if ( (v29 & 1) != 0 )
v30 = *((_DWORD *)a7 + 1);
else
v30 = v29 >> 1;
if ( !v30 )
return 0;
goto LABEL_12;
}
if ( a2 || a8 )
return 0;
if ( (int)a3 <= 0 )
goto LABEL_28;
LABEL_33:
v31 = (unsigned __int8)*a4;
if ( (v31 & 1) != 0 )
v32 = *((_DWORD *)a4 + 1);
else
v32 = v31 >> 1;
if ( !v32 )
return 0;
LABEL_13:
v17 = *(cocos2d::CCObject **)(a1 + 748);
v67 = 0;
v68 = 0;
v69 = 0;
v50 = v17;
std::string::__init(&v67, "threadSend", 0xAu);
v51 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(v50, &v67);
v18 = (cocos2d::CCNode *)std::string::~string((int)&v67);
if ( v51 )
return 0;
v53 = *(_DWORD *)(a1 + 748);
v19 = (cocos2d::CCObject *)cocos2d::CCNode::create(v18);
v67 = 0;
v68 = 0;
v69 = 0;
v52 = v19;
std::string::__init(&v67, "threadSend", 0xAu);
cocos2d::CCDictionary::setObject(v53, v52);
std::string::~string((int)&v67);
if ( a2 )
v20 = 0;
else
v20 = a8;
*(_BYTE *)(a1 + 333) = a2 == nullptr;
*(_BYTE *)(a1 + 332) = v20;
*(_BYTE *)(a1 + 334) = 0;
GameLevelManager::getBasePostString((GameLevelManager *)v54);
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&a1i2r3e45s789g[9]);
CString = cocos2d::CCString::getCString(v21);
v23 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&threadID=%i&secret=%s",
a2,
CString);
v24 = (char *)cocos2d::CCString::getCString(v23);
std::string::append(v54, v24);
if ( !a2 )
{
if ( a8 )
std::string::append(v54, "&isDM=1");
std::string::basic_string(v55, (int)a4);
a4 = (char *)v56;
LevelTools::base64EncodeString(v56, v55);
if ( (v56[0] & 1) != 0 )
v33 = (char *)v56[2];
else
v33 = (char *)v56 + 1;
v34 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&toAccountID=%i&subject=%s",
a3,
v33,
LOBYTE(v56[0]) << 31);
v35 = (char *)cocos2d::CCString::getCString(v34);
std::string::append(v54, v35);
std::string::~string((int)v56);
std::string::~string((int)v55);
v36 = *a7;
if ( (v36 & 1) != 0 )
v37 = *((_DWORD *)a7 + 1);
else
v37 = v36 >> 1;
if ( v37 )
{
std::string::append(v54, "&targets=");
std::string::basic_string(v57, (int)a7);
LevelTools::base64EncodeString(v58, v57);
if ( (v58[0] & 1) != 0 )
{
v38 = (char *)v58[2];
v39 = v58[1];
}
else
{
v39 = (int)LOBYTE(v58[0]) >> 1;
v38 = (char *)v58 + 1;
}
std::string::append(v54, v38, v39);
std::string::~string((int)v58);
std::string::~string((int)v57);
}
v40 = *a9;
if ( (v40 & 1) != 0 )
v41 = *((_DWORD *)a9 + 1);
else
v41 = v40 >> 1;
if ( v41 )
{
std::string::append(v54, "&description=");
std::string::basic_string(v59, (int)a9);
LevelTools::base64EncodeString(v60, v59);
if ( (v60[0] & 1) != 0 )
{
v42 = (char *)v60[2];
v43 = v60[1];
}
else
{
v43 = (int)LOBYTE(v60[0]) >> 1;
v42 = (char *)v60 + 1;
}
std::string::append(v54, v42, v43);
std::string::~string((int)v60);
std::string::~string((int)v59);
}
v44 = *a10;
if ( (v44 & 1) != 0 )
v45 = *((_DWORD *)a10 + 1);
else
v45 = v44 >> 1;
if ( v45 )
{
std::string::append(v54, "&emote=");
std::string::basic_string(v61, (int)a10);
LevelTools::base64EncodeString(v62, v61);
if ( (v62[0] & 1) != 0 )
{
v46 = (char *)v62[2];
v47 = v62[1];
}
else
{
v47 = (int)LOBYTE(v62[0]) >> 1;
v46 = (char *)v62 + 1;
}
std::string::append(v54, v46, v47);
std::string::~string((int)v62);
std::string::~string((int)v61);
}
}
if ( a6 )
{
v48 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"&token=%llu", v25, a6);
v49 = (char *)cocos2d::CCString::getCString(v48);
std::string::append(v54, v49);
}
std::string::append(v54, "&body=");
std::string::basic_string(v63, (int)a5);
LevelTools::base64EncodeString(v64, v63);
if ( (v64[0] & 1) != 0 )
{
v26 = (char *)v64[2];
v27 = v64[1];
}
else
{
v27 = (int)LOBYTE(v64[0]) >> 1;
v26 = (char *)v64 + 1;
}
std::string::append(v54, v26, v27);
std::string::~string((int)v64);
std::string::~string((int)v63);
memset(v65, 0, sizeof(v65));
std::string::__init(v65, "https://www.boomlings.com/database/sendGJThreadMessage.php", 0x3Au);
v66[0] = 0;
v66[1] = 0;
if ( ((int)v54[0] & 1) == 0 )
a4 = (char *)v54 + 1;
v66[2] = 0;
if ( ((int)v54[0] & 1) != 0 )
a4 = v54[2];
v28 = strlen(a4);
std::string::__init(v66, a4, v28);
v67 = 0;
v68 = 0;
v69 = 0;
std::string::__init(&v67, "threadSend", 0xAu);
GameLevelManager::ProcessHttpRequest((GameManager *)a1, v65, (int)v66, (int)&v67, 91);
std::string::~string((int)&v67);
std::string::~string((int)v66);
std::string::~string((int)v65);
std::string::~string((int)v54);
return 1;
}