//
// PlatformToolbox::loadAndDecryptFileToString from 0x394fe8 to 0x395110 (296 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:46:19 +0000
//
int __fastcall PlatformToolbox::loadAndDecryptFileToString(char *a1, char *a2, _DWORD *a3)
{
const char *v6; // r4
jstring v8; // r0
void *v9; // r8
const char *v10; // r9
size_t v11; // r0
int v12; // r3
size_t v13; // r4
unsigned int v14; // r1
void *v15; // r11
int v16; // r3
_JNIEnv *v17[3]; // [sp+14h] [bp-Ch] BYREF
int v18[2]; // [sp+20h] [bp+0h] BYREF
const char *v19; // [sp+28h] [bp+8h]
v18[0] = 0;
v18[1] = 0;
v19 = nullptr;
std::string::__init(v18, &unk_B6B226, 0);
std::string::append(v18, a2);
std::string::append(v18, a1);
if ( (v18[0] & 1) != 0 )
v6 = v19;
else
v6 = (char *)v18 + 1;
if ( cocos2d::JniHelper::getStaticMethodInfo(
v17,
"com/customRobTop/SimpleCrypto",
"loadAndDecryptFileToString",
"(Ljava/lang/String;)Ljava/lang/String;") )
{
v8 = _JNIEnv::NewStringUTF(v17[0], v6);
v9 = (void *)_JNIEnv::CallStaticObjectMethod((int)v17[0], (int)v17[1], (int)v17[2], (int)v8);
v10 = v17[0]->functions->GetStringUTFChars(v17[0], v9, 0);
v11 = strlen(v10);
v12 = *(unsigned __int8 *)a3;
v13 = v11;
if ( (v12 & 1) != 0 )
{
v14 = (*a3 & 0xFFFFFFFE) - 1;
if ( v14 >= v11 )
{
v15 = (void *)a3[2];
goto LABEL_11;
}
v16 = a3[1];
}
else
{
if ( v11 <= 0xA )
{
v15 = (char *)a3 + 1;
LABEL_11:
std::char_traits::move(v15, v10, v11);
*((_BYTE *)v15 + v13) = 0;
if ( (*(_BYTE *)a3 & 1) != 0 )
a3[1] = v13;
else
*(_BYTE *)a3 = 2 * v13;
goto LABEL_16;
}
v16 = v12 >> 1;
v14 = 10;
}
std::string::__grow_by_and_replace((int)a3, v14, v11 - v14, v16, 0, v16, v11, v10);
LABEL_16:
v17[0]->functions->ReleaseStringUTFChars((JNIEnv *)v17[0], v9, v10);
_JNIEnv::DeleteLocalRef((int)v17[0]);
_JNIEnv::DeleteLocalRef((int)v17[0]);
_JNIEnv::DeleteLocalRef((int)v17[0]);
}
return std::string::~string((int)v18);
}