//
// GameLevelManager::uploadFriendRequest from 0x4cd408 to 0x4cd620 (536 bytes)
//
// 1 xrefs:
// > ShareCommentLayer::onShare @ 0x54102c
//
// 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:41 +0000
//
int __fastcall GameLevelManager::uploadFriendRequest(GameLevelManager *a1, const char *a2, int a3)
{
int v6; // r0
int v7; // r1
int v8; // r2
cocos2d::CCString *v9; // r0
const char *CString; // r0
cocos2d::CCObject *v11; // r3
const char *v12; // r8
size_t v13; // r0
int v14; // r9
cocos2d::CCNode *v15; // r0
cocos2d::CCObject *v16; // r0
size_t v17; // r0
float v18; // r2
int v19; // r3
int v20; // r5
cocos2d::CCString *v21; // r0
int v22; // r0
cocos2d::CCString *v23; // r0
char *v24; // r0
const char *v25; // r1
size_t v26; // r0
size_t v27; // r0
cocos2d::CCObject *v29; // [sp+10h] [bp-44h]
cocos2d::CCObject *v30; // [sp+10h] [bp-44h]
cocos2d::CCObject *v31; // [sp+10h] [bp-44h]
int v32; // [sp+14h] [bp-40h]
char *v33[3]; // [sp+1Ch] [bp-38h] BYREF
int v34[3]; // [sp+28h] [bp-2Ch] BYREF
int v35[3]; // [sp+34h] [bp-20h] BYREF
int v36; // [sp+40h] [bp-14h] BYREF
int v37; // [sp+44h] [bp-10h]
int v38; // [sp+48h] [bp-Ch]
std::string::basic_string(v35, a3);
LevelTools::base64EncodeString(&v36, v35);
if ( (*(_BYTE *)a3 & 1) != 0 )
{
**(_BYTE **)(a3 + 8) = 0;
*(_DWORD *)(a3 + 4) = 0;
}
else
{
*(_BYTE *)(a3 + 1) = 0;
*(_BYTE *)a3 = 0;
}
std::string::reserve((int *)a3, 0);
v6 = v36;
v7 = v37;
v8 = v38;
v36 = 0;
v37 = 0;
v38 = 0;
*(_DWORD *)a3 = v6;
*(_DWORD *)(a3 + 4) = v7;
*(_DWORD *)(a3 + 8) = v8;
std::string::~string((int)&v36);
std::string::~string((int)v35);
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"friendReq_%i", a2);
CString = (const char *)cocos2d::CCString::getCString(v9);
v11 = *((cocos2d::CCObject **)a1 + 187);
v36 = 0;
v37 = 0;
v29 = v11;
v38 = 0;
v12 = CString;
v13 = strlen(CString);
std::string::__init(&v36, v12, v13);
v14 = cocos2d::CCDictionary::objectForKey(v29, &v36);
v15 = (cocos2d::CCNode *)std::string::~string((int)&v36);
if ( v14 )
return 0;
v32 = *((_DWORD *)a1 + 187);
v16 = (cocos2d::CCObject *)cocos2d::CCNode::create(v15);
v36 = 0;
v37 = 0;
v38 = 0;
v30 = v16;
v17 = strlen(v12);
std::string::__init(&v36, v12, v17);
cocos2d::CCDictionary::setObject(v32, v30);
std::string::~string((int)&v36);
GameLevelManager::makeTimeStamp(a1, v12, v18, v19);
GameLevelManager::getBasePostString((GameLevelManager *)v33);
if ( (*(_BYTE *)a3 & 1) != 0 )
v20 = *(_DWORD *)(a3 + 8);
else
v20 = a3 + 1;
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&a1i2r3e45s789g[9]);
v22 = cocos2d::CCString::getCString(v21);
v23 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&toAccountID=%i&comment=%s&secret=%s",
a2,
v20,
v22);
v24 = (char *)cocos2d::CCString::getCString(v23);
std::string::append(v33, v24);
memset(v34, 0, sizeof(v34));
std::string::__init(v34, "https://www.boomlings.com/database/uploadFriendRequest20.php", 0x3Cu);
v35[0] = 0;
v35[1] = 0;
if ( ((int)v33[0] & 1) == 0 )
v25 = (char *)v33 + 1;
v35[2] = 0;
if ( ((int)v33[0] & 1) != 0 )
v25 = v33[2];
v31 = (cocos2d::CCObject *)v25;
v26 = strlen(v25);
std::string::__init(v35, v31, v26);
v36 = 0;
v37 = 0;
v38 = 0;
v27 = strlen(v12);
std::string::__init(&v36, v12, v27);
GameLevelManager::ProcessHttpRequest(a1, v34, (int)v35, (int)&v36, 35);
std::string::~string((int)&v36);
std::string::~string((int)v35);
std::string::~string((int)v34);
std::string::~string((int)v33);
return 1;
}