//
// GJAccountManager::updateAccountSettings from 0x849b98 to 0x849fc4 (1068 bytes)
//
// 2 xrefs:
// > UpdateAccountSettingsPopup::init @ 0x8ca524
// > ??> @ 0x4a868
//
// 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
//
__int64 __fastcall GJAccountManager::updateAccountSettings(
GJAccountManager *a1,
unsigned int a2,
unsigned int a3,
unsigned int a4,
__int64 *a5,
__int64 *a6,
__int64 *a7,
__int64 *a8,
__int64 *a9,
__int64 *a10,
__int64 *a11)
{
_BOOL4 isDLActive; // w1
__int64 result; // x0
GJAccountManager *v19; // x0
unsigned int v20; // w22
double v21; // d0
__int64 v22; // x28
__int64 v23; // x27
__int64 v24; // x26
cocos2d::CCString *v25; // x0
const char *CString; // x0
cocos2d::CCString *v27; // x23
char *v28; // x0
char *v29; // x0
char *v30; // x0
char *v31; // x0
char *v32; // x21
unsigned int *v33; // x20
int v34; // w0
unsigned int *v35; // x1
int v36; // w2
unsigned int *v37; // x1
int v38; // w2
unsigned int *v39; // x1
int v40; // w2
__int64 *v41; // [xsp+90h] [xbp+60h]
__int64 v42; // [xsp+90h] [xbp+60h]
__int64 v43; // [xsp+98h] [xbp+68h]
__int64 v44; // [xsp+A0h] [xbp+70h]
__int64 v45; // [xsp+A8h] [xbp+78h]
const char *v48; // [xsp+B8h] [xbp+88h]
const char *v49; // [xsp+E0h] [xbp+B0h] BYREF
const char *v50; // [xsp+E8h] [xbp+B8h] BYREF
const char *v51; // [xsp+F0h] [xbp+C0h] BYREF
isDLActive = GJAccountManager::isDLActive(a1, "acc_sett");
result = 0;
if ( !isDLActive )
{
v41 = a8;
GJAccountManager::addDLToActive(a1, "acc_sett");
v19 = GJAccountManager::sharedState();
v20 = v19->m_accountID - v19->m_unkInt1;
GJAccountManager::sharedState();
*(_QWORD *)&v21 = sub_D18D28(&v51).n128_u64[0];
v22 = *a5;
v48 = v51;
v23 = *a6;
v24 = *a7;
v42 = *v41;
v45 = *a9;
v44 = *a10;
v43 = *a11;
v25 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfv",
"3899",
103,
99,
"9",
v21);
CString = cocos2d::CCString::getCString(v25);
v27 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"accountID=%i&gjp2=%s&mS=%i&frS=%i&cS=%i&yt=%s&twitter=%s&twitch=%s"
"&instagram=%s&tiktok=%s&discord=%s&custom=%s&secret=%s",
(const char *)v20,
v48,
a2,
a3,
a4,
v22,
v23,
v24,
v42,
v45,
v44,
v43,
CString);
v28 = (char *)(v51 - 24);
if ( v51 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v35 = (unsigned int *)(v51 - 8);
do
v36 = __ldaxr(v35);
while ( __stlxr(v36 - 1, v35) );
}
else
{
v36 = *((_DWORD *)v51 - 2);
*((_DWORD *)v51 - 2) = v36 - 1;
}
if ( v36 <= 0 )
operator delete(v28);
}
sub_D153B8((int)&v49, "https://www.boomlings.com/database/updateGJAccSettings20.php");
v29 = (char *)cocos2d::CCString::getCString(v27);
sub_D153B8((int)&v50, v29);
sub_D153B8((int)&v51, "acc_sett");
GJAccountManager::ProcessHttpRequest(a1, &v49, &v50, &v51, 26);
v30 = (char *)(v51 - 24);
if ( v51 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v37 = (unsigned int *)(v51 - 8);
do
v38 = __ldaxr(v37);
while ( __stlxr(v38 - 1, v37) );
}
else
{
v38 = *((_DWORD *)v51 - 2);
*((_DWORD *)v51 - 2) = v38 - 1;
}
if ( v38 <= 0 )
operator delete(v30);
}
v31 = (char *)(v50 - 24);
if ( v50 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v39 = (unsigned int *)(v50 - 8);
do
v40 = __ldaxr(v39);
while ( __stlxr(v40 - 1, v39) );
}
else
{
v40 = *((_DWORD *)v50 - 2);
*((_DWORD *)v50 - 2) = v40 - 1;
}
if ( v40 <= 0 )
operator delete(v31);
}
v32 = (char *)(v49 - 24);
if ( v49 - 24 == (const char *)&qword_124B6B0 )
return 1;
if ( &pthread_create )
{
v33 = (unsigned int *)(v49 - 8);
do
v34 = __ldaxr(v33);
while ( __stlxr(v34 - 1, v33) );
}
else
{
v34 = *((_DWORD *)v49 - 2);
*((_DWORD *)v49 - 2) = v34 - 1;
}
if ( v34 > 0 )
{
return 1;
}
else
{
operator delete(v32);
return 1;
}
}
return result;
}