//
// GameLevelManager::uploadComment from 0x4ccd2c to 0x4cd24c (1312 bytes)
//
// 5 xrefs:
// > GameLevelManager::uploadLevelComment @ 0x4cd2e8
// > GameLevelManager::uploadAccountComment @ 0x4cd336
// > GameLevelManager::uploadEditorSoundComment @ 0x4cd388
// > GameLevelManager::uploadModRoomComment @ 0x4cd3dc
// > ShareCommentLayer::onShare @ 0x5411b2
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:50:41 +0000
//
cocos2d::CCNode *__fastcall GameLevelManager::uploadComment(
GameLevelManager *a1,
int a2,
const char *a3,
const char *a4,
const char *a5)
{
int v9; // r0
int v10; // r1
int v11; // r2
const char *PostCommentKey; // r7
size_t v13; // r0
int v14; // r5
int v15; // r5
cocos2d::CCNode *result; // r0
cocos2d::CCObject *v17; // r0
size_t v18; // r0
float v19; // r2
int v20; // r3
GameManager *TimeStamp; // r0
int v22; // r0
int *v23; // r0
int v24; // r0
char *v25; // r11
int v26; // r3
cocos2d::CCString *v27; // r0
int CString; // r0
cocos2d::CCString *v29; // r0
char *v30; // r0
cocos2d::CCString *v31; // r0
char *v32; // r0
char *v33; // r1
cocos2d::CCString *v34; // r0
cocos2d::CCString *v35; // r0
char *v36; // r0
char *v37; // r0
int v38; // r2
cocos2d::CCString *v39; // r0
const char *v40; // r4
size_t v41; // r0
cocos2d::CCString *v42; // r0
char *v43; // r0
char *v44; // r10
const void *v45; // r0
unsigned __int8 *v46; // r3
char *v47; // r2
size_t v48; // r0
char *v49; // r1
size_t v50; // r2
cocos2d::CCString *v51; // r0
char *v52; // r0
int *v53; // r6
char *v54; // r1
int *v55; // r11
size_t v56; // r0
size_t v57; // r0
int *v58; // r4
char *v59; // r1
size_t v60; // r0
size_t v61; // r0
int v62; // [sp+14h] [bp-B4h]
int v63; // [sp+14h] [bp-B4h]
char *v64; // [sp+14h] [bp-B4h]
char *v65; // [sp+14h] [bp-B4h]
cocos2d::CCObject *v66; // [sp+1Ch] [bp-ACh]
int v67[2]; // [sp+20h] [bp-A8h] BYREF
char *v68; // [sp+28h] [bp-A0h]
int v69[3]; // [sp+2Ch] [bp-9Ch] BYREF
int v70[3]; // [sp+38h] [bp-90h] BYREF
int v71[3]; // [sp+44h] [bp-84h] BYREF
char *v72[2]; // [sp+50h] [bp-78h] BYREF
char *v73; // [sp+58h] [bp-70h]
int v74[2]; // [sp+5Ch] [bp-6Ch] BYREF
char *v75; // [sp+64h] [bp-64h]
unsigned __int8 v76; // [sp+68h] [bp-60h] BYREF
char v77; // [sp+69h] [bp-5Fh] BYREF
size_t v78; // [sp+6Ch] [bp-5Ch]
char *v79; // [sp+70h] [bp-58h]
int v80[3]; // [sp+74h] [bp-54h] BYREF
int v81[3]; // [sp+80h] [bp-48h] BYREF
int v82[3]; // [sp+8Ch] [bp-3Ch] BYREF
int v83[3]; // [sp+98h] [bp-30h] BYREF
int v84[3]; // [sp+A4h] [bp-24h] BYREF
int v85[3]; // [sp+B0h] [bp-18h] BYREF
int v86[3]; // [sp+BCh] [bp-Ch] BYREF
int v87; // [sp+C8h] [bp+0h] BYREF
int v88; // [sp+CCh] [bp+4h]
int v89; // [sp+D0h] [bp+8h]
unsigned __int8 v90[20]; // [sp+D4h] [bp+Ch] BYREF
unsigned __int8 v91[44]; // [sp+E8h] [bp+20h] BYREF
std::string::basic_string(v86, a2);
LevelTools::base64EncodeString(&v87, v86);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
**(_BYTE **)(a2 + 8) = 0;
*(_DWORD *)(a2 + 4) = 0;
}
else
{
*(_BYTE *)(a2 + 1) = 0;
*(_BYTE *)a2 = 0;
}
std::string::reserve((int *)a2, 0);
v9 = v87;
v10 = v88;
v11 = v89;
v87 = 0;
v88 = 0;
v89 = 0;
*(_DWORD *)a2 = v9;
*(_DWORD *)(a2 + 4) = v10;
*(_DWORD *)(a2 + 8) = v11;
std::string::~string((int)&v87);
std::string::~string((int)v86);
if ( a3 && (unsigned int)(a3 - 6) > 2 )
PostCommentKey = "acc_comment";
else
PostCommentKey = (const char *)GameLevelManager::getPostCommentKey(a1, a4);
v87 = 0;
v88 = 0;
v89 = 0;
v13 = strlen(PostCommentKey);
v14 = *((_DWORD *)a1 + 187);
std::string::__init(&v87, PostCommentKey, v13);
v15 = cocos2d::CCDictionary::objectForKey(v14, &v87);
result = (cocos2d::CCNode *)std::string::~string((int)&v87);
if ( v15 )
return result;
v62 = *((_DWORD *)a1 + 187);
v17 = (cocos2d::CCObject *)cocos2d::CCNode::create(result);
v87 = 0;
v88 = 0;
v89 = 0;
v66 = v17;
v18 = strlen(PostCommentKey);
std::string::__init(&v87, PostCommentKey, v18);
cocos2d::CCDictionary::setObject(v62, v66);
std::string::~string((int)&v87);
TimeStamp = (GameManager *)GameLevelManager::makeTimeStamp(a1, PostCommentKey, v19, v20);
v22 = GameManager::sharedState(TimeStamp);
v23 = std::string::basic_string(v67, v22 + 448);
v24 = GameManager::sharedState((GameManager *)v23);
std::string::basic_string(v69, v24 + 436);
std::string::basic_string(v70, (int)v67);
GameLevelManager::removeDelimiterChars((int)a1, (unsigned __int8 *)v70, 0);
std::string::~string((int)v70);
std::string::basic_string(v71, a2);
GameLevelManager::removeDelimiterChars((int)a1, (unsigned __int8 *)v71, 1);
std::string::~string((int)v71);
GameLevelManager::getBasePostString((GameLevelManager *)v72);
if ( (v67[0] & 1) != 0 )
v25 = v68;
else
v25 = (char *)v67 + 1;
if ( (*(_BYTE *)a2 & 1) != 0 )
v26 = *(_DWORD *)(a2 + 8);
else
v26 = a2 + 1;
v63 = v26;
v27 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&a1i2r3e45s789g[9]);
CString = cocos2d::CCString::getCString(v27);
v29 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&userName=%s&comment=%s&secret=%s",
v25,
v63,
CString);
v30 = (char *)cocos2d::CCString::getCString(v29);
std::string::append(v72, v30);
if ( a3 )
{
if ( (unsigned int)(a3 - 6) <= 2 )
{
std::string::append(v72, "&levelID=");
v35 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", a4);
v36 = (char *)cocos2d::CCString::getCString(v35);
std::string::append(v72, v36);
if ( a3 == &byte_7 && (int)a5 > 0 )
{
std::string::append(v72, "&percent=");
v51 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", a5);
v52 = (char *)cocos2d::CCString::getCString(v51);
std::string::append(v72, v52);
}
}
std::string::append(v72, "&cType=");
v34 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", a3);
goto LABEL_22;
}
std::string::append(v72, "&levelID=");
v31 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", a4);
v32 = (char *)cocos2d::CCString::getCString(v31);
std::string::append(v72, v32);
if ( (int)a5 > 0 )
{
std::string::append(v72, "&percent=");
v34 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", a5);
LABEL_22:
v37 = (char *)cocos2d::CCString::getCString(v34);
std::string::append(v72, v37);
}
if ( (v67[0] & 1) != 0 )
v33 = v68;
else
v33 = (char *)v67 + 1;
if ( (*(_BYTE *)a2 & 1) != 0 )
v38 = *(_DWORD *)(a2 + 8);
else
v38 = a2 + 1;
v39 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s%s%i%i%i",
v33,
v38,
a4,
a5,
a3);
v40 = (const char *)cocos2d::CCString::getCString(v39);
v74[0] = 0;
v74[1] = 0;
v75 = nullptr;
v41 = strlen(v40);
std::string::__init(v74, v40, v41);
v42 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_78,
"PT6",
"iUrt",
119,
115,
"0J");
v43 = (char *)cocos2d::CCString::getCString(v42);
std::string::append(v74, v43);
if ( (v74[0] & 1) != 0 )
v44 = v75;
else
v44 = (char *)v74 + 1;
v45 = (const void *)strlen(v44);
rtsha1::calc((rtsha1 *)v44, v45, (int)v90, v46);
rtsha1::toHexString((rtsha1 *)v90, v91, v47);
memset(v80, 0, sizeof(v80));
v48 = strlen((const char *)v91);
std::string::__init(v80, v91, v48);
memset(v81, 0, sizeof(v81));
std::string::__init(v81, "29481", 5u);
cocos2d::ZipUtils::base64EncodeEnc(&v76, v80, v81);
std::string::~string((int)v81);
std::string::~string((int)v80);
std::string::append(v72, "&chk=");
if ( (v76 & 1) != 0 )
{
v49 = v79;
v50 = v78;
}
else
{
v50 = (int)v76 >> 1;
v49 = &v77;
}
std::string::append(v72, v49, v50);
if ( a3 && (unsigned int)(a3 - 6) > 2 )
{
v53 = v85;
memset(v85, 0, sizeof(v85));
std::string::__init(v85, "https://www.boomlings.com/database/uploadGJAccComment20.php", 0x3Bu);
v86[0] = 0;
v55 = v86;
v86[1] = 0;
if ( ((int)v72[0] & 1) == 0 )
v54 = (char *)v72 + 1;
v86[2] = 0;
if ( ((int)v72[0] & 1) != 0 )
v54 = v73;
v64 = v54;
v56 = strlen(v54);
std::string::__init(v86, v64, v56);
v87 = 0;
v88 = 0;
v89 = 0;
v57 = strlen(PostCommentKey);
v58 = &v87;
std::string::__init(&v87, PostCommentKey, v57);
GameLevelManager::ProcessHttpRequest(a1, v85, (int)v86, (int)&v87, 13);
}
else
{
v53 = v82;
memset(v82, 0, sizeof(v82));
std::string::__init(v82, "https://www.boomlings.com/database/uploadGJComment21.php", 0x38u);
v83[0] = 0;
v55 = v83;
v83[1] = 0;
if ( ((int)v72[0] & 1) == 0 )
v59 = (char *)v72 + 1;
v83[2] = 0;
if ( ((int)v72[0] & 1) != 0 )
v59 = v73;
v65 = v59;
v60 = strlen(v59);
std::string::__init(v83, v65, v60);
memset(v84, 0, sizeof(v84));
v61 = strlen(PostCommentKey);
v58 = v84;
std::string::__init(v84, PostCommentKey, v61);
GameLevelManager::ProcessHttpRequest(a1, v82, (int)v83, (int)v84, 13);
}
std::string::~string((int)v58);
std::string::~string((int)v55);
std::string::~string((int)v53);
std::string::~string((int)&v76);
std::string::~string((int)v74);
std::string::~string((int)v72);
std::string::~string((int)v69);
return (cocos2d::CCNode *)std::string::~string((int)v67);
}