//
// GameLevelManager::uploadComment from 0x14015daa0 to 0x14015e363 (2243 bytes)
//
// 3 xrefs:
// > ShareCommentLayer::onShare @ 0x14048e4e8
// > ShareCommentLayer::onShare @ 0x14048e577
// > ??> @ 0x1406caad0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=16
void __fastcall GameLevelManager::uploadComment(GameLevelManager *a1, const char *a2, int a3, int a4, int a5)
{
__int64 v9; // rax
__int64 v10; // rbx
void *v11; // rcx
cocos2d::CCString *v12; // rax
const char *CString; // rsi
size_t v14; // rdi
size_t v15; // r8
__int64 v16; // rbx
size_t v17; // r8
__int64 v18; // rax
void *v19; // rcx
__int64 v20; // rdx
__int64 v21; // rdx
__int64 v22; // rax
__int64 v23; // rcx
__int64 v24; // rax
__int64 v25; // r8
__int64 v26; // rcx
__int64 v27; // rcx
const char *v28; // r15
const char *v29; // rbx
cocos2d::CCString *v30; // rax
const char *v31; // rax
cocos2d::CCString *v32; // rax
char *v33; // rax
size_t v34; // r8
int v35; // ebx
cocos2d::CCString *v36; // rax
char *v37; // rax
size_t v38; // r8
cocos2d::CCString *v39; // rax
char *v40; // rax
size_t v41; // r8
cocos2d::CCString *v42; // rax
const char *v43; // r8
const char *v44; // rdx
cocos2d::CCString *v45; // rax
const char *v46; // rax
size_t v47; // r8
cocos2d::CCString *v48; // rax
char *v49; // rax
size_t v50; // r8
__int128 *v51; // rax
__int128 *v52; // rcx
__int64 v53; // rdx
size_t v54; // r8
void *v55; // rcx
void **v56; // rdx
size_t v57; // r8
_QWORD *v58; // rdx
const char *v59; // r9
const char *v60; // r8
_QWORD *v61; // rdx
__int64 v62; // [rsp+20h] [rbp-E0h]
__int64 v63; // [rsp+28h] [rbp-D8h]
void *v64; // [rsp+40h] [rbp-C0h]
void *v65; // [rsp+40h] [rbp-C0h]
__int128 v66; // [rsp+48h] [rbp-B8h] BYREF
__int64 v67; // [rsp+58h] [rbp-A8h]
__int64 v68; // [rsp+60h] [rbp-A0h]
__int128 *v69; // [rsp+68h] [rbp-98h]
GameLevelManager *v70; // [rsp+70h] [rbp-90h]
__int128 *v71; // [rsp+78h] [rbp-88h]
const char *v72; // [rsp+80h] [rbp-80h]
void *v73[2]; // [rsp+88h] [rbp-78h] BYREF
__int64 v74; // [rsp+98h] [rbp-68h]
unsigned __int64 v75; // [rsp+A0h] [rbp-60h]
_QWORD Src[3]; // [rsp+A8h] [rbp-58h] BYREF
unsigned __int64 v77; // [rsp+C0h] [rbp-40h]
void *Block[2]; // [rsp+C8h] [rbp-38h] BYREF
__int128 v79; // [rsp+D8h] [rbp-28h]
void *v80[2]; // [rsp+E8h] [rbp-18h] BYREF
__int64 v81; // [rsp+F8h] [rbp-8h]
unsigned __int64 v82; // [rsp+100h] [rbp+0h]
__int128 v83; // [rsp+108h] [rbp+8h] BYREF
__int64 v84; // [rsp+118h] [rbp+18h]
unsigned __int64 v85; // [rsp+120h] [rbp+20h]
_QWORD v86[3]; // [rsp+128h] [rbp+28h] BYREF
unsigned __int64 v87; // [rsp+140h] [rbp+40h]
void *v88[4]; // [rsp+148h] [rbp+48h] BYREF
_BYTE v89[32]; // [rsp+168h] [rbp+68h] BYREF
__int128 v90; // [rsp+188h] [rbp+88h] BYREF
__int64 v91; // [rsp+198h] [rbp+98h]
__int64 v92; // [rsp+1A0h] [rbp+A0h]
LODWORD(v69) = a3;
v70 = a1;
v72 = a2;
v9 = sub_14003BDB0((__int64)&v66, (__int64)a2);
v10 = v9;
if ( *(_QWORD *)(v9 + 16) )
{
cocos2d::ZipUtils::base64URLEncode(Block, v9);
}
else
{
*(_OWORD *)Block = 0;
v79 = 0u;
*(_OWORD *)Block = *(_OWORD *)v9;
v79 = *(_OWORD *)(v9 + 16);
*(_QWORD *)(v9 + 16) = 0;
*(_QWORD *)(v9 + 24) = 15;
*(_BYTE *)v9 = 0;
}
sub_14003A830(v10);
sub_140051590((__int64)a2, (__int64)Block);
if ( *((_QWORD *)&v79 + 1) > 0xFu )
{
v11 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v79 + 1) + 1LL) >= 0x1000 )
{
v11 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v11 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v11);
}
if ( a3 )
{
CString = "acc_comment";
}
else
{
v12 = cocos2d::CCString::createWithFormat("c_%i", a4);
CString = cocos2d::CCString::getCString(v12);
}
*(_OWORD *)v73 = 0;
v74 = 0;
v75 = 0;
v14 = -1;
v15 = -1;
do
++v15;
while ( CString[v15] );
sub_14003A930(v73, CString, v15);
v16 = cocos2d::CCDictionary::objectForKey(a1->m_friendReqAndUserBlocks, v73);
sub_14003A830((__int64)v73);
if ( !v16 )
{
*(_OWORD *)v73 = 0;
v74 = 0;
v75 = 0;
v17 = -1;
do
++v17;
while ( CString[v17] );
sub_14003A930(v73, CString, v17);
v18 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(a1->m_friendReqAndUserBlocks, v18, v73);
if ( v75 > 0xF )
{
v19 = v73[0];
if ( v75 + 1 >= 0x1000 )
{
v19 = *((void **)v73[0] - 1);
if ( (unsigned __int64)((char *)v73[0] - (char *)v19 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v19);
}
GameLevelManager::makeTimeStamp(a1, CString);
v20 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v64 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v64);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v20 = qword_1406C2ED8;
}
sub_14003BDB0((__int64)v86, v20 + 616);
v21 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v65 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v65);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v21 = qword_1406C2ED8;
}
sub_14003BDB0((__int64)v89, v21 + 584);
v22 = sub_14003BDB0((__int64)&v66, (__int64)v86);
GameLevelManager::removeDelimiterChars(v23, v22, 0);
v24 = sub_14003BDB0((__int64)&v66, (__int64)a2);
LOBYTE(v25) = 1;
GameLevelManager::removeDelimiterChars(v26, v24, v25);
GameLevelManager::getBasePostString(v27, Src);
v28 = a2;
if ( *((_QWORD *)a2 + 3) > 0xFu )
v28 = *(const char **)a2;
v29 = (const char *)v86;
if ( v87 > 0xF )
v29 = (const char *)v86[0];
v30 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, (const char *)&word_140531E88);
v31 = cocos2d::CCString::getCString(v30);
v32 = cocos2d::CCString::createWithFormat("&userName=%s&comment=%s&secret=%s", v29, v28, v31);
v33 = (char *)cocos2d::CCString::getCString(v32);
v34 = -1;
do
++v34;
while ( v33[v34] );
sub_140041270(Src, v33, v34);
v35 = (int)v69;
if ( (_DWORD)v69 )
{
sub_140041270(Src, "&cType=", 7u);
v42 = cocos2d::CCString::createWithFormat("%i", v35);
v40 = (char *)cocos2d::CCString::getCString(v42);
v41 = -1;
do
++v41;
while ( v40[v41] );
}
else
{
sub_140041270(Src, "&levelID=", 9u);
v36 = cocos2d::CCString::createWithFormat("%i", a4);
v37 = (char *)cocos2d::CCString::getCString(v36);
v38 = -1;
do
++v38;
while ( v37[v38] );
sub_140041270(Src, v37, v38);
if ( a5 <= 0 )
goto LABEL_42;
sub_140041270(Src, "&percent=", 9u);
v39 = cocos2d::CCString::createWithFormat("%i", a5);
v40 = (char *)cocos2d::CCString::getCString(v39);
v41 = -1;
do
++v41;
while ( v40[v41] );
}
sub_140041270(Src, v40, v41);
LABEL_42:
v43 = a2;
if ( *((_QWORD *)a2 + 3) > 0xFu )
v43 = *(const char **)a2;
v44 = (const char *)v86;
if ( v87 > 0xF )
v44 = (const char *)v86[0];
v45 = cocos2d::CCString::createWithFormat("%s%s%i%i%i", v44, v43, a4, a5, v35);
v46 = cocos2d::CCString::getCString(v45);
v83 = 0;
v84 = 0;
v85 = 0;
v47 = -1;
do
++v47;
while ( v46[v47] );
sub_14003A930(&v83, v46, v47);
LODWORD(v63) = 115;
LODWORD(v62) = 119;
v48 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 120, "PT6", "iUrt", v62, v63, "0J");
v49 = (char *)cocos2d::CCString::getCString(v48);
v50 = -1;
do
++v50;
while ( v49[v50] );
sub_140041270(&v83, v49, v50);
v51 = &v83;
if ( v85 <= 0xF )
{
v52 = &v83;
}
else
{
v52 = (__int128 *)v83;
v51 = (__int128 *)v83;
}
v53 = -1;
do
++v53;
while ( *((_BYTE *)v51 + v53) );
sub_140070860((__int64)v52, v53, v80);
sub_140070B30((unsigned __int8 *)v80, &v90);
*(_OWORD *)v80 = 0;
v81 = 0;
v82 = 0;
v54 = -1;
do
++v54;
while ( *((_BYTE *)&v90 + v54) );
sub_14003A930(v80, &v90, v54);
*(_OWORD *)Block = 0;
*(_QWORD *)&v79 = 5;
*((_QWORD *)&v79 + 1) = 15;
strcpy((char *)Block, "29481");
cocos2d::ZipUtils::base64EncodeEnc(v88, v80, Block);
if ( v82 > 0xF )
{
v55 = v80[0];
if ( v82 + 1 >= 0x1000 )
{
v55 = *((void **)v80[0] - 1);
if ( (unsigned __int64)((char *)v80[0] - (char *)v55 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v55);
}
v81 = 0;
v82 = 15;
LOBYTE(v80[0]) = 0;
sub_140041270(Src, "&chk=", 5u);
v56 = v88;
if ( v88[3] > (void *)0xF )
v56 = (void **)v88[0];
sub_140041270(Src, v56, (size_t)v88[2]);
v57 = -1;
do
++v57;
while ( CString[v57] );
if ( v35 )
{
v71 = &v66;
v66 = 0;
v67 = 0;
v68 = 0;
sub_14003A930(&v66, CString, v57);
v61 = Src;
if ( v77 > 0xF )
v61 = (_QWORD *)Src[0];
v90 = 0;
v91 = 0;
v92 = 0;
do
++v14;
while ( *((_BYTE *)v61 + v14) );
sub_14003A930(&v90, v61, v14);
*(_OWORD *)v73 = 0;
v74 = 0;
v75 = 15;
v73[0] = sub_14003AA10(0x40u);
v74 = 59;
v75 = 63;
strcpy((char *)v73[0], "https://www.boomlings.com/database/uploadGJAccComment20.php");
v59 = (const char *)&v66;
v60 = (const char *)&v90;
}
else
{
v69 = &v66;
v90 = 0;
v91 = 0;
v92 = 0;
sub_14003A930(&v90, CString, v57);
v58 = Src;
if ( v77 > 0xF )
v58 = (_QWORD *)Src[0];
v66 = 0;
v67 = 0;
v68 = 0;
do
++v14;
while ( *((_BYTE *)v58 + v14) );
sub_14003A930(&v66, v58, v14);
*(_OWORD *)v73 = 0;
v74 = 0;
v75 = 15;
v73[0] = sub_14003AA10(0x40u);
v74 = 56;
v75 = 63;
strcpy((char *)v73[0], "https://www.boomlings.com/database/uploadGJComment21.php");
v59 = (const char *)&v90;
v60 = (const char *)&v66;
}
GameLevelManager::ProcessHttpRequest(v70, (__int64)v73, v60, v59, 13);
sub_14003A830((__int64)v88);
sub_14003A830((__int64)&v83);
sub_14003A830((__int64)Src);
sub_14003A830((__int64)v89);
sub_14003A830((__int64)v86);
}
sub_14003A830((__int64)a2);
}