//
// GameLevelManager::uploadLevelControls from 0x4c1430 to 0x4c15d4 (420 bytes)
//
// 2 xrefs:
// > GameLevelManager::onUploadLevelCompleted @ 0x4c1718
// > PlatformerControlsPopup::onUpload @ 0x79e272
//
// 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:24 +0000
//
int __fastcall GameLevelManager::uploadLevelControls(GameManager *a1, const char *a2, int a3)
{
char *v3; // r11
_DWORD *v7; // r0
int v8; // r1
char *v9; // r2
int v10; // r8
cocos2d::CCObject *v11; // r0
int v12; // r6
cocos2d::CCString *v13; // r0
int CString; // r0
cocos2d::CCString *v15; // r0
char *v16; // r0
size_t v17; // r0
size_t v18; // r0
int v19; // r4
_DWORD v21[2]; // [sp+10h] [bp-44h] BYREF
char *v22; // [sp+18h] [bp-3Ch]
char *v23[3]; // [sp+1Ch] [bp-38h] BYREF
int v24[3]; // [sp+28h] [bp-2Ch] BYREF
int v25[3]; // [sp+34h] [bp-20h] BYREF
int v26[3]; // [sp+40h] [bp-14h] BYREF
std::to_string((int)v26);
v7 = std::string::insert(v26, 0, "lctrlup_");
v8 = v7[1];
v9 = (char *)v7[2];
v21[0] = *v7;
v21[1] = v8;
v22 = v9;
*v7 = 0;
v7[1] = 0;
v7[2] = 0;
std::string::~string((int)v26);
if ( cocos2d::CCDictionary::objectForKey(*((_DWORD *)a1 + 187), v21) )
{
v19 = 0;
}
else
{
v10 = *((_DWORD *)a1 + 187);
v11 = (cocos2d::CCObject *)cocos2d::CCString::create(a3);
cocos2d::CCDictionary::setObject(v10, v11);
GameLevelManager::getBasePostString((GameLevelManager *)v23);
if ( (*(_BYTE *)a3 & 1) != 0 )
v12 = *(_DWORD *)(a3 + 8);
else
v12 = a3 + 1;
v13 = (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(v13);
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&levelID=%i&data=%s&secret=%s",
a2,
v12,
CString);
v16 = (char *)cocos2d::CCString::getCString(v15);
std::string::append(v23, v16);
memset(v24, 0, sizeof(v24));
std::string::__init(v24, "https://www.boomlings.com/database/uploadGJLevelControls.php", 0x3Cu);
if ( ((int)v23[0] & 1) == 0 )
v3 = (char *)v23 + 1;
v25[0] = 0;
if ( ((int)v23[0] & 1) != 0 )
v3 = v23[2];
v25[1] = 0;
v25[2] = 0;
v17 = strlen(v3);
std::string::__init(v25, v3, v17);
if ( (v21[0] & 1) == 0 )
v3 = (char *)v21 + 1;
v26[0] = 0;
if ( (v21[0] & 1) != 0 )
v3 = v22;
v26[1] = 0;
v26[2] = 0;
v18 = strlen(v3);
std::string::__init(v26, v3, v18);
GameLevelManager::ProcessHttpRequest(a1, v24, (int)v25, (int)v26, 28);
v19 = 1;
std::string::~string((int)v26);
std::string::~string((int)v25);
std::string::~string((int)v24);
std::string::~string((int)v23);
}
std::string::~string((int)v21);
return v19;
}