//
// GameLevelManager::requestUserAccess from 0x100557f40 to 0x1005581c8 (648 bytes)
//
// 1 xrefs:
// > SupportLayer::onRequestAccess @ 0x10039a637
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool __fastcall GameLevelManager::requestUserAccess(GameLevelManager *a1)
{
__m128 v1; // xmm0
cocos2d::CCDictionary *m_friendReqAndUserBlocks; // rdi
__int64 v4; // r13
cocos2d::CCDictionary *v5; // rbx
cocos2d::CCNode *v6; // rax
cocos2d::CCString *v7; // rax
cocos2d::CCString *v8; // rax
const char *CString; // rax
const char *data; // r15
size_t v11; // rax
size_t v12; // r12
char *v13; // r13
size_t v14; // rbx
char v16; // [rsp+0h] [rbp-A0h]
std::string v17; // [rsp+18h] [rbp-88h] BYREF
char v18; // [rsp+30h] [rbp-70h] BYREF
char v19[15]; // [rsp+31h] [rbp-6Fh] BYREF
void *__p; // [rsp+40h] [rbp-60h]
_QWORD __dst[2]; // [rsp+48h] [rbp-58h] BYREF
void *v22; // [rsp+58h] [rbp-48h]
std::string v23; // [rsp+60h] [rbp-40h] BYREF
m_friendReqAndUserBlocks = a1->m_friendReqAndUserBlocks;
v23.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)12;
strcpy(v23.__r_.__value_.__s.__data_, "req_ua");
v4 = cocos2d::CCDictionary::objectForKey_1((__int64)m_friendReqAndUserBlocks, (char *)&v23);
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v23.__r_.__value_.__l.__data_);
if ( v4 )
return v4 == 0;
v5 = a1->m_friendReqAndUserBlocks;
v6 = cocos2d::CCNode::create();
v23.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)12;
strcpy(v23.__r_.__value_.__s.__data_, "req_ua");
cocos2d::CCDictionary::setObject_1((__int64)v5, v6, (char *)&v23);
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v23.__r_.__value_.__l.__data_);
GameLevelManager::getBasePostString(&v23, v1);
v7 = (cocos2d::CCString *)sub_1007AB580("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v7);
v8 = (cocos2d::CCString *)sub_1007AB580("&secret=%s", v16);
CString = cocos2d::CCString::getCString(v8);
std::string::append(&v23, CString);
v17.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v17.__r_.__value_.__r.__words[0] = 65;
v17.__r_.__value_.__l.__size_ = 56;
strcpy(v17.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/requestUserAccess.php");
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 )
data = v23.__r_.__value_.__l.__data_;
else
data = v23.__r_.__value_.__s.__data_;
v11 = strlen(data);
if ( v11 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(2.057594829120962e-81);
v12 = v11;
if ( v11 >= 0x17 )
{
v14 = 26;
if ( (v11 | 7) != 0x17 )
v14 = (v11 | 7) + 1;
v13 = (char *)operator new(v14);
v22 = v13;
__dst[0] = v14 | 1;
__dst[1] = v12;
goto LABEL_16;
}
LOBYTE(__dst[0]) = 2 * v11;
v13 = (char *)__dst + 1;
if ( v11 )
LABEL_16:
memmove(v13, data, v12);
v13[v12] = 0;
v18 = 12;
strcpy(v19, "req_ua");
GameLevelManager::ProcessHttpRequest(a1, &v17, (__int64)__dst, (__int64)&v18, 43);
v4 = 0;
if ( (v18 & 1) != 0 )
{
operator delete(__p);
if ( (__dst[0] & 1) == 0 )
{
LABEL_19:
if ( (*(_BYTE *)&v17.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_20;
LABEL_25:
operator delete(v17.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) == 0 )
return v4 == 0;
goto LABEL_21;
}
}
else if ( (__dst[0] & 1) == 0 )
{
goto LABEL_19;
}
operator delete(v22);
if ( (*(_BYTE *)&v17.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_25;
LABEL_20:
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 )
LABEL_21:
operator delete(v23.__r_.__value_.__l.__data_);
return v4 == 0;
}