//
// GameLevelManager::updateLevel from 0x4b69d8 to 0x4b6b22 (330 bytes)
//
// 2 xrefs:
// > LevelInfoLayer::onUpdate @ 0x49b346
// > LevelInfoLayer::init @ 0x49ef24
//
// 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:09 +0000
//
int __fastcall GameLevelManager::updateLevel(GameLevelManager *this, GJGameLevel *a2)
{
const char *v2; // r11
const char *v4; // r4
const char *LevelDownloadKey; // r10
int result; // r0
int v7; // r2
int v8; // r3
cocos2d::CCString *v9; // r0
int CString; // r0
cocos2d::CCString *v11; // r0
char *v12; // r0
size_t v13; // r0
size_t v14; // r0
char *v15[3]; // [sp+14h] [bp-38h] BYREF
int v16[3]; // [sp+20h] [bp-2Ch] BYREF
int v17[3]; // [sp+2Ch] [bp-20h] BYREF
int v18[3]; // [sp+38h] [bp-14h] BYREF
v4 = (const char *)(*((_DWORD *)a2 + 67) - *((_DWORD *)a2 + 68));
LevelDownloadKey = (const char *)GameLevelManager::getLevelDownloadKey(
this,
v4,
*((unsigned __int8 *)a2 + 477),
*((_DWORD *)a2 + 186) - *((_DWORD *)a2 + 187));
result = GameLevelManager::isDLActive(this, LevelDownloadKey);
if ( !result )
{
GameLevelManager::addDLToActive(this, LevelDownloadKey, v7, v8);
GameLevelManager::getBasePostString((GameLevelManager *)v15);
v9 = (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(v9);
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&levelID=%i&gameVersion=%i&secret=%s",
v4,
22,
CString);
v12 = (char *)cocos2d::CCString::getCString(v11);
std::string::append(v15, v12);
memset(v16, 0, sizeof(v16));
std::string::__init(v16, "https://www.boomlings.com/database/downloadGJLevel22.php", 0x38u);
v17[0] = 0;
v17[1] = 0;
if ( ((int)v15[0] & 1) == 0 )
v2 = (char *)v15 + 1;
v17[2] = 0;
if ( ((int)v15[0] & 1) != 0 )
v2 = v15[2];
v13 = strlen(v2);
std::string::__init(v17, v2, v13);
memset(v18, 0, sizeof(v18));
v14 = strlen(LevelDownloadKey);
std::string::__init(v18, LevelDownloadKey, v14);
GameLevelManager::ProcessHttpRequest(this, v16, (int)v17, (int)v18, 5);
std::string::~string((int)v18);
std::string::~string((int)v17);
std::string::~string((int)v16);
return std::string::~string((int)v15);
}
return result;
}