//
// GJAccountManager::onGetAccountSyncURLCompleted from 0x10009feb0 to 0x1000a007c (460 bytes)
//
// 1 xrefs:
// > GJAccountManager::handleIt @ 0x10009de25
//
// 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 12:20:13 +0000
//
void __fastcall GJAccountManager::onGetAccountSyncURLCompleted(__int64 a1, unsigned __int8 *a2)
{
const void *v2; // r15
unsigned __int64 v3; // rcx
char *v4; // r14
size_t v5; // rdx
__int64 v6; // rax
const char *CString; // r12
size_t v8; // rax
size_t v9; // r15
char v10; // r15
size_t v11; // r13
char v12; // r14
__int64 v13; // rdi
__int128 v14; // [rsp+0h] [rbp-60h] BYREF
void *__p; // [rsp+10h] [rbp-50h]
__int128 __s2; // [rsp+20h] [rbp-40h] BYREF
void *v17; // [rsp+30h] [rbp-30h]
GJAccountManager::removeDLFromActive(a1, "surl_account");
*(_WORD *)((char *)&__s2 + 1) = 12589;
BYTE3(__s2) = 0;
v2 = a2 + 1;
v3 = *a2 >> 1;
if ( (*a2 & 1) != 0 )
v2 = *((const void **)a2 + 2);
v4 = (char *)&__s2 + 1;
if ( (*a2 & 1) != 0 )
v3 = *((_QWORD *)a2 + 1);
v5 = 2;
if ( v3 < 2 )
v5 = v3;
if ( !((v3 != 2) | (memcmp(v2, (char *)&__s2 + 1, v5) != 0)) )
{
if ( *(_QWORD *)(a1 + 416) )
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(**(_QWORD **)(a1 + 424) + 8LL))(
*(_QWORD *)(a1 + 424),
0xFFFFFFFFLL,
0);
return;
}
v6 = sub_10088E820("%s/database/accounts/syncGJAccountNew.php", v14);
CString = (const char *)cocos2d::CCString::getCString(v6);
v8 = strlen(CString);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v9 = v8;
if ( v8 >= 0x17 )
{
v11 = 26;
if ( (v8 | 7) != 0x17 )
v11 = (v8 | 7) + 1;
v4 = (char *)operator new(v11);
v17 = v4;
*(_QWORD *)&__s2 = v11 + 1;
*((_QWORD *)&__s2 + 1) = v9;
LABEL_18:
memmove(v4, CString, v9);
v4[v9] = 0;
v10 = __s2;
if ( (__s2 & 1) == 0 )
goto LABEL_14;
LABEL_19:
sub_10001AD30(&v14, v17, *((unsigned __int64 *)&__s2 + 1));
goto LABEL_20;
}
LOBYTE(__s2) = 2 * v8;
if ( v8 )
goto LABEL_18;
BYTE1(__s2) = 0;
v10 = __s2;
if ( (__s2 & 1) != 0 )
goto LABEL_19;
LABEL_14:
__p = v17;
v14 = __s2;
LABEL_20:
v12 = GJAccountManager::syncAccount(a1, &v14);
if ( (v14 & 1) != 0 )
operator delete(__p);
if ( !v12 )
{
v13 = *(_QWORD *)(a1 + 424);
if ( v13 )
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v13 + 8LL))(v13, 0xFFFFFFFFLL, 0);
}
if ( (v10 & 1) != 0 )
operator delete(v17);
}