//
// PlatformToolbox::loadAndDecryptFileToString from 0x4ecacc to 0x4ecd0c (576 bytes)
//
// 1 xrefs:
// > ??> @ 0x907b0
//
// 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 __fastcall PlatformToolbox::loadAndDecryptFileToString(const char *a1, const char *a2, __int64 a3)
{
size_t v6; // x0
size_t v7; // x0
__int64 v8; // x20
__int64 v9; // x2
void *v10; // x0
__int64 v12; // x21
__int64 v13; // x20
const char *v14; // x22
size_t v15; // x0
unsigned int *v16; // x2
int v17; // w1
__int64 v18; // [xsp+48h] [xbp+48h] BYREF
__int64 v19; // [xsp+50h] [xbp+50h] BYREF
__int64 v20; // [xsp+58h] [xbp+58h]
__int64 v21; // [xsp+60h] [xbp+60h]
sub_D153B8((int)&v18, &byte_F288A0);
v6 = strlen(a2);
sub_D15FD4(&v18, a2, v6);
v7 = strlen(a1);
sub_D15FD4(&v18, a1, v7);
v8 = v18;
if ( (unsigned __int8)cocos2d::JniHelper::getStaticMethodInfo(
&v19,
"com/customRobTop/SimpleCrypto",
"loadAndDecryptFileToString",
"(Ljava/lang/String;)Ljava/lang/String;") )
{
v12 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v19 + 1336LL))(v19, v8);
v13 = _JNIEnv::CallStaticObjectMethod(v19, v20, v21, v12);
v14 = (const char *)(*(__int64 (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v19 + 1352LL))(v19, v13, 0);
v15 = strlen(v14);
sub_D1798C(a3, v14, v15);
(*(void (__fastcall **)(__int64, __int64, const char *))(*(_QWORD *)v19 + 1360LL))(v19, v13, v14);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v19 + 184LL))(v19, v12);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v19 + 184LL))(v19, v13);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v19 + 184LL))(v19, v20);
v9 = v18;
v10 = (void *)(v18 - 24);
if ( (__int64 *)(v18 - 24) == &qword_124B6B0 )
return _stack_chk_guard;
}
else
{
v9 = v18;
v10 = (void *)(v18 - 24);
if ( (__int64 *)(v18 - 24) == &qword_124B6B0 )
return _stack_chk_guard;
}
if ( &pthread_create )
{
v16 = (unsigned int *)(v9 - 8);
do
v17 = __ldaxr(v16);
while ( __stlxr(v17 - 1, v16) );
}
else
{
v17 = *(_DWORD *)(v9 - 8);
*(_DWORD *)(v9 - 8) = v17 - 1;
}
if ( v17 <= 0 )
operator delete(v10);
return _stack_chk_guard;
}