//
// GameLevelManager::onRequestUserAccessCompleted from 0x10052bb00 to 0x10052bc8e (398 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x10051f07c
//
// 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:31:48 +0000
//
__int64 __fastcall GameLevelManager::onRequestUserAccessCompleted(__int64 a1, const std::string *a2)
{
__int64 v3; // rdi
std::string::pointer data; // r13
unsigned __int64 size; // rax
char v6; // r15
std::string::pointer v7; // rdi
size_t v8; // rdx
__int64 v9; // rdi
const char *v10; // rdi
int v11; // r15d
int v12; // r12d
std::string::size_type v13; // rax
__int64 result; // rax
_DWORD *v15; // r14
float v16; // xmm0_4
__int64 (__fastcall ***v17)(_QWORD, _QWORD, __int64); // rdi
char v18; // [rsp+0h] [rbp-40h] BYREF
_DWORD __s2[3]; // [rsp+1h] [rbp-3Fh] BYREF
void *__p; // [rsp+10h] [rbp-30h]
v3 = *(_QWORD *)(a1 + 1088);
v18 = 12;
strcpy((char *)__s2, "req_ua");
cocos2d::CCDictionary::removeObjectForKey(v3, &v18);
if ( (v18 & 1) != 0 )
operator delete(__p);
v18 = 4;
strcpy((char *)__s2, "-1");
data = a2->__r_.__value_.__s.__data_;
size = *(_BYTE *)&a2->__r_.__value_.__l.0 >> 1;
v6 = *(_BYTE *)&a2->__r_.__value_.__s.0 & 1;
v7 = a2->__r_.__value_.__l.__data_;
if ( v6 )
size = a2->__r_.__value_.__l.__size_;
else
v7 = a2->__r_.__value_.__s.__data_;
v8 = 2;
if ( size < 2 )
v8 = size;
if ( !((size != 2) | (memcmp(v7, __s2, v8) != 0)) )
{
v9 = *(_QWORD *)(a1 + 1360);
if ( v9 )
{
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v9 + 8LL))(v9, 0, 49);
v6 = *(_BYTE *)&a2->__r_.__value_.__s.0 & 1;
}
}
v10 = a2->__r_.__value_.__s.__data_;
if ( v6 )
v10 = a2->__r_.__value_.__l.__data_;
v11 = atoi(v10);
v12 = 0;
v13 = std::string::find(a2, 44, 0);
if ( v13 != -1 )
{
if ( (*(_BYTE *)&a2->__r_.__value_.__s.0 & 1) != 0 )
data = a2->__r_.__value_.__l.__data_;
v12 = atoi(&data[v13 + 1]);
}
if ( v11 == 99 )
{
*(_BYTE *)(GameManager::sharedState() + 1044) = 1;
}
else
{
result = (unsigned int)(v11 - 1);
if ( (unsigned int)result > 1 )
return result;
v15 = (_DWORD *)GameManager::sharedState();
v15[260] = v11;
v16 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
v15[259] = (int)v16;
v15[258] = (int)v16 + v11;
}
result = GameManager::sharedState();
*(_DWORD *)(result + 1048) = v12;
v17 = *(__int64 (__fastcall ****)(_QWORD, _QWORD, __int64))(a1 + 1360);
if ( v17 )
return (**v17)(v17, 0, 49);
return result;
}