//
// GameLevelManager::uploadFriendRequest from 0x8408c8 to 0x840cb0 (1000 bytes)
//
// 2 xrefs:
// > ShareCommentLayer::onShare @ 0x90e564
// > ??> @ 0x63da8
//
// This function is hookable on this platform (idp: arm, 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:55:17 +0000
//
__int64 __fastcall GameLevelManager::uploadFriendRequest(GameLevelManager *a1, unsigned int a2, char *a3)
{
char v6; // w0
__int64 v7; // x0
__int64 v8; // x1
__int64 v9; // x2
__int64 v10; // x3
char v11; // w0
cocos2d::CCString *v12; // x0
const char *CString; // x0
char *v14; // x23
size_t v15; // x0
__int64 v16; // x26
__int64 v17; // x26
__int64 result; // x0
__int64 v19; // x27
cocos2d::CCObject *v20; // x26
size_t v21; // x0
__int64 v22; // x27
cocos2d::CCString *v23; // x0
__int64 v24; // x0
cocos2d::CCString *v25; // x0
size_t v26; // x0
const char *v27; // x1
size_t v28; // x0
size_t v29; // x0
char *v30; // [xsp+68h] [xbp+68h]
char *v31; // [xsp+68h] [xbp+68h]
__int64 v32[2]; // [xsp+78h] [xbp+78h] BYREF
void *v33; // [xsp+88h] [xbp+88h]
__int64 v34[2]; // [xsp+90h] [xbp+90h] BYREF
void *v35; // [xsp+A0h] [xbp+A0h]
__int64 v36; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v37; // [xsp+B0h] [xbp+B0h]
void *v38; // [xsp+B8h] [xbp+B8h]
__int64 v39; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v40; // [xsp+C8h] [xbp+C8h]
void *v41; // [xsp+D0h] [xbp+D0h]
v36 = 0;
v37 = 0;
v6 = *a3;
v38 = nullptr;
if ( (v6 & 1) != 0 )
{
std::string::__init(&v36, *((void **)a3 + 2), *((_QWORD *)a3 + 1));
}
else
{
v7 = *(_QWORD *)a3;
v8 = *((_QWORD *)a3 + 1);
v38 = *((void **)a3 + 2);
v36 = v7;
v37 = v8;
}
LevelTools::base64EncodeString((__int64)&v36, &v39);
if ( (*a3 & 1) != 0 )
{
**((_BYTE **)a3 + 2) = 0;
*((_QWORD *)a3 + 1) = 0;
}
else
{
a3[1] = 0;
*a3 = 0;
}
std::string::reserve((__int64 *)a3, 0);
v9 = v39;
v10 = v40;
v11 = v36;
*((_QWORD *)a3 + 2) = v41;
*(_QWORD *)a3 = v9;
*((_QWORD *)a3 + 1) = v10;
if ( (v11 & 1) != 0 )
operator delete(v38);
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"friendReq_%i", (const char *)a2);
CString = (const char *)cocos2d::CCString::getCString(v12);
v39 = 0;
v14 = (char *)CString;
v40 = 0;
v41 = nullptr;
v15 = strlen(CString);
v16 = *((_QWORD *)a1 + 136);
std::string::__init(&v39, v14, v15);
v17 = cocos2d::CCDictionary::objectForKey(v16, &v39);
if ( (v39 & 1) != 0 )
{
operator delete(v41);
result = 0;
if ( v17 )
return result;
}
else
{
result = 0;
if ( v17 )
return result;
}
v19 = *((_QWORD *)a1 + 136);
v20 = (cocos2d::CCObject *)cocos2d::CCNode::create(nullptr);
v39 = 0;
v40 = 0;
v41 = nullptr;
v21 = strlen(v14);
std::string::__init(&v39, v14, v21);
cocos2d::CCDictionary::setObject(v19, v20);
if ( (v39 & 1) != 0 )
operator delete(v41);
GameLevelManager::makeTimeStamp(a1, v14);
GameLevelManager::getBasePostString(v32);
v22 = (__int64)(a3 + 1);
if ( (*a3 & 1) != 0 )
v22 = *((_QWORD *)a3 + 2);
v23 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
v24 = cocos2d::CCString::getCString(v23);
v25 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&toAccountID=%i&comment=%s&secret=%s",
(const char *)a2,
v22,
v24);
v30 = (char *)cocos2d::CCString::getCString(v25);
v26 = strlen(v30);
std::string::append((__int64)v32, v30, v26);
v34[0] = 0;
v34[1] = 0;
v35 = nullptr;
std::string::__init(v34, "https://www.boomlings.com/database/uploadFriendRequest20.php", 0x3Cu);
v27 = (char *)v32 + 1;
if ( (v32[0] & 1) != 0 )
v27 = (const char *)v33;
v31 = (char *)v27;
v36 = 0;
v37 = 0;
v38 = nullptr;
v28 = strlen(v27);
std::string::__init(&v36, v31, v28);
v39 = 0;
v40 = 0;
v41 = nullptr;
v29 = strlen(v14);
std::string::__init(&v39, v14, v29);
GameLevelManager::ProcessHttpRequest(a1, v34, (__int64)&v36, (char *)&v39, 35);
if ( (v39 & 1) != 0 )
operator delete(v41);
if ( (v36 & 1) != 0 )
operator delete(v38);
if ( (v34[0] & 1) != 0 )
operator delete(v35);
if ( (v32[0] & 1) != 0 )
operator delete(v33);
return 1;
}