//
// GJAccountManager::getShaPassword from 0x8480a8 to 0x848220 (376 bytes)
//
// 3 xrefs:
// > GJAccountManager::dataLoaded @ 0x848340
// > AccountLoginLayer::onSubmit @ 0x851e60
// > ??> @ 0x3a368
//
// 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
//
__int64 __usercall GJAccountManager::getShaPassword@(__int64 a1@)
{
double v2; // d0
cocos2d::CCString *v3; // x0
size_t v4; // x0
char *v5; // x21
unsigned int v6; // w0
unsigned __int8 *v7; // x3
char *v8; // x2
char *v9; // x0
unsigned int *v11; // x2
int v12; // w1
const char *CString; // [xsp+38h] [xbp+38h]
char *v14; // [xsp+48h] [xbp+48h] BYREF
unsigned __int8 v15[24]; // [xsp+50h] [xbp+50h] BYREF
unsigned __int8 v16[48]; // [xsp+68h] [xbp+68h] BYREF
*(_QWORD *)&v2 = sub_D18D28(&v14).n128_u64[0];
v3 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&qword_68 + 5,
"I29",
"fmAn",
120,
103,
"Ts",
v2);
CString = cocos2d::CCString::getCString(v3);
v4 = strlen(CString);
sub_D15FD4(&v14, CString, v4);
v5 = v14;
v6 = strlen(v14);
rtsha1::calc((rtsha1 *)v5, (const void *)v6, (__int64)v15, v7);
rtsha1::toHexString((rtsha1 *)v15, v16, v8);
sub_D153B8(a1, (char *)v16);
v9 = v14 - 24;
if ( v14 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)(v14 - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *((_DWORD *)v14 - 2);
*((_DWORD *)v14 - 2) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v9);
}
return a1;
}