//
// cocos2d::CCFileUtils::getFileData from 0x100428800 to 0x10042891e (286 bytes)
//
// 2 xrefs:
// > ??> @ 0x100b41dd8
// > ??> @ 0x100b93f18
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:30:18 +0000
//
void *__fastcall cocos2d::CCFileUtils::getFileData(
__int64 a1,
const std::string::value_type *a2,
const char *a3,
size_t *a4)
{
const char *data; // rdi
FILE *v7; // rax
FILE *v8; // r12
size_t v9; // r13
void *v10; // r15
std::string *v11; // rax
std::string v13; // [rsp+0h] [rbp-40h] BYREF
*a4 = 0;
(*(void (__fastcall **)(std::string *, __int64, const std::string::value_type *, _QWORD))(*(_QWORD *)a1 + 48LL))(
&v13,
a1,
a2,
0);
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) != 0 )
data = v13.__r_.__value_.__l.__data_;
else
data = v13.__r_.__value_.__s.__data_;
v7 = fopen(data, a3);
v8 = v7;
if ( !v7 )
{
v10 = nullptr;
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_7;
goto LABEL_6;
}
fseek(v7, 0, 2);
*a4 = ftell(v8);
fseek(v8, 0, 0);
v9 = *a4;
v10 = operator new[](*a4);
*a4 = fread(v10, 1u, v9, v8);
fclose(v8);
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) != 0 )
LABEL_6:
operator delete(v13.__r_.__value_.__l.__data_);
LABEL_7:
if ( !v10 )
{
strcpy((char *)&v13, "&Get data from file(");
v11 = std::string::append(&v13, a2);
std::string::append(v11, ") failed!");
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v13.__r_.__value_.__l.__data_);
}
return v10;
}