//
// GJAccountManager::loginAccount from 0x1403065e0 to 0x140306a59 (1145 bytes)
//
// 2 xrefs:
// > AccountLoginLayer::onSubmit @ 0x140091f4b
// > ??> @ 0x14091e584
//
// 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=8
char __fastcall GJAccountManager::loginAccount(cocos2d::CCObject *a1, const char *a2, const char *a3)
{
__int64 v6; // rbx
void *v7; // r8
__int64 v9; // rdx
const char *v10; // r9
const char *v11; // r8
const char *v12; // rdx
cocos2d::CCString *v13; // rax
const char *CString; // rax
size_t v15; // rbx
size_t v16; // r8
_QWORD *v17; // rax
_QWORD *v18; // rax
__int64 v19; // rdx
cocos2d::CCString *v20; // rax
char *v21; // rax
size_t v22; // r8
cocos2d::CCString *v23; // rax
char *v24; // rax
size_t v25; // r8
void **v26; // rdx
void *v27; // rcx
char *v28; // [rsp+40h] [rbp-C0h] BYREF
char v29[14]; // [rsp+48h] [rbp-B8h] BYREF
__int16 v30; // [rsp+56h] [rbp-AAh]
__int64 v31; // [rsp+58h] [rbp-A8h]
__int64 v32; // [rsp+60h] [rbp-A0h]
__int128 v33; // [rsp+68h] [rbp-98h] BYREF
__int64 v34; // [rsp+78h] [rbp-88h]
__int64 v35; // [rsp+80h] [rbp-80h]
__int128 *v36; // [rsp+88h] [rbp-78h]
const char *v37; // [rsp+98h] [rbp-68h]
const char *v38; // [rsp+A0h] [rbp-60h]
void *Block[2]; // [rsp+A8h] [rbp-58h] BYREF
__int64 v40; // [rsp+B8h] [rbp-48h]
unsigned __int64 v41; // [rsp+C0h] [rbp-40h]
void *Src[2]; // [rsp+C8h] [rbp-38h] BYREF
__int64 v43; // [rsp+D8h] [rbp-28h]
unsigned __int64 v44; // [rsp+E0h] [rbp-20h]
_QWORD v45[4]; // [rsp+E8h] [rbp-18h] BYREF
v37 = a2;
v38 = a3;
*(_OWORD *)Block = 0;
v40 = 0;
v41 = 0;
sub_14003D230(Block, "login_account", 0xDu);
v6 = cocos2d::CCDictionary::objectForKey(*((_QWORD *)a1 + 40), Block);
if ( v41 > 0xF )
{
v7 = Block[0];
if ( v41 + 1 >= 0x1000 )
{
v7 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v7);
}
if ( v6 )
{
sub_14003D310((__int64)a2);
sub_14003D310((__int64)a3);
return 0;
}
else
{
GJAccountManager::addDLToActive((__int64)a1, "login_account");
v9 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v28 = (char *)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v28);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v9 = qword_14090BFD0;
}
sub_14003F4F0((__int64)v45, v9 + 624);
v10 = a3;
if ( *((_QWORD *)a3 + 3) > 0xFu )
v10 = *(const char **)a3;
v11 = a2;
if ( *((_QWORD *)a2 + 3) > 0xFu )
v11 = *(const char **)a2;
v12 = (const char *)v45;
if ( v45[3] > 0xFu )
v12 = (const char *)v45[0];
v13 = cocos2d::CCString::createWithFormat("udid=%s&userName=%s&gjp2=%s", v12, v11, v10);
CString = cocos2d::CCString::getCString(v13);
*(_OWORD *)Src = 0;
v43 = 0;
v44 = 0;
v15 = -1;
v16 = -1;
do
++v16;
while ( CString[v16] );
sub_14003D230(Src, CString, v16);
sub_140044D80(Src, "&sID=", 5u);
sub_14008B190();
if ( *(_QWORD *)SteamInternal_ContextInit(&off_1408FE060)
&& *(_QWORD *)SteamInternal_ContextInit(&off_1408FE048)
&& (v17 = (_QWORD *)SteamInternal_ContextInit(&off_1408FE048),
(*(unsigned __int8 (__fastcall **)(_QWORD))(*(_QWORD *)*v17 + 8LL))(*v17)) )
{
v18 = (_QWORD *)SteamInternal_ContextInit(&off_1408FE048);
v19 = *(_QWORD *)(*(__int64 (__fastcall **)(_QWORD, char **))(*(_QWORD *)*v18 + 16LL))(*v18, &v28);
}
else
{
v19 = 0;
}
v20 = cocos2d::CCString::createWithFormat("%lld", v19);
v21 = (char *)cocos2d::CCString::getCString(v20);
v22 = -1;
do
++v22;
while ( v21[v22] );
sub_140044D80(Src, v21, v22);
sub_140044D80(Src, "&secret=", 8u);
v23 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfv", "3899", 103, 99, "9");
v24 = (char *)cocos2d::CCString::getCString(v23);
v25 = -1;
do
++v25;
while ( v24[v25] );
sub_140044D80(Src, v24, v25);
v26 = Src;
if ( v44 > 0xF )
v26 = (void **)Src[0];
v28 = v29;
v36 = &v33;
v31 = 12;
v32 = 15;
strcpy(v29, "LoginAccount");
v29[13] = 0;
v30 = 0;
v33 = 0;
v34 = 0;
v35 = 0;
do
++v15;
while ( *((_BYTE *)v26 + v15) );
sub_14003D230(&v33, v26, v15);
*(_OWORD *)Block = 0;
v40 = 0;
v41 = 0;
Block[0] = sub_14003D460(0x40u);
v40 = 62;
v41 = 63;
strcpy((char *)Block[0], "https://www.boomlings.com/database/accounts/loginGJAccount.php");
GJAccountManager::ProcessHttpRequest(a1, (const char *)Block, (const char *)&v33, v29, 26);
if ( v44 > 0xF )
{
v27 = Src[0];
if ( v44 + 1 >= 0x1000 )
{
v27 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v27 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v27);
}
sub_14003D310((__int64)v45);
sub_14003D310((__int64)a2);
sub_14003D310((__int64)a3);
return 1;
}
}