//
// GJAccountManager::loginAccount from 0x98a910 to 0x98ac2c (796 bytes)
//
// 2 xrefs:
// > AccountLoginLayer::onSubmit @ 0x992568
// > ??> @ 0x881c8
//
// This function is hookable on this platform (idp: arm, 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:57:56 +0000
//
__int64 __fastcall GJAccountManager::loginAccount(GJAccountManager *a1, __int64 a2, __int64 a3)
{
_BOOL4 isDLActive; // w1
__int64 result; // x0
GameManager *v8; // x0
__int64 v9; // x2
char v10; // w0
__int64 v11; // x0
__int64 v12; // x1
char *v13; // x1
__int64 v14; // x2
__int64 v15; // x3
cocos2d::CCString *v16; // x0
size_t v17; // x0
cocos2d::CCString *v18; // x0
size_t v19; // x0
char *v20; // x20
size_t v21; // x0
char *CString; // [xsp+48h] [xbp+48h]
char *v23; // [xsp+48h] [xbp+48h]
__int64 v24; // [xsp+50h] [xbp+50h] BYREF
__int64 v25; // [xsp+58h] [xbp+58h]
char *v26; // [xsp+60h] [xbp+60h]
__int64 v27[2]; // [xsp+68h] [xbp+68h] BYREF
void *v28; // [xsp+78h] [xbp+78h]
__int64 v29[2]; // [xsp+80h] [xbp+80h] BYREF
void *v30; // [xsp+90h] [xbp+90h]
__int64 v31[2]; // [xsp+98h] [xbp+98h] BYREF
void *v32; // [xsp+A8h] [xbp+A8h]
__int64 v33[2]; // [xsp+B0h] [xbp+B0h] BYREF
void *v34; // [xsp+C0h] [xbp+C0h]
isDLActive = GJAccountManager::isDLActive(a1, "login_account");
result = 0;
if ( !isDLActive )
{
v8 = (GameManager *)GJAccountManager::addDLToActive(a1, "login_account");
v9 = GameManager::sharedState(v8) + 608;
v10 = *(_BYTE *)v9;
v24 = 0;
v25 = 0;
v26 = nullptr;
if ( (v10 & 1) != 0 )
{
std::string::__init(&v24, *(void **)(v9 + 16), *(_QWORD *)(v9 + 8));
}
else
{
v11 = *(_QWORD *)v9;
v12 = *(_QWORD *)(v9 + 8);
v26 = *(char **)(v9 + 16);
v24 = v11;
v25 = v12;
}
v13 = (char *)&v24 + 1;
if ( (v24 & 1) != 0 )
v13 = v26;
v14 = a2 + 1;
if ( (*(_BYTE *)a2 & 1) != 0 )
v14 = *(_QWORD *)(a2 + 16);
v15 = a3 + 1;
if ( (*(_BYTE *)a3 & 1) != 0 )
v15 = *(_QWORD *)(a3 + 16);
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"udid=%s&userName=%s&gjp2=%s",
v13,
v14,
v15);
CString = (char *)cocos2d::CCString::getCString(v16);
v27[0] = 0;
v27[1] = 0;
v28 = nullptr;
v17 = strlen(CString);
std::string::__init(v27, CString, v17);
std::string::append((__int64)v27, "&secret=", 8u);
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfv",
"3899",
103,
99,
"9");
v23 = (char *)cocos2d::CCString::getCString(v18);
v19 = strlen(v23);
std::string::append((__int64)v27, v23, v19);
v20 = (char *)v27 + 1;
if ( (v27[0] & 1) != 0 )
v20 = (char *)v28;
v29[0] = 0;
v29[1] = 0;
v30 = nullptr;
std::string::__init(v29, "https://www.boomlings.com/database/accounts/loginGJAccount.php", 0x3Eu);
v31[0] = 0;
v31[1] = 0;
v32 = nullptr;
v21 = strlen(v20);
std::string::__init(v31, v20, v21);
v33[0] = 0;
v33[1] = 0;
v34 = nullptr;
std::string::__init(v33, "LoginAccount", 0xCu);
GJAccountManager::ProcessHttpRequest(a1, (__int64)v29, (__int64)v31, (__int64)v33, 26);
if ( (v33[0] & 1) != 0 )
operator delete(v34);
if ( (v31[0] & 1) != 0 )
operator delete(v32);
if ( (v29[0] & 1) != 0 )
operator delete(v30);
if ( (v27[0] & 1) != 0 )
operator delete(v28);
if ( (v24 & 1) != 0 )
operator delete(v26);
return 1;
}
return result;
}