//
// GJAccountManager::registerAccount from 0x1402006a0 to 0x14020096a (714 bytes)
//
// 3 xrefs:
// > AccountRegisterLayer::onSubmit @ 0x14007a9f0
// > ??> @ 0x1406ccac8
// > ??> @ 0x1406ccad4
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=6
char __fastcall GJAccountManager::registerAccount(GJAccountManager *a1, const char *a2, const char *a3, const char *a4)
{
__int64 v8; // r14
void *v9; // rcx
const char *v11; // r12
const char *v12; // r14
const char *v13; // r15
cocos2d::CCString *v14; // rax
const char *CString; // rax
cocos2d::CCString *v16; // rax
const char *v17; // rdx
size_t v18; // r8
char v19[16]; // [rsp+40h] [rbp-89h] BYREF
__int64 v20; // [rsp+50h] [rbp-79h]
__int64 v21; // [rsp+58h] [rbp-71h]
__int128 v22; // [rsp+60h] [rbp-69h] BYREF
__int64 v23; // [rsp+70h] [rbp-59h]
__int64 v24; // [rsp+78h] [rbp-51h]
char *v25; // [rsp+80h] [rbp-49h]
__int128 *v26; // [rsp+88h] [rbp-41h]
const char *v27; // [rsp+98h] [rbp-31h]
const char *v28; // [rsp+A0h] [rbp-29h]
const char *v29; // [rsp+A8h] [rbp-21h]
void *Block[2]; // [rsp+B0h] [rbp-19h] BYREF
__int128 v31; // [rsp+C0h] [rbp-9h]
v27 = a2;
v28 = a3;
v29 = a4;
*(_OWORD *)Block = 0;
v31 = 0;
sub_14003A930(Block, "reg_account", 0xBu);
v8 = cocos2d::CCDictionary::objectForKey(a1->m_activeDownloads, Block);
if ( *((_QWORD *)&v31 + 1) > 0xFu )
{
v9 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v31 + 1) + 1LL) >= 0x1000 )
{
v9 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v9);
}
if ( v8 )
{
sub_14003A830((__int64)a2);
sub_14003A830((__int64)a3);
sub_14003A830((__int64)a4);
return 0;
}
else
{
GJAccountManager::addDLToActive(a1, "reg_account");
v11 = a4;
if ( *((_QWORD *)a4 + 3) > 0xFu )
v11 = *(const char **)a4;
v12 = a3;
if ( *((_QWORD *)a3 + 3) > 0xFu )
v12 = *(const char **)a3;
v13 = a2;
if ( *((_QWORD *)a2 + 3) > 0xFu )
v13 = *(const char **)a2;
v14 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfv", "3899", 103, 99, "9");
CString = cocos2d::CCString::getCString(v14);
v16 = cocos2d::CCString::createWithFormat("userName=%s&password=%s&email=%s&secret=%s", v13, v12, v11, CString);
v17 = cocos2d::CCString::getCString(v16);
v25 = v19;
v26 = &v22;
v20 = 15;
v21 = 15;
strcpy(v19, "RegisterAccount");
v22 = 0;
v23 = 0;
v24 = 0;
v18 = -1;
do
++v18;
while ( v17[v18] );
sub_14003A930(&v22, v17, v18);
*(_OWORD *)Block = 0;
*(_QWORD *)&v31 = 0;
*((_QWORD *)&v31 + 1) = 15;
Block[0] = sub_14003AA10(0x50u);
*(_QWORD *)&v31 = 65;
*((_QWORD *)&v31 + 1) = 79;
strcpy((char *)Block[0], "https://www.boomlings.com/database/accounts/registerGJAccount.php");
GJAccountManager::ProcessHttpRequest(a1, (const char *)Block, (const char *)&v22, v19, 22);
sub_14003A830((__int64)a2);
sub_14003A830((__int64)a3);
sub_14003A830((__int64)a4);
return 1;
}
}