//
// GJAccountManager::syncAccount from 0x140308550 to 0x1403087d7 (647 bytes)
//
// 2 xrefs:
// > GJAccountManager::onGetAccountSyncURLCompleted @ 0x14030849c
// > ??> @ 0x14091e5e4
//
// This function is hookable on this platform (idp: pc, 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 11:30:10 +0000
//
// Hidden C++ exception states: #wind=6
char __fastcall GJAccountManager::syncAccount(cocos2d::CCObject *a1, __int64 a2)
{
__int64 v4; // rbx
void *v5; // r8
__int64 v7; // rcx
cocos2d::CCString *v8; // rax
const char *CString; // rax
cocos2d::CCString *v10; // rax
char *v11; // rax
size_t v12; // rbx
size_t v13; // r8
_QWORD *v14; // rdx
const char *v15; // rax
void *v16; // [rsp+40h] [rbp-69h]
__int128 v17; // [rsp+48h] [rbp-61h] BYREF
__int64 v18; // [rsp+58h] [rbp-51h]
__int64 v19; // [rsp+60h] [rbp-49h]
__int128 *v20; // [rsp+68h] [rbp-41h]
_BYTE v21[32]; // [rsp+78h] [rbp-31h] BYREF
__int64 v22; // [rsp+98h] [rbp-11h]
void *Block[2]; // [rsp+A0h] [rbp-9h] BYREF
__int64 v24; // [rsp+B0h] [rbp+7h]
unsigned __int64 v25; // [rsp+B8h] [rbp+Fh]
_QWORD Src[4]; // [rsp+C0h] [rbp+17h] BYREF
v22 = a2;
*(_OWORD *)Block = 0;
v24 = 0;
v25 = 0;
sub_14003D230(Block, "sync_account", 0xCu);
v4 = cocos2d::CCDictionary::objectForKey(*((_QWORD *)a1 + 40), Block);
if ( v25 > 0xF )
{
v5 = Block[0];
if ( v25 + 1 >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v5);
}
if ( v4 )
{
sub_14003D310(a2);
return 0;
}
else
{
GJAccountManager::addDLToActive((__int64)a1, "sync_account");
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v16 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v16);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
}
GameLevelManager::getBasePostString(v7, Src);
v8 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfv", "3899", 103, 99, "9");
CString = cocos2d::CCString::getCString(v8);
v10 = cocos2d::CCString::createWithFormat("&secret=%s", CString);
v11 = (char *)cocos2d::CCString::getCString(v10);
v12 = -1;
v13 = -1;
do
++v13;
while ( v11[v13] );
sub_140044D80(Src, v11, v13);
v20 = &v17;
v24 = 11;
v25 = 15;
Block[0] = (void *)0x6F636341636E7953LL;
Block[1] = (void *)7630453;
v14 = Src;
if ( Src[3] > 0xFu )
v14 = (_QWORD *)Src[0];
v17 = 0;
v18 = 0;
v19 = 0;
do
++v12;
while ( *((_BYTE *)v14 + v12) );
sub_14003D230(&v17, v14, v12);
v15 = (const char *)sub_14003F4F0((__int64)v21, a2);
GJAccountManager::ProcessHttpRequest(a1, v15, (const char *)&v17, (const char *)Block, 23);
sub_14003D310((__int64)Src);
sub_14003D310(a2);
return 1;
}
}