//
// GameLevelManager::uploadComment from 0x7240bc to 0x724e7c (3520 bytes)
//
// 3 xrefs:
// > GameLevelManager::uploadLevelComment @ 0x724ed0
// > GameLevelManager::uploadAccountComment @ 0x724fc8
// > ??> @ 0x43ab8
//
// 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
//
__int64 __fastcall GameLevelManager::uploadComment(
GameLevelManager *a1,
__int64 *a2,
unsigned int a3,
unsigned int a4,
int a5)
{
char *v8; // x0
char *v9; // x0
char *PostCommentKey; // x21
cocos2d::CCDictionary *m_friendReqAndUserBlocks; // x28
__int64 v12; // x28
char *v13; // x0
unsigned int *v15; // x1
int v16; // w2
unsigned int *v17; // x1
int v18; // w2
unsigned int *v19; // x1
int v20; // w2
cocos2d::CCNode *v21; // x28
char *v22; // x0
unsigned __int8 *v23; // x0
unsigned __int8 *v24; // x0
cocos2d::CCString *v25; // x0
const char *CString; // x0
cocos2d::CCString *v27; // x0
size_t v28; // x0
cocos2d::CCString *v29; // x0
size_t v30; // x0
cocos2d::CCString *v31; // x0
char *v32; // x0
cocos2d::CCString *v33; // x0
size_t v34; // x0
char *v35; // x26
unsigned int v36; // w0
unsigned __int8 *v37; // x3
char *v38; // x2
char *v39; // x0
void *v40; // x0
int *p_m_unknown2; // x0
char *v42; // x0
const char *v43; // x1
char *v44; // x0
void *v45; // x0
char *v46; // x0
char *v47; // x0
void *v48; // x0
char *v49; // x0
unsigned int *v50; // x1
int v51; // w2
cocos2d::CCString *v52; // x0
size_t v53; // x0
cocos2d::CCString *v54; // x0
size_t v55; // x0
char *v56; // x0
char *v57; // x0
unsigned int *v58; // x1
int v59; // w2
unsigned int *v60; // x1
int v61; // w2
unsigned int *v62; // x1
int v63; // w2
unsigned int *v64; // x1
int v65; // w2
unsigned int *v66; // x1
int v67; // w2
unsigned int *v68; // x1
int v69; // w2
unsigned int *v70; // x1
int v71; // w2
unsigned int *v72; // x1
int v73; // w2
unsigned int *v74; // x1
int v75; // w2
unsigned int *v76; // x1
int v77; // w2
unsigned int *v78; // x1
int v79; // w2
unsigned int *v80; // x1
int v81; // w2
unsigned int *v82; // x1
int v83; // w2
unsigned int *v84; // x1
unsigned int *p_timeoutForConnect; // x1
int timeoutForConnect; // w2
__int64 v87; // [xsp+70h] [xbp+70h]
const char *v88; // [xsp+70h] [xbp+70h]
char *v89; // [xsp+78h] [xbp+78h]
const char *v90; // [xsp+78h] [xbp+78h]
char *v91; // [xsp+78h] [xbp+78h]
unsigned int v92; // [xsp+78h] [xbp+78h]
char *v93; // [xsp+78h] [xbp+78h]
char *v94; // [xsp+78h] [xbp+78h]
const char *v97; // [xsp+88h] [xbp+88h]
char *v98; // [xsp+98h] [xbp+98h] BYREF
__int64 v99; // [xsp+A0h] [xbp+A0h] BYREF
unsigned __int8 *v100; // [xsp+A8h] [xbp+A8h] BYREF
unsigned __int8 *v101; // [xsp+B0h] [xbp+B0h] BYREF
char *v102; // [xsp+B8h] [xbp+B8h] BYREF
char *v103; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v104; // [xsp+C8h] [xbp+C8h] BYREF
__int64 v105; // [xsp+D0h] [xbp+D0h] BYREF
std::string v106; // [xsp+D8h] [xbp+D8h] BYREF
const char *v107; // [xsp+E0h] [xbp+E0h] BYREF
const char *v108; // [xsp+E8h] [xbp+E8h] BYREF
cocos2d::extension::CCHttpClient *v109; // [xsp+F0h] [xbp+F0h] BYREF
const char *v110; // [xsp+F8h] [xbp+F8h] BYREF
const char *v111; // [xsp+100h] [xbp+100h] BYREF
std::string v112; // [xsp+108h] [xbp+108h] BYREF
unsigned __int8 v113[24]; // [xsp+110h] [xbp+110h] BYREF
unsigned __int8 v114[48]; // [xsp+128h] [xbp+128h] BYREF
std::string v115; // 0:x2.8
sub_D18D28(&v111);
LevelTools::base64EncodeString((cocos2d::ZipUtils *)&v111, &v112);
sub_D163D4(a2, &v112);
v8 = (char *)v112.m_data.m_data - 24;
if ( (__int64 *)v112.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = (unsigned int *)((char *)v112.m_data.m_data - 8);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *((_DWORD *)v112.m_data.m_data - 2);
*((_DWORD *)v112.m_data.m_data - 2) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v8);
}
v9 = (char *)(v111 - 24);
if ( v111 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)(v111 - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *((_DWORD *)v111 - 2);
*((_DWORD *)v111 - 2) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v9);
}
if ( a3 )
PostCommentKey = "acc_comment";
else
PostCommentKey = (char *)GameLevelManager::getPostCommentKey(a1, a4);
m_friendReqAndUserBlocks = a1->m_friendReqAndUserBlocks;
sub_D153B8((int)&v112, PostCommentKey);
v12 = cocos2d::CCDictionary::objectForKey(m_friendReqAndUserBlocks, &v112);
v13 = (char *)v112.m_data.m_data - 24;
if ( (__int64 *)v112.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)((char *)v112.m_data.m_data - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *((_DWORD *)v112.m_data.m_data - 2);
*((_DWORD *)v112.m_data.m_data - 2) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v13);
}
if ( !v12 )
{
v89 = (char *)a1->m_friendReqAndUserBlocks;
v21 = cocos2d::CCNode::create();
sub_D153B8((int)&v112, PostCommentKey);
cocos2d::CCDictionary::setObject((int)v89, v21);
v22 = (char *)v112.m_data.m_data - 24;
if ( (__int64 *)v112.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v62 = (unsigned int *)((char *)v112.m_data.m_data - 8);
do
v63 = __ldaxr(v62);
while ( __stlxr(v63 - 1, v62) );
}
else
{
v63 = *((_DWORD *)v112.m_data.m_data - 2);
*((_DWORD *)v112.m_data.m_data - 2) = v63 - 1;
}
if ( v63 <= 0 )
operator delete(v22);
}
GameLevelManager::makeTimeStamp(a1, PostCommentKey);
GameManager::sharedState();
sub_D18D28(&v98);
GameManager::sharedState();
sub_D18D28(&v99);
sub_D18D28(&v100);
GameLevelManager::removeDelimiterChars((__int64)a1, &v100, 0);
v23 = v100 - 24;
if ( v100 - 24 != (unsigned __int8 *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v70 = (unsigned int *)(v100 - 8);
do
v71 = __ldaxr(v70);
while ( __stlxr(v71 - 1, v70) );
}
else
{
v71 = *((_DWORD *)v100 - 2);
*((_DWORD *)v100 - 2) = v71 - 1;
}
if ( v71 <= 0 )
operator delete(v23);
}
sub_D18D28(&v101);
GameLevelManager::removeDelimiterChars((__int64)a1, &v101, 1);
v24 = v101 - 24;
if ( v101 - 24 != (unsigned __int8 *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v66 = (unsigned int *)(v101 - 8);
do
v67 = __ldaxr(v66);
while ( __stlxr(v67 - 1, v66) );
}
else
{
v67 = *((_DWORD *)v101 - 2);
*((_DWORD *)v101 - 2) = v67 - 1;
}
if ( v67 <= 0 )
operator delete(v24);
}
GameLevelManager::getBasePostString(a1, (__int64)&v102);
v90 = v98;
v87 = *a2;
v25 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
CString = cocos2d::CCString::getCString(v25);
v27 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&userName=%s&comment=%s&secret=%s",
v90,
v87,
CString);
v91 = (char *)cocos2d::CCString::getCString(v27);
v28 = strlen(v91);
sub_D15FD4(&v102, v91, v28);
if ( a3 )
{
sub_D15FD4(&v102, "&cType=", 7);
v92 = a3;
v29 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)a3);
v88 = cocos2d::CCString::getCString(v29);
v30 = strlen(v88);
sub_D15FD4(&v102, v88, v30);
}
else
{
sub_D15FD4(&v102, "&levelID=", 9);
v52 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)a4);
v93 = (char *)cocos2d::CCString::getCString(v52);
v53 = strlen(v93);
sub_D15FD4(&v102, v93, v53);
if ( a5 > 0 )
{
sub_D15FD4(&v102, "&percent=", 9);
v54 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a5);
v94 = (char *)cocos2d::CCString::getCString(v54);
v55 = strlen(v94);
sub_D15FD4(&v102, v94, v55);
}
v92 = 0;
}
v31 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s%s%i%i%i",
v98,
*a2,
a4,
(unsigned int)a5,
v92);
v32 = (char *)cocos2d::CCString::getCString(v31);
sub_D153B8((int)&v103, v32);
v33 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_78,
"PT6",
"iUrt",
119,
115,
"0J");
v97 = cocos2d::CCString::getCString(v33);
v34 = strlen(v97);
sub_D15FD4(&v103, v97, v34);
v35 = v103;
v36 = strlen(v103);
rtsha1::calc((rtsha1 *)v35, (const void *)v36, (__int64)v113, v37);
rtsha1::toHexString((rtsha1 *)v113, v114, v38);
sub_D153B8((int)&v105, (char *)v114);
sub_D153B8((int)&v106, "29481");
cocos2d::ZipUtils::base64EncodeEnc((cocos2d::ZipUtils *)&v105, &v106, v115);
v39 = (char *)v106.m_data.m_data - 24;
if ( (__int64 *)v106.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v60 = (unsigned int *)((char *)v106.m_data.m_data - 8);
do
v61 = __ldaxr(v60);
while ( __stlxr(v61 - 1, v60) );
}
else
{
v61 = *((_DWORD *)v106.m_data.m_data - 2);
*((_DWORD *)v106.m_data.m_data - 2) = v61 - 1;
}
if ( v61 <= 0 )
operator delete(v39);
}
v40 = (void *)(v105 - 24);
if ( (__int64 *)(v105 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v68 = (unsigned int *)(v105 - 8);
do
v69 = __ldaxr(v68);
while ( __stlxr(v69 - 1, v68) );
}
else
{
v69 = *(_DWORD *)(v105 - 8);
*(_DWORD *)(v105 - 8) = v69 - 1;
}
if ( v69 <= 0 )
operator delete(v40);
}
sub_D15FD4(&v102, "&chk=", 5);
sub_D15E14(&v102, &v104);
if ( a3 )
{
sub_D153B8((int)&v110, "https://www.boomlings.com/database/uploadGJAccComment20.php");
sub_D153B8((int)&v111, v102);
sub_D153B8((int)&v112, PostCommentKey);
GameLevelManager::ProcessHttpRequest(a1, &v110, &v111, (cocos2d::extension::CCHttpClient **)&v112, 13);
v56 = (char *)v112.m_data.m_data - 24;
if ( (__int64 *)v112.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v78 = (unsigned int *)((char *)v112.m_data.m_data - 8);
do
v79 = __ldaxr(v78);
while ( __stlxr(v79 - 1, v78) );
}
else
{
v79 = *((_DWORD *)v112.m_data.m_data - 2);
*((_DWORD *)v112.m_data.m_data - 2) = v79 - 1;
}
if ( v79 <= 0 )
operator delete(v56);
}
v57 = (char *)(v111 - 24);
if ( v111 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v82 = (unsigned int *)(v111 - 8);
do
v83 = __ldaxr(v82);
while ( __stlxr(v83 - 1, v82) );
}
else
{
v83 = *((_DWORD *)v111 - 2);
*((_DWORD *)v111 - 2) = v83 - 1;
}
if ( v83 <= 0 )
operator delete(v57);
}
v43 = v110;
v44 = (char *)(v110 - 24);
if ( v110 - 24 == (const char *)&qword_124B6B0 )
goto LABEL_35;
if ( &pthread_create )
{
v58 = (unsigned int *)(v110 - 8);
do
v59 = __ldaxr(v58);
while ( __stlxr(v59 - 1, v58) );
LABEL_54:
if ( v59 <= 0 )
operator delete(v44);
LABEL_35:
v45 = (void *)(v104 - 24);
if ( (__int64 *)(v104 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v72 = (unsigned int *)(v104 - 8);
do
v73 = __ldaxr(v72);
while ( __stlxr(v73 - 1, v72) );
}
else
{
v73 = *(_DWORD *)(v104 - 8);
*(_DWORD *)(v104 - 8) = v73 - 1;
}
if ( v73 <= 0 )
operator delete(v45);
}
v46 = v103 - 24;
if ( v103 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v76 = (unsigned int *)(v103 - 8);
do
v77 = __ldaxr(v76);
while ( __stlxr(v77 - 1, v76) );
}
else
{
v77 = *((_DWORD *)v103 - 2);
*((_DWORD *)v103 - 2) = v77 - 1;
}
if ( v77 <= 0 )
operator delete(v46);
}
v47 = v102 - 24;
if ( v102 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v64 = (unsigned int *)(v102 - 8);
do
v65 = __ldaxr(v64);
while ( __stlxr(v65 - 1, v64) );
}
else
{
v65 = *((_DWORD *)v102 - 2);
*((_DWORD *)v102 - 2) = v65 - 1;
}
if ( v65 <= 0 )
operator delete(v47);
}
v48 = (void *)(v99 - 24);
if ( (__int64 *)(v99 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v74 = (unsigned int *)(v99 - 8);
do
v75 = __ldaxr(v74);
while ( __stlxr(v75 - 1, v74) );
}
else
{
v75 = *(_DWORD *)(v99 - 8);
*(_DWORD *)(v99 - 8) = v75 - 1;
}
if ( v75 <= 0 )
operator delete(v48);
}
v49 = v98 - 24;
if ( v98 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v50 = (unsigned int *)(v98 - 8);
do
v51 = __ldaxr(v50);
while ( __stlxr(v51 - 1, v50) );
}
else
{
v51 = *((_DWORD *)v98 - 2);
*((_DWORD *)v98 - 2) = v51 - 1;
}
if ( v51 <= 0 )
operator delete(v49);
}
return _stack_chk_guard;
}
}
else
{
sub_D153B8((int)&v107, "https://www.boomlings.com/database/uploadGJComment21.php");
sub_D153B8((int)&v108, v102);
sub_D153B8((int)&v109, PostCommentKey);
GameLevelManager::ProcessHttpRequest(a1, &v107, &v108, &v109, 13);
p_m_unknown2 = &v109[-1].m_unknown2;
if ( &v109[-1].m_unknown2 != (int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_timeoutForConnect = (unsigned int *)&v109[-1]._timeoutForConnect;
do
timeoutForConnect = __ldaxr(p_timeoutForConnect);
while ( __stlxr(timeoutForConnect - 1, p_timeoutForConnect) );
}
else
{
timeoutForConnect = v109[-1]._timeoutForConnect;
v109[-1]._timeoutForConnect = timeoutForConnect - 1;
}
if ( timeoutForConnect <= 0 )
operator delete(p_m_unknown2);
}
v42 = (char *)(v108 - 24);
if ( v108 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v80 = (unsigned int *)(v108 - 8);
do
v81 = __ldaxr(v80);
while ( __stlxr(v81 - 1, v80) );
}
else
{
v81 = *((_DWORD *)v108 - 2);
*((_DWORD *)v108 - 2) = v81 - 1;
}
if ( v81 <= 0 )
operator delete(v42);
}
v43 = v107;
v44 = (char *)(v107 - 24);
if ( v107 - 24 == (const char *)&qword_124B6B0 )
goto LABEL_35;
if ( &pthread_create )
{
v84 = (unsigned int *)(v107 - 8);
do
v59 = __ldaxr(v84);
while ( __stlxr(v59 - 1, v84) );
goto LABEL_54;
}
}
v59 = *((_DWORD *)v43 - 2);
*((_DWORD *)v43 - 2) = v59 - 1;
goto LABEL_54;
}
return _stack_chk_guard;
}