//
// GJMultiplayerManager::uploadComment from 0xac6e94 to 0xac7574 (1760 bytes)
//
// 3 xrefs:
// > ShareCommentLayer::onShare @ 0x90e6d4
// > MPLobbyLayer::postComment @ 0xb05bf4
// > ??> @ 0xae580
//
// This function is hookable on this platform (idp: arm, 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 13:01:08 +0000
//
__int64 __fastcall GJMultiplayerManager::uploadComment(cocos2d::CCObject *a1, char *a2, unsigned int a3)
{
char v6; // w0
void *v7; // x2
__int64 v8; // x0
__int64 v9; // x1
void *v10; // x22
void *v11; // x0
int v12; // w20
__int64 v13; // x2
size_t v14; // x2
__int64 v15; // x2
__int64 v16; // x3
char v17; // w0
cocos2d::CCString *v18; // x0
__int64 v19; // x20
char v20; // w0
__int64 v21; // x0
__int64 v22; // x1
const char *v23; // x28
char *v24; // x25
cocos2d::CCString *v25; // x0
__int64 v26; // x0
cocos2d::CCString *v27; // x0
size_t v28; // x0
GJAccountManager *v29; // x0
__int64 v30; // x0
__int64 v31; // x2
char *v32; // x4
cocos2d::CCString *v33; // x0
size_t v34; // x0
char *v35; // x25
unsigned int v36; // w0
unsigned __int8 *v37; // x3
char *v38; // x2
size_t v39; // x0
char *v40; // x1
size_t v41; // x2
size_t v42; // x0
GJMultiplayerManager *v43; // x0
__int64 v44; // x24
char v45; // w0
__int64 v46; // x0
__int64 v47; // x1
unsigned __int64 v49; // x0
unsigned __int64 v50; // x0
unsigned __int8 v51; // w2
char *v52; // [xsp+60h] [xbp+60h]
char *v53; // [xsp+60h] [xbp+60h]
char *CString; // [xsp+68h] [xbp+68h]
__int64 v55[2]; // [xsp+70h] [xbp+70h] BYREF
char *v56; // [xsp+80h] [xbp+80h]
__int64 v57; // [xsp+88h] [xbp+88h] BYREF
size_t v58; // [xsp+90h] [xbp+90h]
void *v59; // [xsp+98h] [xbp+98h]
__int64 v60[2]; // [xsp+A0h] [xbp+A0h] BYREF
void *v61; // [xsp+B0h] [xbp+B0h]
size_t v62[2]; // [xsp+B8h] [xbp+B8h] BYREF
void *v63; // [xsp+C8h] [xbp+C8h]
__int64 v64[2]; // [xsp+D0h] [xbp+D0h] BYREF
void *v65; // [xsp+E0h] [xbp+E0h]
__int64 v66[2]; // [xsp+E8h] [xbp+E8h] BYREF
void *v67; // [xsp+F8h] [xbp+F8h]
GJMultiplayerManager *v68[2]; // [xsp+100h] [xbp+100h] BYREF
void *v69; // [xsp+110h] [xbp+110h]
__int64 v70; // [xsp+118h] [xbp+118h] BYREF
size_t v71; // [xsp+120h] [xbp+120h]
void *v72; // [xsp+128h] [xbp+128h]
__int64 v73; // [xsp+130h] [xbp+130h] BYREF
__int64 v74; // [xsp+138h] [xbp+138h]
void *v75; // [xsp+140h] [xbp+140h]
__int64 v76; // [xsp+148h] [xbp+148h] BYREF
__int64 v77; // [xsp+150h] [xbp+150h]
void *v78; // [xsp+158h] [xbp+158h]
unsigned __int8 v79[24]; // [xsp+160h] [xbp+160h] BYREF
unsigned __int8 v80[48]; // [xsp+178h] [xbp+178h] BYREF
v73 = 0;
v74 = 0;
v6 = *a2;
v75 = nullptr;
if ( (v6 & 1) != 0 )
{
std::string::__init(&v73, *((void **)a2 + 2), *((_QWORD *)a2 + 1));
}
else
{
v7 = *((void **)a2 + 2);
v8 = *(_QWORD *)a2;
v9 = *((_QWORD *)a2 + 1);
v75 = v7;
v73 = v8;
v74 = v9;
}
LevelTools::base64EncodeString((__int64)&v73, &v76);
if ( (*a2 & 1) == 0 )
goto LABEL_11;
**((_BYTE **)a2 + 2) = 0;
*((_QWORD *)a2 + 1) = 0;
if ( (*a2 & 1) == 0 )
{
v49 = (unsigned __int8)*a2 >> 1;
if ( v49 <= 0x16 )
goto LABEL_11;
v50 = (v49 + 16) & 0xFFFFFFFFFFFFFFF0LL;
if ( v50 == 23 )
goto LABEL_11;
if ( v50 - 1 > 0x16 )
{
v11 = (void *)operator new(v50);
v51 = *a2;
v12 = *a2 & 1;
if ( (*a2 & 1) == 0 )
{
LABEL_66:
v10 = a2 + 1;
v13 = v51 >> 1;
goto LABEL_7;
}
}
else
{
v11 = (void *)operator new(v50);
v51 = *a2;
v12 = *a2 & 1;
if ( (*a2 & 1) == 0 )
goto LABEL_66;
}
v10 = *((void **)a2 + 2);
goto LABEL_6;
}
v10 = *((void **)a2 + 2);
v11 = a2 + 1;
v12 = 1;
LABEL_6:
v13 = *((_QWORD *)a2 + 1);
LABEL_7:
v14 = v13 + 1;
if ( v14 )
memcpy(v11, v10, v14);
if ( v12 )
operator delete(v10);
LABEL_11:
v15 = v76;
v16 = v77;
v17 = v73;
*((_QWORD *)a2 + 2) = v78;
*(_QWORD *)a2 = v15;
*((_QWORD *)a2 + 1) = v16;
if ( (v17 & 1) != 0 )
operator delete(v75);
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i_comment", (const char *)a3);
CString = (char *)cocos2d::CCString::getCString(v18);
v19 = GameLevelManager::sharedState((GameLevelManager *)CString);
v20 = *a2;
v76 = 0;
v77 = 0;
v78 = nullptr;
if ( (v20 & 1) != 0 )
{
std::string::__init(&v76, *((void **)a2 + 2), *((_QWORD *)a2 + 1));
}
else
{
v21 = *(_QWORD *)a2;
v22 = *((_QWORD *)a2 + 1);
v78 = *((void **)a2 + 2);
v76 = v21;
v77 = v22;
}
GameLevelManager::removeDelimiterChars(v19, (__int64)&v76, 1);
if ( (v76 & 1) != 0 )
operator delete(v78);
GameToolbox::gen_random((GameToolbox *)&byte_9[1], v55);
GJMultiplayerManager::getBasePostString(&v57);
v23 = a2 + 1;
if ( (*a2 & 1) != 0 )
v23 = *((const char **)a2 + 2);
v24 = (char *)v55 + 1;
if ( (v55[0] & 1) != 0 )
v24 = v56;
v25 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfv",
"3899",
103,
99,
"9");
v26 = cocos2d::CCString::getCString(v25);
v27 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&comment=%s&gameID=%i&extra=%s&secret=%s",
v23,
a3,
v24,
v26);
v52 = (char *)cocos2d::CCString::getCString(v27);
v28 = strlen(v52);
v29 = (GJAccountManager *)std::string::append((__int64)&v57, v52, v28);
v30 = GJAccountManager::sharedState(v29);
v31 = (__int64)(a2 + 1);
if ( (*a2 & 1) != 0 )
v31 = *((_QWORD *)a2 + 2);
v32 = (char *)v55 + 1;
if ( (v55[0] & 1) != 0 )
v32 = v56;
v33 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i%s%i%s",
(const char *)(unsigned int)(*(_DWORD *)(v30 + 352) - *(_DWORD *)(v30 + 356)),
v31,
a3,
v32);
v53 = (char *)cocos2d::CCString::getCString(v33);
v61 = nullptr;
v60[0] = 0;
v60[1] = 0;
v34 = strlen(v53);
std::string::__init(v60, v53, v34);
v35 = (char *)v60 + 1;
if ( (v60[0] & 1) != 0 )
v35 = (char *)v61;
v36 = strlen(v35);
rtsha1::calc((rtsha1 *)v35, (const void *)v36, (__int64)v79, v37);
rtsha1::toHexString((rtsha1 *)v79, v80, v38);
v64[0] = 0;
v64[1] = 0;
v65 = nullptr;
v39 = strlen((const char *)v80);
std::string::__init(v64, v80, v39);
v66[0] = 0;
v66[1] = 0;
v67 = nullptr;
std::string::__init(v66, "52832", 5u);
cocos2d::ZipUtils::base64EncodeEnc(v62, v64, v66);
if ( (v66[0] & 1) != 0 )
operator delete(v67);
if ( (v64[0] & 1) != 0 )
operator delete(v65);
std::string::append((__int64)&v57, "&chk=", 5u);
if ( (v62[0] & 1) != 0 )
{
v40 = (char *)v63;
v41 = v62[1];
}
else
{
v41 = LOBYTE(v62[0]) >> 1;
v40 = (char *)v62 + 1;
}
std::string::append((__int64)&v57, v40, v41);
v68[0] = nullptr;
v68[1] = nullptr;
v69 = nullptr;
std::string::__init((__int64 *)v68, "https://www.geometrydash.com/database/uploadMPComment.php", 0x39u);
v70 = 0;
v71 = 0;
v72 = nullptr;
if ( (v57 & 1) != 0 )
{
std::string::__init(&v70, v59, v58);
}
else
{
v72 = v59;
v70 = v57;
v71 = v58;
}
v73 = 0;
v74 = 0;
v75 = nullptr;
v42 = strlen(CString);
std::string::__init(&v73, CString, v42);
GJMultiplayerManager::ProcessHttpRequest(a1, v68, (__int64)&v70, (__int64)&v73, 13);
if ( (v73 & 1) != 0 )
{
operator delete(v75);
if ( (v70 & 1) == 0 )
goto LABEL_37;
}
else if ( (v70 & 1) == 0 )
{
goto LABEL_37;
}
operator delete(v72);
LABEL_37:
v43 = (GJMultiplayerManager *)LOBYTE(v68[0]);
if ( ((__int64)v68[0] & 1) != 0 )
operator delete(v69);
v44 = GJMultiplayerManager::sharedState(v43);
v45 = *a2;
v76 = 0;
v77 = 0;
v78 = nullptr;
if ( (v45 & 1) != 0 )
{
std::string::__init(&v76, *((void **)a2 + 2), *((_QWORD *)a2 + 1));
}
else
{
v46 = *(_QWORD *)a2;
v47 = *((_QWORD *)a2 + 1);
v78 = *((void **)a2 + 2);
v76 = v46;
v77 = v47;
}
GJMultiplayerManager::createAndAddComment(v44, (unsigned __int8 *)&v76, a3);
if ( (v76 & 1) != 0 )
operator delete(v78);
if ( (v62[0] & 1) != 0 )
operator delete(v63);
if ( (v60[0] & 1) != 0 )
operator delete(v61);
if ( (v57 & 1) != 0 )
operator delete(v59);
if ( (v55[0] & 1) != 0 )
operator delete(v56);
return 1;
}