//
// GJAccountManager::dataLoaded from 0x1000d3fa0 to 0x1000d413c (412 bytes)
//
// 1 xrefs:
// > GameManager::dataLoaded @ 0x100389f24
//
// 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
//
void __fastcall GJAccountManager::dataLoaded(GJAccountManager *a1, DS_Dictionary *a2)
{
std::string *p_m_password; // r15
std::string *p_m_GJP2; // r14
double v4; // xmm0_8
unsigned int sizex2; // eax
unsigned int v6; // ecx
__int128 v7; // [rsp+0h] [rbp-50h] BYREF
void *__p; // [rsp+10h] [rbp-40h]
std::string v9[2]; // [rsp+20h] [rbp-30h] BYREF
DS_Dictionary::getStringForKey(v9, a2, "GJA_001");
if ( (a1->m_username.m_data.m_short.sizex2 & 1) != 0 )
operator delete(a1->m_username.m_data.m_long.longStorage);
a1->m_username = v9[0];
a1->m_accountID = DS_Dictionary::getIntegerForKey(a2, "GJA_003");
DS_Dictionary::getStringForKey(v9, a2, "GJA_002");
p_m_password = &a1->m_password;
if ( (a1->m_password.m_data.m_short.sizex2 & 1) != 0 )
operator delete(a1->m_password.m_data.m_long.longStorage);
a1->m_password.m_data.m_long.longStorage = v9[0].m_data.m_long.longStorage;
*(_OWORD *)&p_m_password->m_data.m_short.sizex2 = *(_OWORD *)&v9[0].m_data.m_short.sizex2;
DS_Dictionary::getStringForKey(v9, a2, "GJA_005");
p_m_GJP2 = &a1->m_GJP2;
if ( (a1->m_GJP2.m_data.m_short.sizex2 & 1) != 0 )
operator delete(a1->m_GJP2.m_data.m_long.longStorage);
a1->m_GJP2.m_data.m_long.longStorage = v9[0].m_data.m_long.longStorage;
v4 = *(double *)&v9[0].m_data.m_long.capacitym1;
*(_OWORD *)&p_m_GJP2->m_data.m_short.sizex2 = *(_OWORD *)&v9[0].m_data.m_short.sizex2;
sizex2 = p_m_password->m_data.m_short.sizex2;
if ( (sizex2 & 1) != 0 )
{
if ( !a1->m_password.m_data.m_long.size )
return;
}
else if ( !(sizex2 >> 1) )
{
return;
}
v6 = p_m_GJP2->m_data.m_short.sizex2;
if ( (v6 & 1) != 0 )
{
if ( a1->m_GJP2.m_data.m_long.size )
return;
}
else if ( v6 >> 1 )
{
return;
}
if ( (sizex2 & 1) != 0 )
{
sub_100006B70(&v7, a1->m_password.m_data.m_long.longStorage, a1->m_password.m_data.m_long.size, v4);
}
else
{
__p = a1->m_password.m_data.m_long.longStorage;
v7 = *(_OWORD *)&p_m_password->m_data.m_short.sizex2;
}
GJAccountManager::getShaPassword(v9, &v7);
if ( (p_m_GJP2->m_data.m_short.sizex2 & 1) != 0 )
operator delete(a1->m_GJP2.m_data.m_long.longStorage);
a1->m_GJP2.m_data.m_long.longStorage = v9[0].m_data.m_long.longStorage;
*(_OWORD *)&p_m_GJP2->m_data.m_short.sizex2 = *(_OWORD *)&v9[0].m_data.m_short.sizex2;
if ( (v7 & 1) != 0 )
operator delete(__p);
}