//
// GameLevelManager::sendThreadMessage from 0x100572090 to 0x1005727d3 (1859 bytes)
//
// 2 xrefs:
// > sub_10092F790 @ 0x10092f9df
// > NewThreadPopup::onSend @ 0x1009467e7
//
// This function is hookable on this platform (idp: pc, 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:32:15 +0000
//
char __fastcall GameLevelManager::sendThreadMessage(
__int64 a1,
int a2,
int a3,
std::string *a4,
std::string *a5,
__int64 a6,
unsigned __int8 *a7,
char a8,
unsigned __int8 *a9,
unsigned __int8 *a10)
{
unsigned int v12; // eax
char v13; // dl
unsigned __int8 *v14; // rcx
char v15; // r14
unsigned int v16; // eax
unsigned int v17; // eax
__int64 v18; // rdi
__int64 v19; // rbx
__int64 v21; // rbx
void *v22; // rax
__int64 v23; // rcx
__int64 v24; // rax
__int64 v25; // rax
const std::string::value_type *CString; // rax
__int64 v27; // rax
const std::string::value_type *v28; // rax
unsigned int v29; // eax
const std::string::value_type *data; // rsi
std::string::size_type size; // rdx
unsigned int v32; // eax
const std::string::value_type *v33; // rsi
std::string::size_type v34; // rdx
unsigned int v35; // eax
const std::string::value_type *v36; // rsi
std::string::size_type v37; // rdx
__int64 v38; // rax
const std::string::value_type *v39; // rax
const std::string::value_type *v40; // rsi
std::string::size_type v41; // rdx
const char *v42; // r14
size_t v43; // rax
size_t v44; // r15
char *v45; // r12
size_t v46; // r13
char v47; // [rsp+0h] [rbp-160h]
char v48; // [rsp+0h] [rbp-160h]
std::string v50; // [rsp+18h] [rbp-148h] BYREF
std::string v51; // [rsp+30h] [rbp-130h] BYREF
std::string v52; // [rsp+50h] [rbp-110h] BYREF
std::string v53; // [rsp+70h] [rbp-F0h] BYREF
std::string v54; // [rsp+90h] [rbp-D0h] BYREF
std::string v55; // [rsp+B0h] [rbp-B0h] BYREF
__int128 v56; // [rsp+C8h] [rbp-98h] BYREF
void *v57; // [rsp+D8h] [rbp-88h]
__int64 v58; // [rsp+E0h] [rbp-80h]
_QWORD __dst[2]; // [rsp+E8h] [rbp-78h] BYREF
void *v60; // [rsp+F8h] [rbp-68h]
__int64 v61; // [rsp+100h] [rbp-60h]
std::string v62; // [rsp+108h] [rbp-58h] BYREF
std::string v63[2]; // [rsp+120h] [rbp-40h] BYREF
v58 = a6;
if ( a2 < 0 )
return 0;
v12 = (unsigned int)a5->__r_.__value_.__l.0;
if ( (v12 & 1) != 0 )
{
v13 = a8;
v14 = a7;
if ( a5->__r_.__value_.__l.__size_ )
goto LABEL_4;
}
else
{
v13 = a8;
v14 = a7;
if ( v12 >> 1 )
{
LABEL_4:
if ( a2 )
{
v15 = 0;
goto LABEL_17;
}
goto LABEL_8;
}
}
if ( (unsigned __int8)v13 | (a2 != 0) )
return 0;
LABEL_8:
if ( a3 <= 0 )
{
v17 = *v14;
if ( (v17 & 1) != 0 )
{
if ( !*((_QWORD *)v14 + 1) )
return 0;
}
else if ( !(v17 >> 1) )
{
return 0;
}
}
v15 = 1;
if ( v13 )
goto LABEL_17;
v16 = (unsigned int)a4->__r_.__value_.__l.0;
if ( (v16 & 1) == 0 )
{
if ( v16 >> 1 )
goto LABEL_17;
return 0;
}
if ( !a4->__r_.__value_.__l.__size_ )
return 0;
LABEL_17:
v61 = a1;
v18 = *(_QWORD *)(a1 + 1088);
v62.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)20;
strcpy(v62.__r_.__value_.__s.__data_, "threadSend");
v19 = cocos2d::CCDictionary::objectForKey(v18, (char *)&v62);
if ( (*(_BYTE *)&v62.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v62.__r_.__value_.__l.__data_);
if ( v19 )
return 0;
v21 = *(_QWORD *)(v61 + 1088);
v22 = cocos2d::CCNode::create();
v62.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)20;
strcpy(v62.__r_.__value_.__s.__data_, "threadSend");
cocos2d::CCDictionary::setObject(v21, (__int64)v22, (char *)&v62);
if ( (*(_BYTE *)&v62.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v62.__r_.__value_.__l.__data_);
v23 = v61;
*(_BYTE *)(v61 + 448) = a8 & v15;
*(_BYTE *)(v23 + 449) = v15;
*(_BYTE *)(v23 + 450) = 0;
GameLevelManager::getBasePostString(&v62);
v24 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v24);
v25 = sub_10088E820("&threadID=%i&secret=%s", v47);
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v25);
std::string::append(&v62, CString);
if ( !v15 )
goto LABEL_77;
if ( a8 )
std::string::append(&v62, "&isDM=1");
if ( (*(_BYTE *)&a4->__r_.__value_.__s.0 & 1) != 0 )
sub_10001AD30(&v51, a4->__r_.__value_.__l.__data_, a4->__r_.__value_.__l.__size_);
else
v51 = *a4;
LevelTools::base64EncodeString(v63, &v51);
v27 = sub_10088E820("&toAccountID=%i&subject=%s", v48);
v28 = (const std::string::value_type *)cocos2d::CCString::getCString(v27);
std::string::append(&v62, v28);
if ( (*(_BYTE *)&v63[0].__r_.__value_.__s.0 & 1) != 0 )
{
operator delete(v63[0].__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v51.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_33:
v29 = *a7;
if ( (v29 & 1) != 0 )
goto LABEL_34;
goto LABEL_38;
}
}
else if ( (*(_BYTE *)&v51.__r_.__value_.__s.0 & 1) == 0 )
{
goto LABEL_33;
}
operator delete(v51.__r_.__value_.__l.__data_);
v29 = *a7;
if ( (v29 & 1) != 0 )
{
LABEL_34:
if ( !*((_QWORD *)a7 + 1) )
goto LABEL_49;
goto LABEL_39;
}
LABEL_38:
if ( !(v29 >> 1) )
goto LABEL_49;
LABEL_39:
std::string::append(&v62, "&targets=");
if ( (*a7 & 1) != 0 )
{
sub_10001AD30(&v52, *((const void **)a7 + 2), *((_QWORD *)a7 + 1));
}
else
{
v52.__r_.__value_.__r.__words[2] = *((_QWORD *)a7 + 2);
*(_OWORD *)&v52.__r_.__value_.__l.0 = *(_OWORD *)a7;
}
LevelTools::base64EncodeString(v63, &v52);
if ( (*(_BYTE *)&v63[0].__r_.__value_.__s.0 & 1) != 0 )
{
data = v63[0].__r_.__value_.__l.__data_;
size = v63[0].__r_.__value_.__l.__size_;
}
else
{
size = *(_BYTE *)&v63[0].__r_.__value_.__l.0 >> 1;
data = v63[0].__r_.__value_.__s.__data_;
}
std::string::append(&v62, data, size);
if ( (*(_BYTE *)&v63[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(v63[0].__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v52.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v52.__r_.__value_.__l.__data_);
LABEL_49:
v32 = *a9;
if ( (v32 & 1) != 0 )
{
if ( !*((_QWORD *)a9 + 1) )
goto LABEL_63;
LABEL_53:
std::string::append(&v62, "&description=");
if ( (*a9 & 1) != 0 )
{
sub_10001AD30(&v53, *((const void **)a9 + 2), *((_QWORD *)a9 + 1));
}
else
{
v53.__r_.__value_.__r.__words[2] = *((_QWORD *)a9 + 2);
*(_OWORD *)&v53.__r_.__value_.__l.0 = *(_OWORD *)a9;
}
LevelTools::base64EncodeString(v63, &v53);
if ( (*(_BYTE *)&v63[0].__r_.__value_.__s.0 & 1) != 0 )
{
v33 = v63[0].__r_.__value_.__l.__data_;
v34 = v63[0].__r_.__value_.__l.__size_;
}
else
{
v34 = *(_BYTE *)&v63[0].__r_.__value_.__l.0 >> 1;
v33 = v63[0].__r_.__value_.__s.__data_;
}
std::string::append(&v62, v33, v34);
if ( (*(_BYTE *)&v63[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(v63[0].__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v53.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v53.__r_.__value_.__l.__data_);
goto LABEL_63;
}
if ( v32 >> 1 )
goto LABEL_53;
LABEL_63:
v35 = *a10;
if ( (v35 & 1) != 0 )
{
if ( !*((_QWORD *)a10 + 1) )
goto LABEL_77;
}
else if ( !(v35 >> 1) )
{
goto LABEL_77;
}
std::string::append(&v62, "&emote=");
if ( (*a10 & 1) != 0 )
{
sub_10001AD30(&v54, *((const void **)a10 + 2), *((_QWORD *)a10 + 1));
}
else
{
v54.__r_.__value_.__r.__words[2] = *((_QWORD *)a10 + 2);
*(_OWORD *)&v54.__r_.__value_.__l.0 = *(_OWORD *)a10;
}
LevelTools::base64EncodeString(v63, &v54);
if ( (*(_BYTE *)&v63[0].__r_.__value_.__s.0 & 1) != 0 )
{
v36 = v63[0].__r_.__value_.__l.__data_;
v37 = v63[0].__r_.__value_.__l.__size_;
}
else
{
v37 = *(_BYTE *)&v63[0].__r_.__value_.__l.0 >> 1;
v36 = v63[0].__r_.__value_.__s.__data_;
}
std::string::append(&v62, v36, v37);
if ( (*(_BYTE *)&v63[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(v63[0].__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v54.__r_.__value_.__l.__data_);
LABEL_77:
if ( v58 )
{
v38 = sub_10088E820("&token=%llu", v48);
v39 = (const std::string::value_type *)cocos2d::CCString::getCString(v38);
std::string::append(&v62, v39);
}
std::string::append(&v62, "&body=");
if ( (*(_BYTE *)&a5->__r_.__value_.__s.0 & 1) != 0 )
sub_10001AD30(&v55, a5->__r_.__value_.__l.__data_, a5->__r_.__value_.__l.__size_);
else
v55 = *a5;
LevelTools::base64EncodeString(v63, &v55);
if ( (*(_BYTE *)&v63[0].__r_.__value_.__s.0 & 1) != 0 )
{
v40 = v63[0].__r_.__value_.__l.__data_;
v41 = v63[0].__r_.__value_.__l.__size_;
}
else
{
v41 = *(_BYTE *)&v63[0].__r_.__value_.__l.0 >> 1;
v40 = v63[0].__r_.__value_.__s.__data_;
}
std::string::append(&v62, v40, v41);
if ( (*(_BYTE *)&v63[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(v63[0].__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v55.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v55.__r_.__value_.__l.__data_);
v50.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v50.__r_.__value_.__r.__words[0] = 65;
v50.__r_.__value_.__l.__size_ = 58;
strcpy(v50.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/sendGJThreadMessage.php");
if ( (*(_BYTE *)&v62.__r_.__value_.__s.0 & 1) != 0 )
v42 = v62.__r_.__value_.__l.__data_;
else
v42 = v62.__r_.__value_.__s.__data_;
v43 = strlen(v42);
if ( v43 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v44 = v43;
if ( v43 >= 0x17 )
{
v46 = 26;
if ( (v43 | 7) != 0x17 )
v46 = (v43 | 7) + 1;
v45 = (char *)operator new(v46);
v60 = v45;
__dst[0] = v46 | 1;
__dst[1] = v44;
goto LABEL_99;
}
LOBYTE(__dst[0]) = 2 * v43;
v45 = (char *)__dst + 1;
if ( v43 )
LABEL_99:
memmove(v45, v42, v44);
v45[v44] = 0;
LOBYTE(v56) = 20;
strcpy((char *)&v56 + 1, "threadSend");
GameLevelManager::ProcessHttpRequest(v61, &v50, (__int64)__dst, &v56, 0x5Bu);
if ( (v56 & 1) != 0 )
{
operator delete(v57);
if ( (__dst[0] & 1) == 0 )
{
LABEL_102:
if ( (*(_BYTE *)&v50.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_103;
LABEL_108:
operator delete(v50.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v62.__r_.__value_.__s.0 & 1) == 0 )
return 1;
goto LABEL_104;
}
}
else if ( (__dst[0] & 1) == 0 )
{
goto LABEL_102;
}
operator delete(v60);
if ( (*(_BYTE *)&v50.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_108;
LABEL_103:
if ( (*(_BYTE *)&v62.__r_.__value_.__s.0 & 1) != 0 )
LABEL_104:
operator delete(v62.__r_.__value_.__l.__data_);
return 1;
}