//
// GJAccountManager::onLoginAccountCompleted from 0x140306a60 to 0x140306e68 (1032 bytes)
//
// 2 xrefs:
// > GJAccountManager::handleIt @ 0x14030563c
// > ??> @ 0x14091e590
//
// 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:09 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall GJAccountManager::onLoginAccountCompleted(__int64 a1, __int64 *a2, __int64 a3)
{
void *v5; // rcx
cocos2d::CCString *v6; // rax
const char *CString; // rax
size_t v8; // r8
void **v9; // rdx
char *v10; // r15
const void *v11; // rcx
size_t v12; // r12
size_t v13; // r8
size_t v14; // r13
int v15; // r14d
char *v16; // rax
__int64 v17; // rcx
cocos2d::CCString *v18; // rax
const char *v19; // rax
size_t v20; // r8
void **v21; // rdx
char *v22; // r15
const void *v23; // rcx
size_t v24; // r12
size_t v25; // r8
size_t v26; // r13
int v27; // r14d
char *v28; // rax
__int64 v29; // rcx
const void *v30; // rcx
unsigned __int64 v31; // rsi
size_t v32; // r8
__int64 v33; // r8
cocos2d::CCArray *v34; // r14
cocos2d::CCString *v35; // rax
int v36; // esi
cocos2d::CCString *v37; // rax
__int64 v38; // rcx
int v39; // eax
__int64 v40; // rcx
void (__fastcall ***v41)(_QWORD, _QWORD, __int64); // rcx
void *Block[2]; // [rsp+48h] [rbp-28h] BYREF
size_t Size[2]; // [rsp+58h] [rbp-18h]
*(__m128i *)Size = _mm_load_si128((const __m128i *)&xmmword_1408365E0);
qmemcpy(Block, "login_accoun", 12);
HIDWORD(Block[1]) = (unsigned __int8)aLoginAccount[12];
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 320), Block);
if ( Size[1] > 0xF )
{
v5 = Block[0];
if ( Size[1] + 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);
}
v6 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, 4294967284LL);
CString = cocos2d::CCString::getCString(v6);
*(_OWORD *)Block = 0;
Size[0] = 0;
Size[1] = 0;
v8 = -1;
do
++v8;
while ( CString[v8] );
sub_14003D230(Block, CString, v8);
v9 = Block;
v10 = (char *)Block[0];
if ( Size[1] > 0xF )
v9 = (void **)Block[0];
v11 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v11 = (const void *)*a2;
v12 = a2[2];
v13 = v12;
v14 = Size[0];
if ( Size[0] < v12 )
v13 = Size[0];
v15 = memcmp(v11, v9, v13);
if ( !v15 )
{
if ( v12 >= v14 )
v15 = v12 > v14;
else
v15 = -1;
}
if ( Size[1] > 0xF )
{
v16 = v10;
if ( Size[1] + 1 >= 0x1000 )
{
v10 = *((char **)v10 - 1);
if ( (unsigned __int64)(v16 - v10 - 8) > 0x1F )
LABEL_40:
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v10);
}
if ( !v15 )
{
v17 = *(_QWORD *)(a1 + 416);
if ( v17 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 8LL))(v17, 4294967284LL);
goto LABEL_61;
}
v18 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, 4294967283LL);
v19 = cocos2d::CCString::getCString(v18);
*(_OWORD *)Block = 0;
Size[0] = 0;
Size[1] = 0;
v20 = -1;
do
++v20;
while ( v19[v20] );
sub_14003D230(Block, v19, v20);
v21 = Block;
v22 = (char *)Block[0];
if ( Size[1] > 0xF )
v21 = (void **)Block[0];
v23 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v23 = (const void *)*a2;
v24 = a2[2];
v25 = v24;
v26 = Size[0];
if ( Size[0] < v24 )
v25 = Size[0];
v27 = memcmp(v23, v21, v25);
if ( !v27 )
{
if ( v24 >= v26 )
v27 = v24 > v26;
else
v27 = -1;
}
if ( Size[1] > 0xF )
{
v28 = v22;
if ( Size[1] + 1 >= 0x1000 )
{
v22 = *((char **)v22 - 1);
if ( (unsigned __int64)(v28 - v22 - 8) > 0x1F )
goto LABEL_40;
}
j_j_free(v22);
}
if ( v27 )
{
*(_OWORD *)Block = 0;
Size[0] = 2;
Size[1] = 15;
strcpy((char *)Block, "-1");
v30 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v30 = (const void *)*a2;
v31 = a2[2];
v32 = v31;
if ( v31 > 2 )
v32 = 2;
if ( !memcmp(v30, Block, v32) && v31 == 2
|| (v34 = sub_1400D2840(a2, byte_14070ECF8), cocos2d::CCArray::count(v34) < 2)
|| (v35 = cocos2d::CCArray::stringAtIndex(v34, 0),
v36 = cocos2d::CCString::intValue(v35),
v37 = cocos2d::CCArray::stringAtIndex(v34, 1u),
v33 = (unsigned int)cocos2d::CCString::intValue(v37),
v36 <= 0) )
{
v38 = *(_QWORD *)(a1 + 416);
if ( v38 )
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v38 + 8LL))(v38, 0xFFFFFFFFLL, v33);
}
else
{
v39 = *(_DWORD *)(a1 + 360);
if ( !v39 || v39 == v36 )
{
v41 = *(void (__fastcall ****)(_QWORD, _QWORD, __int64))(a1 + 416);
if ( v41 )
(**v41)(v41, (unsigned int)v36, v33);
}
else
{
v40 = *(_QWORD *)(a1 + 416);
if ( v40 )
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v40 + 8LL))(v40, 4294967286LL, v33);
}
}
}
else
{
v29 = *(_QWORD *)(a1 + 416);
if ( v29 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v29 + 8LL))(v29, 4294967283LL);
}
LABEL_61:
sub_14003D310((__int64)a2);
sub_14003D310(a3);
}