//
// GameLevelManager::readFriendRequests from 0x4b9f78 to 0x4ba13a (450 bytes)
//
// 2 xrefs:
// > GameLevelManager::readFriendRequest @ 0x4ba19c
// > FRequestProfilePage::onMarkRead @ 0x5f30ea
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:50:14 +0000
//
cocos2d::CCNode *__fastcall GameLevelManager::readFriendRequests(GameManager *a1, unsigned __int8 *a2)
{
unsigned int v4; // r3
cocos2d::CCNode *result; // r0
const char *v6; // r0
const char *v7; // r0
cocos2d::CCString *v8; // r0
const char *CString; // r0
int v10; // r8
const char *v11; // r7
size_t v12; // r0
int v13; // r8
int v14; // r11
cocos2d::CCObject *v15; // r0
cocos2d::CCObject *v16; // r9
size_t v17; // r0
const char *v18; // r5
cocos2d::CCString *v19; // r0
int v20; // r0
cocos2d::CCString *v21; // r0
char *v22; // r0
const char *v23; // r1
size_t v24; // r0
size_t v25; // r0
const char *v26; // [sp+14h] [bp-40h]
char *v27[3]; // [sp+1Ch] [bp-38h] BYREF
int v28[3]; // [sp+28h] [bp-2Ch] BYREF
int v29[3]; // [sp+34h] [bp-20h] BYREF
int v30; // [sp+40h] [bp-14h] BYREF
int v31; // [sp+44h] [bp-10h]
int v32; // [sp+48h] [bp-Ch]
v4 = *a2;
result = (cocos2d::CCNode *)(v4 << 31);
if ( (v4 & 1) != 0 )
{
if ( !*((_DWORD *)a2 + 1) )
return result;
v6 = *((const char **)a2 + 2);
}
else
{
if ( !(v4 >> 1) )
return result;
v6 = (const char *)(a2 + 1);
}
v7 = (const char *)atoi(v6);
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"readFriendReq_%i", v7);
CString = (const char *)cocos2d::CCString::getCString(v8);
v30 = 0;
v31 = 0;
v32 = 0;
v10 = *((_DWORD *)a1 + 187);
v11 = CString;
v12 = strlen(CString);
std::string::__init(&v30, v11, v12);
v13 = cocos2d::CCDictionary::objectForKey(v10, &v30);
result = (cocos2d::CCNode *)std::string::~string((int)&v30);
if ( !v13 )
{
v14 = *((_DWORD *)a1 + 187);
v15 = (cocos2d::CCObject *)cocos2d::CCNode::create(result);
v30 = 0;
v31 = 0;
v32 = 0;
v16 = v15;
v17 = strlen(v11);
std::string::__init(&v30, v11, v17);
cocos2d::CCDictionary::setObject(v14, v16);
std::string::~string((int)&v30);
GameLevelManager::getBasePostString((GameLevelManager *)v27);
if ( (*a2 & 1) != 0 )
v18 = *((const char **)a2 + 2);
else
v18 = (const char *)(a2 + 1);
v19 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&a1i2r3e45s789g[9]);
v20 = cocos2d::CCString::getCString(v19);
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&requestID=%s&secret=%s",
v18,
v20);
v22 = (char *)cocos2d::CCString::getCString(v21);
std::string::append(v27, v22);
memset(v28, 0, sizeof(v28));
std::string::__init(v28, "https://www.boomlings.com/database/readGJFriendRequest20.php", 0x3Cu);
v29[0] = 0;
v29[1] = 0;
if ( ((int)v27[0] & 1) == 0 )
v23 = (char *)v27 + 1;
v29[2] = 0;
if ( ((int)v27[0] & 1) != 0 )
v23 = v27[2];
v26 = v23;
v24 = strlen(v23);
std::string::__init(v29, v26, v24);
v30 = 0;
v31 = 0;
v32 = 0;
v25 = strlen(v11);
std::string::__init(&v30, v11, v25);
GameLevelManager::ProcessHttpRequest(a1, v28, (int)v29, (int)&v30, 38);
std::string::~string((int)&v30);
std::string::~string((int)v29);
std::string::~string((int)v28);
return (cocos2d::CCNode *)std::string::~string((int)v27);
}
return result;
}