//
// GameLevelManager::uploadUserMessage from 0x1005690b0 to 0x1005695f5 (1349 bytes)
//
// 1 xrefs:
// > GJWriteMessagePopup::onSend @ 0x100296642
//
// 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:12 +0000
//
void __fastcall GameLevelManager::uploadUserMessage(__int64 a1, int a2, std::string *a3, std::string *a4)
{
__int64 v6; // r15
__int64 v7; // rax
const char *CString; // r12
size_t v9; // rax
std::string::size_type v10; // r13
char *data; // r14
size_t v12; // r15
__int64 v13; // rbx
__int64 v14; // r13
void *v15; // r14
size_t v16; // rax
std::string::size_type v17; // rbx
char *v18; // r14
const char *v19; // r13
__int64 v20; // r12
size_t v21; // r15
__int64 v22; // rax
__int64 v23; // rax
const std::string::value_type *v24; // rax
const char *v25; // rbx
size_t v26; // rax
size_t v27; // r15
const char *v28; // r13
char *v29; // r12
size_t v30; // r14
size_t v31; // rax
size_t v32; // rbx
char *v33; // r15
size_t v34; // r14
char v35; // [rsp+0h] [rbp-100h]
char v36; // [rsp+0h] [rbp-100h]
std::string *v37; // [rsp+10h] [rbp-F0h]
std::string *v38; // [rsp+18h] [rbp-E8h]
__int64 v39; // [rsp+20h] [rbp-E0h]
__int64 v40; // [rsp+28h] [rbp-D8h]
__int128 v41; // [rsp+30h] [rbp-D0h] BYREF
void *v42; // [rsp+40h] [rbp-C0h]
std::string v43; // [rsp+48h] [rbp-B8h] BYREF
std::string v44; // [rsp+60h] [rbp-A0h] BYREF
_QWORD v45[2]; // [rsp+80h] [rbp-80h] BYREF
void *v46; // [rsp+90h] [rbp-70h]
__int128 v47; // [rsp+98h] [rbp-68h] BYREF
void *v48; // [rsp+A8h] [rbp-58h]
int v49; // [rsp+B4h] [rbp-4Ch]
__int64 v50; // [rsp+B8h] [rbp-48h]
std::string __dst[2]; // [rsp+C0h] [rbp-40h] BYREF
v6 = a1;
v49 = a2;
v7 = sub_10088E820("uMsg_%i", v35);
CString = (const char *)cocos2d::CCString::getCString(v7);
v50 = *(_QWORD *)(a1 + 1088);
v9 = strlen(CString);
if ( v9 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_62;
v10 = v9;
v38 = a3;
v37 = a4;
if ( v9 >= 0x17 )
{
v12 = 26;
if ( (v9 | 7) != 0x17 )
v12 = (v9 | 7) + 1;
data = (char *)operator new(v12);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v12 + 1;
v6 = a1;
__dst[0].__r_.__value_.__l.__size_ = v10;
goto LABEL_8;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v9);
data = __dst[0].__r_.__value_.__s.__data_;
if ( v9 )
LABEL_8:
memmove(data, CString, v10);
data[v10] = 0;
v13 = cocos2d::CCDictionary::objectForKey(v50, (char *)__dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
if ( v13 )
return;
v14 = *(_QWORD *)(v6 + 1088);
v15 = cocos2d::CCNode::create();
v16 = strlen(CString);
if ( v16 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_62:
sub_100003630();
v17 = v16;
v50 = (__int64)v15;
if ( v16 >= 0x17 )
{
v40 = v14;
v19 = CString;
v20 = v6;
v21 = 26;
if ( (v16 | 7) != 0x17 )
v21 = (v16 | 7) + 1;
v18 = (char *)operator new(v21);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v18;
__dst[0].__r_.__value_.__r.__words[0] = v21 + 1;
v6 = v20;
CString = v19;
v14 = v40;
__dst[0].__r_.__value_.__l.__size_ = v17;
goto LABEL_19;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v16);
v18 = __dst[0].__r_.__value_.__s.__data_;
if ( v16 )
LABEL_19:
memmove(v18, CString, v17);
v18[v17] = 0;
cocos2d::CCDictionary::setObject(v14, v50, (char *)__dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
GameLevelManager::makeTimeStamp(v6, CString);
if ( (*(_BYTE *)&v38->__r_.__value_.__s.0 & 1) != 0 )
sub_10001AD30(&v44, v38->__r_.__value_.__l.__data_, v38->__r_.__value_.__l.__size_);
else
v44 = *v38;
LevelTools::base64EncodeString(__dst, &v44);
if ( (*(_BYTE *)&v38->__r_.__value_.__s.0 & 1) != 0 )
operator delete(v38->__r_.__value_.__l.__data_);
*v38 = __dst[0];
*(_WORD *)&__dst[0].__r_.__value_.__l.0 = 0;
if ( (*(_BYTE *)&v44.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v44.__r_.__value_.__l.__data_);
strcpy((char *)&v41, "\n14251");
cocos2d::ZipUtils::base64EncodeEnc(__dst, v37, &v41);
if ( (*(_BYTE *)&v37->__r_.__value_.__s.0 & 1) != 0 )
operator delete(v37->__r_.__value_.__l.__data_);
*v37 = __dst[0];
*(_WORD *)&__dst[0].__r_.__value_.__l.0 = 0;
if ( (v41 & 1) != 0 )
operator delete(v42);
GameLevelManager::getBasePostString(__dst);
v22 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v22);
v23 = sub_10088E820("&toAccountID=%i&subject=%s&body=%s&secret=%s", v36);
v24 = (const std::string::value_type *)cocos2d::CCString::getCString(v23);
std::string::append(__dst, v24);
v43.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v43.__r_.__value_.__r.__words[0] = 65;
v43.__r_.__value_.__l.__size_ = 56;
strcpy(v43.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/uploadGJMessage20.php");
v39 = v6;
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
v25 = __dst[0].__r_.__value_.__l.__data_;
else
v25 = __dst[0].__r_.__value_.__s.__data_;
v26 = strlen(v25);
if ( v26 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v27 = v26;
v28 = CString;
if ( v26 >= 0x17 )
{
v30 = 26;
if ( (v26 | 7) != 0x17 )
v30 = (v26 | 7) + 1;
v29 = (char *)operator new(v30);
v46 = v29;
v45[0] = v30 | 1;
v45[1] = v27;
goto LABEL_43;
}
LOBYTE(v45[0]) = 2 * v26;
v29 = (char *)v45 + 1;
if ( v26 )
LABEL_43:
memmove(v29, v25, v27);
v29[v27] = 0;
v31 = strlen(v28);
if ( v31 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v32 = v31;
if ( v31 >= 0x17 )
{
v34 = 26;
if ( (v31 | 7) != 0x17 )
v34 = (v31 | 7) + 1;
v33 = (char *)operator new(v34);
v48 = v33;
*(_QWORD *)&v47 = v34 | 1;
*((_QWORD *)&v47 + 1) = v32;
goto LABEL_51;
}
LOBYTE(v47) = 2 * v31;
v33 = (char *)&v47 + 1;
if ( v31 )
LABEL_51:
memmove(v33, v28, v32);
v33[v32] = 0;
GameLevelManager::ProcessHttpRequest(v39, &v43, (__int64)v45, &v47, 0x2Eu);
if ( (v47 & 1) == 0 )
{
if ( (v45[0] & 1) == 0 )
goto LABEL_54;
LABEL_59:
operator delete(v46);
if ( (*(_BYTE *)&v43.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_55:
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) == 0 )
return;
goto LABEL_56;
}
goto LABEL_60;
}
operator delete(v48);
if ( (v45[0] & 1) != 0 )
goto LABEL_59;
LABEL_54:
if ( (*(_BYTE *)&v43.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_55;
LABEL_60:
operator delete(v43.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
LABEL_56:
operator delete(__dst[0].__r_.__value_.__l.__data_);
}