//
// GameLevelManager::onAdminGetUserHistoryCompleted from 0x140242300 to 0x140242df2 (2802 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x14021ad4f
// > ??> @ 0x14091c250
//
// 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:37 +0000
//
// Hidden C++ exception states: #wind=9
void __fastcall GameLevelManager::onAdminGetUserHistoryCompleted(__int64 a1, const void **a2, __int64 a3)
{
const char *v3; // r15
__int64 v5; // r13
_BYTE *v6; // rdx
size_t v7; // r8
__int64 v8; // r8
__int64 v9; // rdx
void *v10; // rcx
unsigned int v11; // r14d
_OWORD *v12; // rcx
unsigned __int64 v13; // rsi
size_t v14; // r8
int v15; // ebx
__int64 v16; // r8
__int64 v17; // rcx
__int64 v18; // rcx
__int128 *v19; // r14
unsigned __int64 v20; // rbx
unsigned __int64 v21; // rdi
_QWORD *v22; // rsi
const void **v23; // r14
const void *v24; // rax
unsigned __int64 v25; // r14
char *v26; // rbx
__int64 v27; // rax
size_t v28; // r8
const void *v29; // rdx
__int64 v30; // rdx
__int64 v31; // rcx
__int64 v32; // r8
__int64 v33; // r9
char *v34; // rax
unsigned __int64 v35; // r14
const void *v36; // rax
size_t v37; // rax
size_t v38; // r8
const void **v39; // rax
cocos2d::CCArray *v40; // rbx
void *v41; // r8
cocos2d::CCString *v42; // rax
cocos2d::CCString *v43; // rax
cocos2d::CCString *v44; // rax
cocos2d::CCArray *v45; // rbx
__int128 *v46; // rdx
size_t v47; // r8
cocos2d::CCArray *v48; // rbx
unsigned int v49; // r13d
cocos2d::CCString *v50; // rax
const char *CString; // rax
size_t v52; // r8
cocos2d::CCArray *v53; // rbx
void *v54; // rcx
char *v55; // rdi
cocos2d::CCString *v56; // rax
char *v57; // rax
size_t v58; // r8
cocos2d::CCString *v59; // rax
char *v60; // rax
size_t v61; // r8
cocos2d::CCString *v62; // rax
cocos2d::CCString *v63; // rax
cocos2d::CCString *v64; // rax
const char *v65; // rax
size_t v66; // r8
void *v67; // rcx
cocos2d::CCString *v68; // rax
const char *v69; // rax
size_t v70; // r8
void *v71; // rcx
cocos2d::CCString *v72; // rax
const char *v73; // rax
cocos2d::CCString *v74; // rax
cocos2d::CCString *v75; // rax
const char *v76; // rax
size_t v77; // r8
void *v78; // rcx
unsigned int v79; // edx
__int64 v80; // rcx
int v81; // [rsp+30h] [rbp-D0h]
int v82; // [rsp+34h] [rbp-CCh]
int v83; // [rsp+38h] [rbp-C8h]
unsigned int v84; // [rsp+3Ch] [rbp-C4h]
cocos2d::CCArray *v85; // [rsp+48h] [rbp-B8h]
cocos2d::CCArray *v87; // [rsp+58h] [rbp-A8h]
void *v89[2]; // [rsp+80h] [rbp-80h] BYREF
__int128 v90; // [rsp+90h] [rbp-70h]
void *Block[2]; // [rsp+A0h] [rbp-60h] BYREF
__int128 v92; // [rsp+B0h] [rbp-50h]
__int128 v93; // [rsp+C0h] [rbp-40h] BYREF
__int128 v94; // [rsp+D0h] [rbp-30h]
__int128 v95; // [rsp+E0h] [rbp-20h] BYREF
__int128 v96; // [rsp+F0h] [rbp-10h]
__int128 v97; // [rsp+100h] [rbp+0h] BYREF
__int64 v98; // [rsp+110h] [rbp+10h]
__int64 v99; // [rsp+118h] [rbp+18h]
v3 = (const char *)a3;
v5 = a1;
v6 = (_BYTE *)a3;
if ( *(_QWORD *)(a3 + 24) > 0xFu )
v6 = *(_BYTE **)a3;
*(_OWORD *)Block = 0;
v92 = 0u;
v7 = -1;
do
++v7;
while ( v6[v7] );
sub_14003D230(Block, v6, v7);
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(v5 + 1200), Block);
v9 = *((_QWORD *)&v92 + 1);
if ( *((_QWORD *)&v92 + 1) > 0xFu )
{
v10 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v92 + 1) + 1LL) >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v10);
}
v11 = sub_140241F40(v3, v9, v8);
v84 = v11;
*(_OWORD *)Block = 0;
*(_QWORD *)&v92 = 2;
*((_QWORD *)&v92 + 1) = 15;
strcpy((char *)Block, "-1");
v12 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v12 = *a2;
v13 = (unsigned __int64)a2[2];
v14 = v13;
if ( v13 > 2 )
v14 = 2;
v15 = memcmp(v12, Block, v14);
if ( !v15 )
{
if ( v13 >= 2 )
v15 = v13 > 2;
else
v15 = -1;
}
v17 = 15;
if ( v15 )
{
v93 = 0;
v94 = 0u;
v19 = (__int128 *)a2;
if ( (unsigned __int64)a2[3] > 0xF )
v19 = (__int128 *)*a2;
v20 = v13;
v21 = 0x7FFFFFFFFFFFFFFFLL;
if ( v13 > 0x7FFFFFFFFFFFFFFFLL )
sub_140009D90(15);
if ( v13 > 0xF )
{
if ( (v13 | 0xF) <= 0x7FFFFFFFFFFFFFFFLL )
{
v21 = v13 | 0xF;
if ( (v13 | 0xF) < 0x16 )
v21 = 22;
}
v22 = sub_14003D460(v21 + 1);
*(_QWORD *)&v93 = v22;
*(_QWORD *)&v94 = v20;
*((_QWORD *)&v94 + 1) = v21;
memcpy(v22, v19, v20 + 1);
}
else
{
*(_QWORD *)&v94 = v13;
v21 = 15;
*((_QWORD *)&v94 + 1) = 15;
v93 = *v19;
v22 = (_QWORD *)v93;
}
v81 = -1;
v83 = 0;
v82 = 50;
v23 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v23 = (const void **)*a2;
v24 = a2[2];
if ( v24 )
{
v26 = (char *)v23 + (_QWORD)v24;
LOBYTE(v16) = 35;
v27 = sub_140677120(v23, (char *)v23 + (_QWORD)v24, v16);
v17 = v27 - (_QWORD)v23;
v25 = -1;
if ( (char *)v27 != v26 )
v25 = v17;
}
else
{
v25 = -1;
}
if ( v25 != -1 )
{
*(_OWORD *)Block = 0;
v92 = 0u;
v28 = v25;
if ( (unsigned __int64)a2[2] < v25 )
v28 = (size_t)a2[2];
v29 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v29 = *a2;
sub_14003D230(Block, v29, v28);
if ( v21 > 0xF )
{
v34 = (char *)v22;
if ( v21 + 1 >= 0x1000 )
{
v22 = (_QWORD *)*(v22 - 1);
if ( (unsigned __int64)(v34 - (char *)v22 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v22);
}
v93 = *(_OWORD *)Block;
v94 = v92;
v35 = v25 + 1;
*(_OWORD *)v89 = 0;
v90 = 0u;
v36 = a2[2];
if ( (unsigned __int64)v36 < v35 )
sub_14003F4D0(v31, v30, v32, v33);
v37 = (size_t)v36 - v35;
v38 = -1;
if ( v37 != -1 )
v38 = v37;
v39 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v39 = (const void **)*a2;
sub_14003D230(v89, (char *)v39 + v35, v38);
v40 = sub_1400D2840((__int64 *)v89, ":");
if ( *((_QWORD *)&v90 + 1) > 0xFu )
{
v41 = v89[0];
if ( (unsigned __int64)(*((_QWORD *)&v90 + 1) + 1LL) >= 0x1000 )
{
v41 = *((void **)v89[0] - 1);
if ( (unsigned __int64)((char *)v89[0] - (char *)v41 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v41);
}
*(_QWORD *)&v90 = 0;
*((_QWORD *)&v90 + 1) = 15;
LOBYTE(v89[0]) = 0;
if ( cocos2d::CCArray::count(v40) >= 3 )
{
v42 = cocos2d::CCArray::stringAtIndex(v40, 0);
v81 = cocos2d::CCString::intValue(v42);
v43 = cocos2d::CCArray::stringAtIndex(v40, 1u);
v83 = cocos2d::CCString::intValue(v43);
v44 = cocos2d::CCArray::stringAtIndex(v40, 2u);
v82 = cocos2d::CCString::intValue(v44);
}
v21 = *((_QWORD *)&v94 + 1);
v22 = (_QWORD *)v93;
}
v45 = (cocos2d::CCArray *)cocos2d::CCArray::create(v17);
v85 = v45;
if ( (_QWORD)v94 )
{
v46 = &v93;
if ( v21 > 0xF )
v46 = (__int128 *)v22;
v97 = 0;
v98 = 0;
v99 = 0;
v47 = -1;
do
++v47;
while ( *((_BYTE *)v46 + v47) );
sub_14003D230(&v97, v46, v47);
v48 = sub_1400D2840((__int64 *)&v97, (unsigned __int8 *)&word_14070D07C);
v87 = v48;
sub_14003D310((__int64)&v97);
v49 = 0;
if ( cocos2d::CCArray::count(v48) )
{
do
{
v50 = cocos2d::CCArray::stringAtIndex(v48, v49);
CString = cocos2d::CCString::getCString(v50);
*(_OWORD *)Block = 0;
v92 = 0u;
v52 = -1;
do
++v52;
while ( CString[v52] );
sub_14003D230(Block, CString, v52);
v53 = sub_1400D2840((__int64 *)Block, ":");
if ( *((_QWORD *)&v92 + 1) > 0xFu )
{
v54 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v92 + 1) + 1LL) >= 0x1000 )
{
v54 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v54 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v54);
}
*(_QWORD *)&v92 = 0;
*((_QWORD *)&v92 + 1) = 15;
LOBYTE(Block[0]) = 0;
if ( cocos2d::CCArray::count(v53) >= 7 )
{
v55 = (char *)operator new(0xF0u);
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v55);
*(_QWORD *)v55 = &AdminLogEntry::`vftable';
*(_OWORD *)(v55 + 56) = 0;
*((_QWORD *)v55 + 9) = 0;
*((_QWORD *)v55 + 10) = 15;
v55[56] = 0;
*(_OWORD *)(v55 + 88) = 0;
*((_QWORD *)v55 + 13) = 0;
*((_QWORD *)v55 + 14) = 15;
v55[88] = 0;
*((_QWORD *)v55 + 15) = 0;
*((_DWORD *)v55 + 32) = 0;
*(_OWORD *)(v55 + 136) = 0;
*((_QWORD *)v55 + 19) = 0;
*((_QWORD *)v55 + 20) = 15;
v55[136] = 0;
*(_OWORD *)(v55 + 168) = 0;
*((_QWORD *)v55 + 23) = 0;
*((_QWORD *)v55 + 24) = 15;
v55[168] = 0;
*(_OWORD *)(v55 + 200) = 0;
*((_QWORD *)v55 + 27) = 0;
*((_QWORD *)v55 + 28) = 15;
v55[200] = 0;
*((_QWORD *)v55 + 29) = 0;
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v55);
v56 = cocos2d::CCArray::stringAtIndex(v53, 0);
v57 = (char *)cocos2d::CCString::getCString(v56);
v58 = -1;
do
++v58;
while ( v57[v58] );
sub_1400405A0((void **)v55 + 7, v57, v58);
v59 = cocos2d::CCArray::stringAtIndex(v53, 1u);
v60 = (char *)cocos2d::CCString::getCString(v59);
v61 = -1;
do
++v61;
while ( v60[v61] );
sub_1400405A0((void **)v55 + 11, v60, v61);
v62 = cocos2d::CCArray::stringAtIndex(v53, 2u);
*((_DWORD *)v55 + 30) = cocos2d::CCString::intValue(v62);
v63 = cocos2d::CCArray::stringAtIndex(v53, 3u);
*((_DWORD *)v55 + 31) = cocos2d::CCString::intValue(v63);
v64 = cocos2d::CCArray::stringAtIndex(v53, 4u);
v65 = cocos2d::CCString::getCString(v64);
*(_OWORD *)v89 = 0;
v90 = 0u;
v66 = -1;
do
++v66;
while ( v65[v66] );
sub_14003D230(v89, v65, v66);
if ( (_QWORD)v90 )
{
cocos2d::ZipUtils::base64URLDecode(&v95, v89);
}
else
{
v95 = *(_OWORD *)v89;
v96 = v90;
*(_QWORD *)&v90 = 0;
*((_QWORD *)&v90 + 1) = 15;
LOBYTE(v89[0]) = 0;
}
sub_14003D310((__int64)v89);
sub_140059C40((__int64)(v55 + 136), (__int64)&v95);
if ( *((_QWORD *)&v96 + 1) > 0xFu )
{
v67 = (void *)v95;
if ( (unsigned __int64)(*((_QWORD *)&v96 + 1) + 1LL) >= 0x1000 )
{
v67 = *(void **)(v95 - 8);
if ( (unsigned __int64)(v95 - (_QWORD)v67 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v67);
}
v68 = cocos2d::CCArray::stringAtIndex(v53, 5u);
v69 = cocos2d::CCString::getCString(v68);
*(_OWORD *)v89 = 0;
v90 = 0u;
v70 = -1;
do
++v70;
while ( v69[v70] );
sub_14003D230(v89, v69, v70);
if ( (_QWORD)v90 )
{
cocos2d::ZipUtils::base64URLDecode(&v95, v89);
}
else
{
v95 = *(_OWORD *)v89;
v96 = v90;
*(_QWORD *)&v90 = 0;
*((_QWORD *)&v90 + 1) = 15;
LOBYTE(v89[0]) = 0;
}
sub_14003D310((__int64)v89);
sub_140059C40((__int64)(v55 + 200), (__int64)&v95);
if ( *((_QWORD *)&v96 + 1) > 0xFu )
{
v71 = (void *)v95;
if ( (unsigned __int64)(*((_QWORD *)&v96 + 1) + 1LL) >= 0x1000 )
{
v71 = *(void **)(v95 - 8);
if ( (unsigned __int64)(v95 - (_QWORD)v71 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v71);
}
v72 = cocos2d::CCArray::stringAtIndex(v53, 6u);
v73 = cocos2d::CCString::getCString(v72);
*((_QWORD *)v55 + 29) = atoll(v73);
if ( cocos2d::CCArray::count(v53) >= 8 )
{
v74 = cocos2d::CCArray::stringAtIndex(v53, 7u);
*((_DWORD *)v55 + 32) = cocos2d::CCString::intValue(v74);
}
if ( cocos2d::CCArray::count(v53) >= 9 )
{
v75 = cocos2d::CCArray::stringAtIndex(v53, 8u);
v76 = cocos2d::CCString::getCString(v75);
*(_OWORD *)v89 = 0;
v90 = 0u;
v77 = -1;
do
++v77;
while ( v76[v77] );
sub_14003D230(v89, v76, v77);
if ( (_QWORD)v90 )
{
cocos2d::ZipUtils::base64URLDecode(&v95, v89);
}
else
{
v95 = *(_OWORD *)v89;
v96 = v90;
*(_QWORD *)&v90 = 0;
*((_QWORD *)&v90 + 1) = 15;
LOBYTE(v89[0]) = 0;
}
sub_14003D310((__int64)v89);
sub_140059C40((__int64)(v55 + 168), (__int64)&v95);
if ( *((_QWORD *)&v96 + 1) > 0xFu )
{
v78 = (void *)v95;
if ( (unsigned __int64)(*((_QWORD *)&v96 + 1) + 1LL) >= 0x1000 )
{
v78 = *(void **)(v95 - 8);
if ( (unsigned __int64)(v95 - (_QWORD)v78 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v78);
}
}
cocos2d::CCArray::addObject(v85, (struct cocos2d::CCObject *)v55);
}
++v49;
v48 = v87;
}
while ( v49 < cocos2d::CCArray::count(v87) );
v3 = (const char *)a3;
}
v5 = a1;
v45 = v85;
}
v79 = v81;
if ( v81 < 0 )
v79 = cocos2d::CCArray::count(v45);
v80 = *(_QWORD *)(v5 + 1384);
if ( v80 )
(*(void (__fastcall **)(__int64, _QWORD, cocos2d::CCArray *, _QWORD, int, int))(*(_QWORD *)v80 + 240LL))(
v80,
v84,
v45,
v79,
v83,
v82);
sub_14003D310((__int64)&v93);
}
else
{
v18 = *(_QWORD *)(v5 + 1384);
if ( v18 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v18 + 248LL))(v18, v11);
}
sub_14003D310((__int64)a2);
sub_14003D310((__int64)v3);
}