//
// GJAccountManager::onLoginAccountCompleted from 0x10009e670 to 0x10009ea02 (914 bytes)
//
// 1 xrefs:
// > GJAccountManager::handleIt @ 0x10009e032
//
// 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:12 +0000
//
__int64 __fastcall GJAccountManager::onLoginAccountCompleted(__int64 a1, unsigned __int8 *a2)
{
__int64 v2; // rax
const char *CString; // r12
size_t v4; // rax
size_t v5; // r15
char *v6; // rbx
size_t v7; // r14
char *v8; // r14
void *v9; // rbx
unsigned int v10; // eax
const void *v11; // rdi
size_t v12; // rax
size_t v13; // rdx
char *v14; // rsi
bool v15; // zf
char v16; // r12
__int64 result; // rax
__int64 v18; // rdi
__int64 v19; // rax
const char *v20; // rbx
size_t v21; // rax
size_t v22; // r13
char *v23; // r12
size_t v24; // r15
void *v25; // rbx
unsigned int v26; // eax
size_t v27; // rax
const void *v28; // rdi
size_t v29; // rdx
bool v30; // zf
char v31; // r14
__int64 v32; // rdi
unsigned __int64 v33; // rcx
const void *v34; // rdi
size_t v35; // rdx
__int64 v36; // r14
__int64 v37; // rax
int v38; // ebx
__int64 v39; // rax
__int64 v40; // rdi
__int64 v41; // rdi
char v42; // [rsp+0h] [rbp-60h]
char v43; // [rsp+0h] [rbp-60h]
void *__s1; // [rsp+10h] [rbp-50h]
size_t __dst; // [rsp+18h] [rbp-48h] BYREF
size_t v47; // [rsp+20h] [rbp-40h]
void *__p; // [rsp+28h] [rbp-38h]
__int64 v49; // [rsp+30h] [rbp-30h]
GJAccountManager::removeDLFromActive(a1, "login_account");
v2 = sub_10088E820("%i", v42);
CString = (const char *)cocos2d::CCString::getCString(v2);
v4 = strlen(CString);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_58;
v5 = v4;
v49 = a1;
if ( v4 >= 0x17 )
{
v7 = 26;
if ( (v4 | 7) != 0x17 )
v7 = (v4 | 7) + 1;
v6 = (char *)operator new(v7);
__p = v6;
__dst = v7 + 1;
v47 = v5;
goto LABEL_8;
}
LOBYTE(__dst) = 2 * v4;
v6 = (char *)&__dst + 1;
if ( v4 )
LABEL_8:
memmove(v6, CString, v5);
v8 = (char *)&__dst + 1;
v6[v5] = 0;
v9 = __p;
v10 = *a2;
v11 = a2 + 1;
__s1 = a2 + 1;
if ( (v10 & 1) != 0 )
{
v12 = *((_QWORD *)a2 + 1);
v11 = *((const void **)a2 + 2);
}
else
{
v12 = v10 >> 1;
}
v13 = (unsigned __int8)__dst >> 1;
if ( (__dst & 1) != 0 )
v13 = v47;
v14 = (char *)__p;
if ( (__dst & 1) == 0 )
v14 = (char *)&__dst + 1;
v15 = v13 == v12;
if ( v13 >= v12 )
v13 = v12;
v16 = v15 & (memcmp(v11, v14, v13) == 0);
if ( (__dst & 1) != 0 )
operator delete(v9);
if ( v16 )
{
result = v49;
v18 = *(_QWORD *)(v49 + 400);
if ( v18 )
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v18 + 8LL))(v18, 4294967284LL);
return result;
}
v19 = sub_10088E820("%i", v43);
v20 = (const char *)cocos2d::CCString::getCString(v19);
v21 = strlen(v20);
if ( v21 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_58:
sub_100003630();
v22 = v21;
if ( v21 >= 0x17 )
{
v24 = 26;
if ( (v21 | 7) != 0x17 )
v24 = (v21 | 7) + 1;
v23 = (char *)operator new(v24);
__p = v23;
__dst = v24 + 1;
v47 = v22;
}
else
{
LOBYTE(__dst) = 2 * v21;
v23 = (char *)&__dst + 1;
if ( !v21 )
goto LABEL_31;
}
memmove(v23, v20, v22);
LABEL_31:
v23[v22] = 0;
v25 = __p;
v26 = *a2;
if ( (v26 & 1) != 0 )
{
v27 = *((_QWORD *)a2 + 1);
v28 = *((const void **)a2 + 2);
}
else
{
v27 = v26 >> 1;
v28 = __s1;
}
v29 = (unsigned __int8)__dst >> 1;
if ( (__dst & 1) != 0 )
{
v29 = v47;
v8 = (char *)__p;
}
v30 = v29 == v27;
if ( v29 >= v27 )
v29 = v27;
v31 = v30 & (memcmp(v28, v8, v29) == 0);
if ( (__dst & 1) != 0 )
operator delete(v25);
if ( v31 )
{
result = v49;
v32 = *(_QWORD *)(v49 + 400);
if ( v32 )
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v32 + 8LL))(v32, 4294967283LL);
}
else
{
*(_WORD *)((char *)&__dst + 1) = 12589;
BYTE3(__dst) = 0;
v33 = *a2 >> 1;
v34 = __s1;
if ( (*a2 & 1) != 0 )
{
v34 = *((const void **)a2 + 2);
v33 = *((_QWORD *)a2 + 1);
}
v35 = 2;
if ( v33 < 2 )
v35 = v33;
if ( (v33 != 2) | (memcmp(v34, (char *)&__dst + 1, v35) != 0)
&& (v36 = sub_1000A1100(a2, ","), (unsigned int)sub_1007FEF90(v36) > 1)
&& (v37 = cocos2d::CCArray::stringAtIndex(v36, 0),
v38 = cocos2d::CCString::intValue(v37),
v39 = cocos2d::CCArray::stringAtIndex(v36, 1),
result = cocos2d::CCString::intValue(v39),
v38 > 0) )
{
v40 = *(_QWORD *)(v49 + 400);
if ( *(_DWORD *)(v49 + 352) == 0 || *(_DWORD *)(v49 + 352) == v38 )
{
if ( v40 )
return (**(__int64 (__fastcall ***)(__int64, _QWORD, _QWORD))v40)(
v40,
(unsigned int)v38,
(unsigned int)result);
}
else if ( v40 )
{
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v40 + 8LL))(v40, 4294967286LL);
}
}
else
{
result = v49;
v41 = *(_QWORD *)(v49 + 400);
if ( v41 )
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v41 + 8LL))(v41, 0xFFFFFFFFLL);
}
}
return result;
}