//
// GameLevelManager::getGauntletLevels from 0x1402318f0 to 0x140231bfd (781 bytes)
//
// 2 xrefs:
// > GauntletLayer::init @ 0x1402fb606
// > ??> @ 0x14091bf14
//
// 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 11:28:30 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall GameLevelManager::getGauntletLevels(cocos2d::CCActionManager **a1, unsigned int a2)
{
cocos2d::CCString *v4; // rax
const char *CString; // rax
size_t v6; // rbx
size_t v7; // r8
void **v8; // rdx
void **v9; // rdx
__int64 v10; // rcx
cocos2d::CCString *v11; // rax
char *v12; // rax
size_t v13; // r8
cocos2d::CCString *v14; // rax
char *v15; // rax
size_t v16; // r8
void **v17; // rdx
size_t v18; // r8
_QWORD *v19; // rdx
__int64 v20; // rax
void *v21; // rcx
int Reserved; // [rsp+20h] [rbp-E0h]
int v23; // [rsp+28h] [rbp-D8h]
__int128 v24; // [rsp+50h] [rbp-B0h] BYREF
__int64 v25; // [rsp+60h] [rbp-A0h]
__int64 v26; // [rsp+68h] [rbp-98h]
__int128 v27; // [rsp+70h] [rbp-90h] BYREF
__int64 v28; // [rsp+80h] [rbp-80h]
__int64 v29; // [rsp+88h] [rbp-78h]
__int128 v30; // [rsp+90h] [rbp-70h] BYREF
__int64 v31; // [rsp+A0h] [rbp-60h]
__int64 v32; // [rsp+A8h] [rbp-58h]
__int128 *v33; // [rsp+B0h] [rbp-50h]
_BYTE v34[32]; // [rsp+B8h] [rbp-48h] BYREF
void *Block[2]; // [rsp+D8h] [rbp-28h] BYREF
__int128 v36; // [rsp+E8h] [rbp-18h]
_QWORD Src[4]; // [rsp+F8h] [rbp-8h] BYREF
v4 = cocos2d::CCString::createWithFormat("gauntlet_%i", a2);
CString = cocos2d::CCString::getCString(v4);
*(_OWORD *)Block = 0;
v36 = 0;
v6 = -1;
v7 = -1;
do
++v7;
while ( CString[v7] );
sub_14003D230(Block, CString, v7);
v8 = Block;
if ( *((_QWORD *)&v36 + 1) > 0xFu )
v8 = (void **)Block[0];
if ( !GameLevelManager::isDLActive((__int64)a1, v8) )
{
v9 = Block;
if ( *((_QWORD *)&v36 + 1) > 0xFu )
v9 = (void **)Block[0];
GameLevelManager::addDLToActive((__int64)a1, v9);
GameLevelManager::getBasePostString(v10, Src);
sub_140044D80(Src, "&gauntlet=", 0xAu);
v11 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, a2);
v12 = (char *)cocos2d::CCString::getCString(v11);
v13 = -1;
do
++v13;
while ( v12[v13] );
sub_140044D80(Src, v12, v13);
sub_140044D80(Src, "&secret=", 8u);
v23 = 98;
Reserved = 103;
v14 = cocos2d::CCString::createWithFormat(
"%c%s%s%c%c%s",
87,
"mfd",
"2893",
Reserved,
v23,
(const char *)&word_14070D040);
v15 = (char *)cocos2d::CCString::getCString(v14);
v16 = -1;
do
++v16;
while ( v15[v16] );
sub_140044D80(Src, v15, v16);
v33 = &v30;
v17 = Block;
if ( *((_QWORD *)&v36 + 1) > 0xFu )
v17 = (void **)Block[0];
v27 = 0;
v28 = 0;
v29 = 0;
v18 = -1;
do
++v18;
while ( *((_BYTE *)v17 + v18) );
sub_14003D230(&v27, v17, v18);
v19 = Src;
if ( Src[3] > 0xFu )
v19 = (_QWORD *)Src[0];
v30 = 0;
v31 = 0;
v32 = 0;
do
++v6;
while ( *((_BYTE *)v19 + v6) );
sub_14003D230(&v30, v19, v6);
v24 = 0;
*(_QWORD *)&v24 = sub_14003D460(0x50u);
v25 = 68;
v26 = 79;
strcpy((char *)v24, "aHR0cDovL3d3dy5ib29tbGluZ3MuY29tL2RhdGFiYXNlL2dldEdKTGV2ZWxzMjEucGhw");
v20 = LevelTools::base64DecodeString(v34, &v24);
GameLevelManager::ProcessHttpRequest(a1, v20, (const char *)&v30, (const char *)&v27, 2u);
sub_14003D310((__int64)Src);
}
if ( *((_QWORD *)&v36 + 1) > 0xFu )
{
v21 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v36 + 1) + 1LL) >= 0x1000 )
{
v21 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v21 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v21);
}
}