//
// sub_14024B830 from 0x14024b830 to 0x14024bc73 (1091 bytes)
//
// 3 xrefs:
// > GameLevelManager::onSearchThreadMessagesCompleted @ 0x14024c37e
// > GameLevelManager::onGetThreadMessagesCompleted @ 0x14024d268
// > ??> @ 0x14091c3d0
//
// 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:40 +0000
//
// Hidden C++ exception states: #wind=4
cocos2d::CCArray *__fastcall sub_14024B830(_QWORD *a1)
{
_QWORD *v1; // rbx
cocos2d::CCArray *v2; // r12
size_t v3; // r8
cocos2d::CCArray *v4; // r15
void *v5; // r8
unsigned int i; // r14d
cocos2d::CCString *v7; // rax
const char *CString; // rax
size_t v9; // r8
cocos2d::CCArray *v10; // rdi
void *v11; // rcx
char *v12; // rsi
__int128 *v13; // rbx
cocos2d::CCString *v14; // rax
const char *v15; // rax
cocos2d::CCString *v16; // rax
cocos2d::CCString *v17; // rax
const char *v18; // rax
size_t v19; // r8
unsigned __int64 v20; // rdx
_QWORD *v21; // rcx
void *v22; // rcx
cocos2d::CCString *v23; // rax
const char *v24; // rax
cocos2d::CCString *v25; // rax
__int128 v27; // [rsp+30h] [rbp-69h] BYREF
__int128 v28; // [rsp+40h] [rbp-59h]
char *v29; // [rsp+50h] [rbp-49h]
__int128 *v30; // [rsp+58h] [rbp-41h]
void *Block[2]; // [rsp+60h] [rbp-39h] BYREF
__int64 v32; // [rsp+70h] [rbp-29h]
unsigned __int64 v33; // [rsp+78h] [rbp-21h]
__int128 v34; // [rsp+80h] [rbp-19h] BYREF
__int64 v35; // [rsp+90h] [rbp-9h]
unsigned __int64 v36; // [rsp+98h] [rbp-1h]
__int128 v37; // [rsp+A0h] [rbp+7h] BYREF
__int128 v38; // [rsp+B0h] [rbp+17h]
v1 = a1;
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
if ( v1[2] )
{
if ( v1[3] > 0xFu )
v1 = (_QWORD *)*v1;
*(_OWORD *)Block = 0;
v32 = 0;
v33 = 0;
v3 = -1;
do
++v3;
while ( *((_BYTE *)v1 + v3) );
sub_14003D230(Block, v1, v3);
v4 = sub_1400D2840((__int64 *)Block, (unsigned __int8 *)&word_14070D07C);
if ( v33 > 0xF )
{
v5 = Block[0];
if ( v33 + 1 >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v5);
}
v32 = 0;
v33 = 15;
LOBYTE(Block[0]) = 0;
for ( i = 0; i < cocos2d::CCArray::count(v4); ++i )
{
v7 = cocos2d::CCArray::stringAtIndex(v4, i);
CString = cocos2d::CCString::getCString(v7);
v34 = 0;
v35 = 0;
v36 = 0;
v9 = -1;
do
++v9;
while ( CString[v9] );
sub_14003D230(&v34, CString, v9);
v10 = sub_1400D2840((__int64 *)&v34, ":");
if ( v36 > 0xF )
{
v11 = (void *)v34;
if ( v36 + 1 >= 0x1000 )
{
v11 = *(void **)(v34 - 8);
if ( (unsigned __int64)(v34 - (_QWORD)v11 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v11);
}
v35 = 0;
v36 = 15;
LOBYTE(v34) = 0;
if ( cocos2d::CCArray::count(v10) >= 4 )
{
v12 = (char *)operator new(0x78u);
v29 = v12;
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v12);
*(_QWORD *)v12 = &GJThreadMessage::`vftable';
*((_QWORD *)v12 + 7) = 0;
*((_DWORD *)v12 + 16) = 0;
v13 = (__int128 *)(v12 + 72);
*(_OWORD *)(v12 + 72) = 0;
*((_QWORD *)v12 + 11) = 0;
*((_QWORD *)v12 + 12) = 15;
v12[72] = 0;
*((_QWORD *)v12 + 13) = 0;
v12[112] = 0;
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v12);
v14 = cocos2d::CCArray::stringAtIndex(v10, 0);
v15 = cocos2d::CCString::getCString(v14);
*((_QWORD *)v12 + 7) = atoll(v15);
v16 = cocos2d::CCArray::stringAtIndex(v10, 1u);
*((_DWORD *)v12 + 16) = cocos2d::CCString::intValue(v16);
v17 = cocos2d::CCArray::stringAtIndex(v10, 2u);
v18 = cocos2d::CCString::getCString(v17);
v27 = 0;
v28 = 0u;
v19 = -1;
do
++v19;
while ( v18[v19] );
sub_14003D230(&v27, v18, v19);
v30 = &v27;
if ( (_QWORD)v28 )
{
cocos2d::ZipUtils::base64URLDecode(&v37, &v27);
}
else
{
v37 = v27;
v38 = v28;
*(_QWORD *)&v28 = 0;
*((_QWORD *)&v28 + 1) = 15;
LOBYTE(v27) = 0;
}
sub_14003D310((__int64)&v27);
if ( v13 == &v37 )
{
if ( *((_QWORD *)&v38 + 1) > 0xFu )
{
v22 = (void *)v37;
if ( (unsigned __int64)(*((_QWORD *)&v38 + 1) + 1LL) >= 0x1000 )
{
v22 = *(void **)(v37 - 8);
if ( (unsigned __int64)(v37 - (_QWORD)v22 - 8) > 0x1F )
LABEL_41:
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v22);
}
}
else
{
v20 = *((_QWORD *)v12 + 12);
if ( v20 > 0xF )
{
v21 = *(_QWORD **)v13;
if ( v20 + 1 >= 0x1000 )
{
if ( (unsigned __int64)v21 - *(v21 - 1) - 8 > 0x1F )
goto LABEL_41;
v21 = (_QWORD *)*(v21 - 1);
}
j_j_free(v21);
}
*v13 = v37;
*(_OWORD *)(v12 + 88) = v38;
}
v23 = cocos2d::CCArray::stringAtIndex(v10, 3u);
v24 = cocos2d::CCString::getCString(v23);
*((_QWORD *)v12 + 13) = atoll(v24);
if ( cocos2d::CCArray::count(v10) >= 5 )
{
v25 = cocos2d::CCArray::stringAtIndex(v10, 4u);
v12[112] = cocos2d::CCString::intValue(v25) != 0;
}
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v12);
}
}
}
return v2;
}