//
// GJAccountManager::syncAccount from 0x98b26c to 0x98b4d4 (616 bytes)
//
// 2 xrefs:
// > GJAccountManager::onGetAccountSyncURLCompleted @ 0x98b600
// > ??> @ 0x1035d0
//
// 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:57:56 +0000
//
__int64 __fastcall GJAccountManager::syncAccount(GJAccountManager *a1, char *a2)
{
_BOOL4 isDLActive; // w1
__int64 result; // x0
GameLevelManager *v6; // x0
cocos2d::CCString *v7; // x0
const char *CString; // x0
cocos2d::CCString *v9; // x0
size_t v10; // x0
char v11; // w0
__int64 v12; // x0
__int64 v13; // x1
const char *v14; // x1
size_t v15; // x0
char *v16; // [xsp+48h] [xbp+48h]
char *v17; // [xsp+48h] [xbp+48h]
__int64 v18[2]; // [xsp+58h] [xbp+58h] BYREF
void *v19; // [xsp+68h] [xbp+68h]
__int64 v20; // [xsp+70h] [xbp+70h] BYREF
__int64 v21; // [xsp+78h] [xbp+78h]
void *v22; // [xsp+80h] [xbp+80h]
__int64 v23[2]; // [xsp+88h] [xbp+88h] BYREF
void *v24; // [xsp+98h] [xbp+98h]
__int64 v25[2]; // [xsp+A0h] [xbp+A0h] BYREF
void *v26; // [xsp+B0h] [xbp+B0h]
isDLActive = GJAccountManager::isDLActive(a1, "sync_account");
result = 0;
if ( !isDLActive )
{
v6 = (GameLevelManager *)GJAccountManager::addDLToActive(a1, "sync_account");
GameLevelManager::sharedState(v6);
GameLevelManager::getBasePostString(v18);
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfv",
"3899",
103,
99,
"9");
CString = (const char *)cocos2d::CCString::getCString(v7);
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"&secret=%s", CString);
v16 = (char *)cocos2d::CCString::getCString(v9);
v10 = strlen(v16);
std::string::append((__int64)v18, v16, v10);
v11 = *a2;
v20 = 0;
v21 = 0;
v22 = nullptr;
if ( (v11 & 1) != 0 )
{
std::string::__init(&v20, *((void **)a2 + 2), *((_QWORD *)a2 + 1));
}
else
{
v12 = *(_QWORD *)a2;
v13 = *((_QWORD *)a2 + 1);
v22 = *((void **)a2 + 2);
v20 = v12;
v21 = v13;
}
v14 = (char *)v18 + 1;
if ( (v18[0] & 1) != 0 )
v14 = (const char *)v19;
v17 = (char *)v14;
v23[0] = 0;
v23[1] = 0;
v24 = nullptr;
v15 = strlen(v14);
std::string::__init(v23, v17, v15);
v25[0] = 0;
v25[1] = 0;
v26 = nullptr;
std::string::__init(v25, "SyncAccount", 0xBu);
GJAccountManager::ProcessHttpRequest(a1, (__int64)&v20, (__int64)v23, (__int64)v25, 23);
if ( (v25[0] & 1) != 0 )
operator delete(v26);
if ( (v23[0] & 1) != 0 )
operator delete(v24);
if ( (v20 & 1) != 0 )
operator delete(v22);
if ( (v18[0] & 1) != 0 )
operator delete(v19);
return 1;
}
return result;
}