//
// GameLevelManager::onUploadCommentCompleted from 0x4c53f0 to 0x4c58f4 (1284 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x4da8ba
//
// 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:30 +0000
//
int (__fastcall ***__fastcall GameLevelManager::onUploadCommentCompleted(
GameLevelManager *a1,
_DWORD *a2,
int a3))(_DWORD, const char *)
{
cocos2d::CCDictionary *v4; // r8
const char *v6; // r6
size_t v7; // r0
size_t v8; // r0
_BOOL4 v9; // r8
GJAccountManager *v10; // r0
int v11; // r2
int v12; // r3
int v13; // r0
const char *v14; // r5
int v15; // r11
const char *v16; // r0
unsigned __int8 **v17; // r0
unsigned __int8 **v18; // r3
int v19; // r0
int *v20; // r0
int (__fastcall ***result)(_DWORD, const char *); // r0
unsigned __int8 *v22; // r12
unsigned int v23; // r3
unsigned __int8 *v24; // r11
cocos2d::CCArray *v25; // r10
cocos2d::CCString *v26; // r0
int v27; // r11
int v28; // r0
char *v29; // r1
cocos2d::CCString *v30; // r5
const char *CString; // r5
cocos2d::CCString *v32; // r0
int v33; // r0
const char *v34; // r0
const char *v35; // r10
size_t v36; // r0
int *v37; // r4
GameLevelManager *v38; // r4
const char *AccountCommentKey; // r0
GameLevelManager *v40; // r10
int v41; // r0
char *v42; // r1
GameLevelManager *v43; // r0
GameLevelManager *v44; // r8
int v45; // r0
GameLevelManager *v46; // r0
char *v47; // r1
GameLevelManager *v48; // r10
int v49; // r0
char *v50; // r1
GameLevelManager *v51; // r0
GameLevelManager *v52; // r8
int v53; // r0
char *v54; // r1
GameLevelManager *v55; // r0
GameLevelManager *v56; // r8
int v57; // r0
char *v58; // r1
GameLevelManager *v59; // r0
GameLevelManager *v60; // r8
int v61; // r0
char *v62; // r1
GameLevelManager *v63; // r0
GameLevelManager *v64; // r8
int v65; // r0
char *v66; // r1
GameLevelManager *v67; // r0
GameLevelManager *v68; // r8
int v69; // r0
char *v70; // r1
GameLevelManager *v71; // r0
GameLevelManager *v72; // r8
int v73; // r0
char *v74; // r1
GameLevelManager *v75; // r0
GameLevelManager *v76; // r8
int v77; // r0
unsigned __int8 **v78; // [sp+14h] [bp-30h]
unsigned __int8 *v79; // [sp+14h] [bp-30h]
unsigned __int8 *v80; // [sp+1Ch] [bp-28h] BYREF
int v81[3]; // [sp+24h] [bp-20h] BYREF
int v82; // [sp+30h] [bp-14h] BYREF
int v83; // [sp+34h] [bp-10h]
char *v84; // [sp+38h] [bp-Ch]
v4 = *((cocos2d::CCDictionary **)a1 + 187);
v82 = 0;
v83 = 0;
v84 = nullptr;
if ( (*(_BYTE *)a3 & 1) != 0 )
v6 = *(const char **)(a3 + 8);
else
v6 = (const char *)(a3 + 1);
v7 = strlen(v6);
std::string::__init(&v82, v6, v7);
cocos2d::CCDictionary::removeObjectForKey(v4);
std::string::~string((int)&v82);
memset(v81, 0, sizeof(v81));
v8 = strlen(v6);
std::string::__init(v81, v6, v8);
v82 = 0;
v83 = 0;
v84 = nullptr;
std::string::__init(&v82, "acc_comment", 0xBu);
v9 = sub_4A9CC4((unsigned __int8 *)v81, (unsigned __int8 *)&v82);
std::string::~string((int)&v82);
v10 = (GJAccountManager *)std::string::~string((int)v81);
if ( v9 )
{
v13 = GJAccountManager::sharedState(v10);
v14 = (const char *)(*(_DWORD *)(v13 + 280) - *(_DWORD *)(v13 + 284));
}
else
{
v14 = (const char *)GameLevelManager::levelIDFromPostCommentKey(a1, v6, v11, v12);
}
v15 = *(unsigned __int8 *)a2;
if ( (v15 & 1) != 0 )
v16 = (const char *)a2[2];
else
v16 = (char *)a2 + 1;
v17 = (unsigned __int8 **)atoi(v16);
v18 = v17;
if ( (int)v17 < 0 )
{
v19 = *((_DWORD *)a1 + 208);
if ( v19 )
{
v78 = v18;
(*(void (__fastcall **)(int, const char *, unsigned __int8 **))(*(_DWORD *)v19 + 4))(v19, v14, v18);
v18 = v78;
}
if ( v18 == (unsigned __int8 **)-10 )
{
v82 = 0;
v83 = 0;
v84 = nullptr;
std::string::__init(&v82, "You have been permanently banned from making comments.", 0x3Eu);
v20 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)"Banned", (int)&v82, (ButtonSprite *)"OK", nullptr);
(*(void (__fastcall **)(int *))(*v20 + 656))(v20);
return (int (__fastcall ***)(_DWORD, const char *))std::string::~string((int)&v82);
}
return (int (__fastcall ***)(_DWORD, const char *))GameLevelManager::resetTimerForKey(a1, v6);
}
if ( (v15 & 1) != 0 )
{
v22 = (unsigned __int8 *)a2[2];
v23 = a2[1];
}
else
{
v22 = (unsigned __int8 *)a2 + 1;
v23 = v15 >> 1;
}
if ( v23 > 3 )
{
v24 = &v22[v23];
v79 = v22;
v17 = std::__search(
&v80,
v22,
&v22[v23],
"temp",
(unsigned __int8 *)"",
(int (__fastcall *)(int, _DWORD))std::char_traits::eq);
if ( v80 != v24 && v80 - v79 != -1 )
{
v25 = sub_4C1A88(a2, "_");
if ( cocos2d::CCArray::count(v25) <= 1u )
{
v27 = 0;
}
else
{
v26 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v25, 1u);
v27 = cocos2d::CCString::intValue(v26);
}
v28 = *((_DWORD *)a1 + 208);
if ( v28 )
(*(void (__fastcall **)(int, const char *, int))(*(_DWORD *)v28 + 4))(v28, v14, -10);
GameToolbox::getTimeString((GameToolbox *)&v82, v27, 0);
if ( (v82 & 1) != 0 )
v29 = v84;
else
v29 = (char *)&v82 + 1;
v30 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"You have been banned from making comments for: %s",
v29,
(unsigned __int8)v82 << 31);
std::string::~string((int)&v82);
if ( cocos2d::CCArray::count(v25) > 2u )
{
CString = (const char *)cocos2d::CCString::getCString(v30);
v32 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v25, 2u);
v33 = cocos2d::CCString::getCString(v32);
v30 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s.\n\nReason: %s",
CString,
v33);
}
v34 = (const char *)cocos2d::CCString::getCString(v30);
v82 = 0;
v83 = 0;
v84 = nullptr;
v35 = v34;
v36 = strlen(v34);
std::string::__init(&v82, v35, v36);
v37 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)"Banned", (int)&v82, (ButtonSprite *)"OK", nullptr, 380.0);
std::string::~string((int)&v82);
(*(void (__fastcall **)(int *))(*v37 + 656))(v37);
return (int (__fastcall ***)(_DWORD, const char *))GameLevelManager::resetTimerForKey(a1, v6);
}
}
if ( v9 )
{
v38 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)v17);
AccountCommentKey = (const char *)GameLevelManager::getAccountCommentKey(a1, v14, 0);
GameLevelManager::resetTimerForKey(v38, AccountCommentKey);
}
else
{
if ( (int)v14 >= 0 )
{
v48 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)v17);
v49 = GameLevelManager::sharedState(v48);
GameLevelManager::getCommentKey(&v82, v49, v14, 0, 0, 0);
if ( (v82 & 1) != 0 )
v50 = v84;
else
v50 = (char *)&v82 + 1;
GameLevelManager::resetTimerForKey(v48, v50);
v51 = (GameLevelManager *)std::string::~string((int)&v82);
v52 = (GameLevelManager *)GameLevelManager::sharedState(v51);
v53 = GameLevelManager::sharedState(v52);
GameLevelManager::getCommentKey(&v82, v53, v14, 0, 1, 0);
if ( (v82 & 1) != 0 )
v54 = v84;
else
v54 = (char *)&v82 + 1;
GameLevelManager::resetTimerForKey(v52, v54);
v55 = (GameLevelManager *)std::string::~string((int)&v82);
v56 = (GameLevelManager *)GameLevelManager::sharedState(v55);
v57 = GameLevelManager::sharedState(v56);
GameLevelManager::getCommentKey(&v82, v57, v14, 0, 0, 3);
if ( (v82 & 1) != 0 )
v58 = v84;
else
v58 = (char *)&v82 + 1;
GameLevelManager::resetTimerForKey(v56, v58);
v59 = (GameLevelManager *)std::string::~string((int)&v82);
v60 = (GameLevelManager *)GameLevelManager::sharedState(v59);
v61 = GameLevelManager::sharedState(v60);
GameLevelManager::getCommentKey(&v82, v61, v14, 0, 1, 3);
if ( (v82 & 1) != 0 )
v62 = v84;
else
v62 = (char *)&v82 + 1;
GameLevelManager::resetTimerForKey(v60, v62);
v63 = (GameLevelManager *)std::string::~string((int)&v82);
v64 = (GameLevelManager *)GameLevelManager::sharedState(v63);
v65 = GameLevelManager::sharedState(v64);
GameLevelManager::getCommentKey(&v82, v65, v14, 0, 0, 4);
if ( (v82 & 1) != 0 )
v66 = v84;
else
v66 = (char *)&v82 + 1;
GameLevelManager::resetTimerForKey(v64, v66);
v67 = (GameLevelManager *)std::string::~string((int)&v82);
v68 = (GameLevelManager *)GameLevelManager::sharedState(v67);
v69 = GameLevelManager::sharedState(v68);
GameLevelManager::getCommentKey(&v82, v69, v14, 0, 1, 4);
if ( (v82 & 1) != 0 )
v70 = v84;
else
v70 = (char *)&v82 + 1;
GameLevelManager::resetTimerForKey(v68, v70);
v71 = (GameLevelManager *)std::string::~string((int)&v82);
v72 = (GameLevelManager *)GameLevelManager::sharedState(v71);
v73 = GameLevelManager::sharedState(v72);
GameLevelManager::getCommentKey(&v82, v73, v14, 0, 0, 5);
if ( (v82 & 1) != 0 )
v74 = v84;
else
v74 = (char *)&v82 + 1;
GameLevelManager::resetTimerForKey(v72, v74);
v75 = (GameLevelManager *)std::string::~string((int)&v82);
v76 = (GameLevelManager *)GameLevelManager::sharedState(v75);
v77 = GameLevelManager::sharedState(v76);
GameLevelManager::getCommentKey(&v82, v77, v14, 0, 1, 5);
v46 = v76;
if ( (v82 & 1) != 0 )
v47 = v84;
else
v47 = (char *)&v82 + 1;
}
else
{
v40 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)v17);
v41 = GameLevelManager::sharedState(v40);
GameLevelManager::getCommentKey(&v82, v41, v14, 0, 0, 2);
if ( (v82 & 1) != 0 )
v42 = v84;
else
v42 = (char *)&v82 + 1;
GameLevelManager::resetTimerForKey(v40, v42);
v43 = (GameLevelManager *)std::string::~string((int)&v82);
v44 = (GameLevelManager *)GameLevelManager::sharedState(v43);
v45 = GameLevelManager::sharedState(v44);
GameLevelManager::getCommentKey(&v82, v45, v14, 0, 1, 2);
v46 = v44;
if ( (v82 & 1) != 0 )
v47 = v84;
else
v47 = (char *)&v82 + 1;
}
GameLevelManager::resetTimerForKey(v46, v47);
std::string::~string((int)&v82);
}
result = *((int (__fastcall ****)(_DWORD, const char *))a1 + 208);
if ( result )
return (int (__fastcall ***)(_DWORD, const char *))(**result)(result, v14);
return result;
}