//
// GameLevelManager::getLevelSaveData from 0x100559470 to 0x10055967a (522 bytes)
//
// 1 xrefs:
// > LoadingLayer::init @ 0x10038bd19
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:32:06 +0000
//
void __fastcall GameLevelManager::getLevelSaveData(__int64 a1)
{
__int64 v1; // rax
const std::string::value_type *CString; // rax
const char *data; // r14
size_t v4; // rax
size_t v5; // r15
char *v6; // r12
size_t v7; // r13
std::string v8; // [rsp+8h] [rbp-88h] BYREF
__int128 v9; // [rsp+20h] [rbp-70h] BYREF
void *__p; // [rsp+30h] [rbp-60h]
std::string v11; // [rsp+38h] [rbp-58h] BYREF
_QWORD __dst[2]; // [rsp+50h] [rbp-40h] BYREF
void *v13; // [rsp+60h] [rbp-30h]
if ( GameLevelManager::isDLActive(a1, "lvl_data") )
return;
GameLevelManager::addDLToActive(a1, "lvl_data");
GameLevelManager::getBasePostString(&v11);
std::string::append(&v11, "&secret=");
v1 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v1);
std::string::append(&v11, CString);
v8.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x38u);
v8.__r_.__value_.__r.__words[0] = 57;
v8.__r_.__value_.__l.__size_ = 50;
strcpy(v8.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/getSaveData.php");
if ( (*(_BYTE *)&v11.__r_.__value_.__s.0 & 1) != 0 )
data = v11.__r_.__value_.__l.__data_;
else
data = v11.__r_.__value_.__s.__data_;
v4 = strlen(data);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v5 = v4;
if ( v4 >= 0x17 )
{
v7 = 26;
if ( (v4 | 7) != 0x17 )
v7 = (v4 | 7) + 1;
v6 = (char *)operator new(v7);
v13 = v6;
__dst[0] = v7 | 1;
__dst[1] = v5;
goto LABEL_12;
}
LOBYTE(__dst[0]) = 2 * v4;
v6 = (char *)__dst + 1;
if ( v4 )
LABEL_12:
memmove(v6, data, v5);
v6[v5] = 0;
LOBYTE(v9) = 16;
strcpy((char *)&v9 + 1, "lvl_data");
GameLevelManager::ProcessHttpRequest(a1, &v8, (__int64)__dst, &v9, 0x32u);
if ( (v9 & 1) == 0 )
{
if ( (__dst[0] & 1) == 0 )
goto LABEL_15;
LABEL_20:
operator delete(v13);
if ( (*(_BYTE *)&v8.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_16:
if ( (*(_BYTE *)&v11.__r_.__value_.__s.0 & 1) == 0 )
return;
goto LABEL_17;
}
goto LABEL_21;
}
operator delete(__p);
if ( (__dst[0] & 1) != 0 )
goto LABEL_20;
LABEL_15:
if ( (*(_BYTE *)&v8.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_16;
LABEL_21:
operator delete(v8.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v11.__r_.__value_.__s.0 & 1) != 0 )
LABEL_17:
operator delete(v11.__r_.__value_.__l.__data_);
}