//
// GJMultiplayerManager::uploadComment from 0x140391240 to 0x1403917ce (1422 bytes)
//
// 2 xrefs:
// > ShareCommentLayer::onShare @ 0x14062f615
// > ??> @ 0x140922fdc
//
// 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 11:31:11 +0000
//
// Hidden C++ exception states: #wind=12
char __fastcall GJMultiplayerManager::uploadComment(cocos2d::CCObject *a1, const char *a2, unsigned int a3)
{
__int64 v6; // rax
__int64 v7; // rbx
void *v8; // rcx
cocos2d::CCString *v9; // rax
const char *CString; // rsi
__int64 v11; // rcx
_QWORD *v12; // rbx
__int64 v13; // rcx
const char *v14; // rbx
const char *v15; // r14
cocos2d::CCString *v16; // rax
const char *v17; // rax
cocos2d::CCString *v18; // rax
char *v19; // rax
size_t v20; // rbx
size_t v21; // r8
const char *v22; // r14
const char *v23; // r15
__int64 v24; // rax
cocos2d::CCString *v25; // rax
const char *v26; // rax
size_t v27; // r8
void **v28; // r8
void **v29; // r9
__int64 v30; // rdx
size_t v31; // r8
void *v32; // rcx
void **v33; // rdx
const char *v34; // rbx
__int64 v35; // rbx
__int64 v36; // rax
void *v37; // rcx
void *v39; // [rsp+48h] [rbp-B8h]
__int128 v40; // [rsp+50h] [rbp-B0h] BYREF
__int64 v41; // [rsp+60h] [rbp-A0h]
__int64 v42; // [rsp+68h] [rbp-98h]
_BYTE *v43; // [rsp+70h] [rbp-90h]
__int128 v44; // [rsp+78h] [rbp-88h] BYREF
__int64 v45; // [rsp+88h] [rbp-78h]
__int64 v46; // [rsp+90h] [rbp-70h]
__int128 v47; // [rsp+98h] [rbp-68h] BYREF
__int64 v48; // [rsp+A8h] [rbp-58h]
__int64 v49; // [rsp+B0h] [rbp-50h]
const char *v50; // [rsp+B8h] [rbp-48h]
void *Block[2]; // [rsp+C0h] [rbp-40h] BYREF
__int128 v52; // [rsp+D0h] [rbp-30h]
void *v53[2]; // [rsp+E0h] [rbp-20h] BYREF
__int64 v54; // [rsp+F0h] [rbp-10h]
unsigned __int64 v55; // [rsp+F8h] [rbp-8h]
void *v56[3]; // [rsp+100h] [rbp+0h] BYREF
unsigned __int64 v57; // [rsp+118h] [rbp+18h]
void *v58[4]; // [rsp+120h] [rbp+20h] BYREF
_QWORD Src[4]; // [rsp+140h] [rbp+40h] BYREF
_BYTE v60[48]; // [rsp+160h] [rbp+60h] BYREF
v50 = a2;
v6 = sub_14003F4F0((__int64)&v40, (__int64)a2);
v7 = v6;
if ( *(_QWORD *)(v6 + 16) )
{
cocos2d::ZipUtils::base64URLEncode(Block, v6);
}
else
{
*(_OWORD *)Block = 0;
v52 = 0u;
*(_OWORD *)Block = *(_OWORD *)v6;
v52 = *(_OWORD *)(v6 + 16);
*(_QWORD *)(v6 + 16) = 0;
*(_QWORD *)(v6 + 24) = 15;
*(_BYTE *)v6 = 0;
}
sub_14003D310(v7);
sub_140059C40((__int64)a2, (__int64)Block);
if ( *((_QWORD *)&v52 + 1) > 0xFu )
{
v8 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v52 + 1) + 1LL) >= 0x1000 )
{
v8 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v8);
}
v9 = cocos2d::CCString::createWithFormat("%i_comment", a3);
CString = cocos2d::CCString::getCString(v9);
v12 = (_QWORD *)sub_14003F4F0((__int64)&v40, (__int64)a2);
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v39 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v39);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
}
GameLevelManager::removeDelimiterChars(v11, v12, 1);
GameToolbox::gen_random(v56, 0xAu);
GJMultiplayerManager::getBasePostString(v13, Src);
v14 = (const char *)v56;
if ( v57 > 0xF )
v14 = (const char *)v56[0];
v15 = a2;
if ( *((_QWORD *)a2 + 3) > 0xFu )
v15 = *(const char **)a2;
v16 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfv", "3899", 103, 99, "9");
v17 = cocos2d::CCString::getCString(v16);
v18 = cocos2d::CCString::createWithFormat("&comment=%s&gameID=%i&extra=%s&secret=%s", v15, a3, v14, v17);
v19 = (char *)cocos2d::CCString::getCString(v18);
v20 = -1;
v21 = -1;
do
++v21;
while ( v19[v21] );
sub_140044D80(Src, v19, v21);
v22 = (const char *)v56;
if ( v57 > 0xF )
v22 = (const char *)v56[0];
v23 = a2;
if ( *((_QWORD *)a2 + 3) > 0xFu )
v23 = *(const char **)a2;
v24 = GJAccountManager::sharedState();
v25 = cocos2d::CCString::createWithFormat("%i%s%i%s", *(_DWORD *)(v24 + 360) - *(_DWORD *)(v24 + 364), v23, a3, v22);
v26 = cocos2d::CCString::getCString(v25);
*(_OWORD *)Block = 0;
v52 = 0u;
v27 = -1;
do
++v27;
while ( v26[v27] );
sub_14003D230(Block, v26, v27);
v28 = Block;
if ( *((_QWORD *)&v52 + 1) > 0xFu )
v28 = (void **)Block[0];
v29 = Block;
if ( *((_QWORD *)&v52 + 1) > 0xFu )
v29 = (void **)Block[0];
v30 = -1;
do
++v30;
while ( *((_BYTE *)v28 + v30) );
sub_14007E1A0((__int64)v29, v30, v53);
sub_14007E470((unsigned __int8 *)v53, v60);
*(_OWORD *)v53 = 0;
v54 = 0;
v55 = 0;
v31 = -1;
do
++v31;
while ( v60[v31] );
sub_14003D230(v53, v60, v31);
v44 = 0;
v45 = 5;
v46 = 15;
strcpy((char *)&v44, "52832");
cocos2d::ZipUtils::base64EncodeEnc(v58, v53, &v44);
if ( v55 > 0xF )
{
v32 = v53[0];
if ( v55 + 1 >= 0x1000 )
{
v32 = *((void **)v53[0] - 1);
if ( (unsigned __int64)((char *)v53[0] - (char *)v32 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v32);
}
v54 = 0;
v55 = 15;
LOBYTE(v53[0]) = 0;
sub_140044D80(Src, "&chk=", 5u);
v33 = v58;
if ( v58[3] > (void *)0xF )
v33 = (void **)v58[0];
sub_140044D80(Src, v33, (size_t)v58[2]);
v40 = 0;
v41 = 0;
v42 = 0;
do
++v20;
while ( CString[v20] );
sub_14003D230(&v40, CString, v20);
v34 = (const char *)sub_14003F4F0((__int64)v60, (__int64)Src);
v47 = 0;
v48 = 0;
v49 = 0;
*(_QWORD *)&v47 = sub_14003D460(0x40u);
v48 = 57;
v49 = 63;
strcpy((char *)v47, "https://www.geometrydash.com/database/uploadMPComment.php");
GJMultiplayerManager::ProcessHttpRequest(a1, (char *)&v47, v34, (const char *)&v40, 13);
v43 = v60;
v35 = sub_14003F4F0((__int64)v60, (__int64)a2);
v36 = GJMultiplayerManager::sharedState();
GJMultiplayerManager::createAndAddComment(v36, v35, a3);
sub_14003D310((__int64)v58);
if ( *((_QWORD *)&v52 + 1) > 0xFu )
{
v37 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v52 + 1) + 1LL) >= 0x1000 )
{
v37 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v37 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v37);
}
sub_14003D310((__int64)Src);
sub_14003D310((__int64)v56);
sub_14003D310((__int64)a2);
return 1;
}