//
// GameLevelManager::getGJChallenges from 0x14025e270 to 0x14025e6f7 (1159 bytes)
//
// 4 xrefs:
// > ChallengesPage::init @ 0x14009e17e
// > ChallengesPage::tryGetChallenges @ 0x14009e782
// > ChallengesPage::updateTimers @ 0x14009ee7c
// > ??> @ 0x14091c778
//
// 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:46 +0000
//
// Hidden C++ exception states: #wind=8
char __fastcall GameLevelManager::getGJChallenges(__int64 a1)
{
__int64 v2; // rbx
void *v3; // r8
__int64 v5; // rbx
__int64 v6; // rax
__int64 v7; // rcx
void *v8; // rcx
__int64 v9; // rax
cocos2d::CCString *v10; // rax
const char *CString; // rax
size_t v12; // rbx
size_t v13; // r8
const char *v14; // rax
const char *v15; // rdi
const char *v16; // rsi
cocos2d::CCString *v17; // rax
const char *v18; // rax
cocos2d::CCString *v19; // rax
char *v20; // rax
size_t v21; // r8
_QWORD *v22; // rdx
void *v23; // rcx
void *v24; // [rsp+40h] [rbp-C0h]
__int128 v25; // [rsp+48h] [rbp-B8h] BYREF
__int64 v26; // [rsp+58h] [rbp-A8h]
__int64 v27; // [rsp+60h] [rbp-A0h]
__int128 v28; // [rsp+68h] [rbp-98h] BYREF
__int64 v29; // [rsp+78h] [rbp-88h]
__int64 v30; // [rsp+80h] [rbp-80h]
__int128 *v31; // [rsp+88h] [rbp-78h]
void *Block[2]; // [rsp+98h] [rbp-68h] BYREF
__int64 v33; // [rsp+A8h] [rbp-58h]
unsigned __int64 v34; // [rsp+B0h] [rbp-50h]
void *v35[2]; // [rsp+B8h] [rbp-48h] BYREF
__int64 v36; // [rsp+C8h] [rbp-38h]
unsigned __int64 v37; // [rsp+D0h] [rbp-30h]
__int128 v38; // [rsp+D8h] [rbp-28h] BYREF
__int64 v39; // [rsp+E8h] [rbp-18h]
__int64 v40; // [rsp+F0h] [rbp-10h]
_QWORD Src[4]; // [rsp+F8h] [rbp-8h] BYREF
_QWORD v42[4]; // [rsp+118h] [rbp+18h] BYREF
Block[1] = nullptr;
v33 = 8;
v34 = 15;
Block[0] = (void *)0x6C6168635F746567LL;
v2 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 1192), Block);
if ( v34 > 0xF )
{
v3 = Block[0];
if ( v34 + 1 >= 0x1000 )
{
v3 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v3 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v3);
}
if ( v2 )
return 0;
Block[1] = nullptr;
v33 = 8;
v34 = 15;
Block[0] = (void *)0x6C6168635F746567LL;
v5 = *(_QWORD *)(a1 + 1192);
v6 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(v5, v6, Block);
if ( v34 > 0xF )
{
v8 = Block[0];
if ( v34 + 1 >= 0x1000 )
{
v8 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v8);
}
GameLevelManager::getBasePostString(v7, Src);
v9 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v24 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v24);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v9 = qword_14090BFD0;
}
v10 = cocos2d::CCString::createWithFormat(
(const char *)&word_1406ED6F8,
(unsigned int)(*(_DWORD *)(v9 + 928) - *(_DWORD *)(v9 + 932)));
CString = cocos2d::CCString::getCString(v10);
*(_OWORD *)v35 = 0;
v36 = 0;
v37 = 0;
v12 = -1;
v13 = -1;
do
++v13;
while ( CString[v13] );
sub_14003D230(v35, CString, v13);
*(_OWORD *)Block = 0;
v33 = 5;
v34 = 15;
strcpy((char *)Block, "19847");
cocos2d::ZipUtils::base64EncodeEnc(v42, v35, Block);
v14 = (const char *)sub_1402190E0(&v38, 5u);
v15 = v14;
v16 = (const char *)v42;
if ( v42[3] > 0xFu )
v16 = (const char *)v42[0];
if ( *((_QWORD *)v14 + 3) > 0xFu )
v15 = *(const char **)v14;
v17 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, (const char *)&word_14070D040);
v18 = cocos2d::CCString::getCString(v17);
v19 = cocos2d::CCString::createWithFormat("&world=%i&gdl=%i&secret=%s&chk=%s%s", 0, 0, v18, v15, v16);
v20 = (char *)cocos2d::CCString::getCString(v19);
v21 = -1;
do
++v21;
while ( v20[v21] );
sub_140044D80(Src, v20, v21);
sub_14003D310((__int64)&v38);
v31 = &v38;
v29 = 8;
v30 = 15;
v28 = 0x6C6168635F746567uLL;
v22 = Src;
if ( Src[3] > 0xFu )
v22 = (_QWORD *)Src[0];
v38 = 0;
v39 = 0;
v40 = 0;
do
++v12;
while ( *((_BYTE *)v22 + v12) );
sub_14003D230(&v38, v22, v12);
v25 = 0;
*(_QWORD *)&v25 = sub_14003D460(0x40u);
v26 = 54;
v27 = 63;
strcpy((char *)v25, "https://www.boomlings.com/database/getGJChallenges.php");
GameLevelManager::ProcessHttpRequest(
(cocos2d::CCActionManager **)a1,
(__int64)&v25,
(const char *)&v38,
(const char *)&v28,
0x35u);
sub_14003D310((__int64)v42);
if ( v37 > 0xF )
{
v23 = v35[0];
if ( v37 + 1 >= 0x1000 )
{
v23 = *((void **)v35[0] - 1);
if ( (unsigned __int64)((char *)v35[0] - (char *)v23 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v23);
}
v36 = 0;
v37 = 15;
LOBYTE(v35[0]) = 0;
sub_14003D310((__int64)Src);
return 1;
}