//
// cocos2d::CCFileUtilsAndroid::doGetFileData from 0x5e1620 to 0x5e1740 (288 bytes)
//
// 2 xrefs:
// > cocos2d::CCFileUtilsAndroid::getFileData @ 0x5e175a
// > cocos2d::CCFileUtilsAndroid::getFileDataForAsync @ 0x5e1768
//
// 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
//
unsigned __int8 *cocos2d::CCFileUtilsAndroid::doGetFileData(
cocos2d::CCFileUtilsAndroid *a1,
const char *a2,
const char *a3,
unsigned int *a4,
bool a5)
{
unsigned __int8 *result; // r0
int FileData; // r0
cocos2d::ZipFile *v11; // r4
void *v12; // r4
FILE *v13; // r0
FILE *v14; // r6
int v15; // r0
unsigned int v16; // r7
size_t v17; // r7
char *filename; // [sp+4h] [bp-10h] BYREF
std::string v19; // [sp+8h] [bp-Ch] BYREF
if ( !a2 )
return nullptr;
if ( a3 )
{
result = (unsigned __int8 *)*(unsigned __int8 *)a2;
if ( !*a2 )
return result;
((void (__fastcall *)(char **, cocos2d::CCFileUtilsAndroid *, const char *, _DWORD))a1->createCCArrayWithContentsOfFile)(
&filename,
a1,
a2,
0);
sub_775170(&filename);
if ( *filename == 47 )
{
v13 = fopen(filename, a3);
v14 = v13;
if ( v13 )
{
fseek(v13, 0, 2);
v16 = ftell(v14);
fseek(v14, 0, 0);
v12 = (void *)operator new[](v16);
v17 = fread(v12, 1u, v16, v14);
fclose(v14);
if ( a4 )
*a4 = v17;
goto LABEL_14;
}
}
else
{
if ( a5 )
{
sub_776584((int)&v19, filename);
FileData = cocos2d::ZipFile::getFileData(dword_AC907C, &v19, a4, *(_DWORD *)(dword_AC907C + 8));
}
else
{
v11 = (cocos2d::ZipFile *)dword_AC907C;
sub_776584((int)&v19, filename);
FileData = cocos2d::ZipFile::getFileData(v11, &v19, a4);
}
v12 = (void *)FileData;
sub_774008(&v19);
if ( v12 )
goto LABEL_14;
}
sub_776584((int)&v19, "Get data from file(");
v15 = sub_774544((int)&v19, (char *)a2);
sub_774544(v15, ") failed!");
sub_774008(&v19);
v12 = nullptr;
LABEL_14:
sub_774008(&filename);
return (unsigned __int8 *)v12;
}
return nullptr;
}