//
// cocos2d::CCFileUtils::getFileData from 0x180071ec0 to 0x1800720fb (571 bytes)
//
// 4 xrefs:
// > ??> @ 0x1801069a0
// > ??> @ 0x180107750
// > ??> @ 0x18014cf68
// > ??> @ 0x1801be590
//
// 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 11:21:57 +0000
//
// Hidden C++ exception states: #wind=1
unsigned __int8 *__fastcall cocos2d::CCFileUtils::getFileData(
cocos2d::CCFileUtils *this,
const char *a2,
const char *a3,
unsigned int *a4)
{
void *v7; // rdi
const char *v8; // rcx
FILE *v9; // rax
FILE *v10; // rbx
char *v11; // rcx
char *v12; // rcx
size_t v13; // rax
_QWORD *v14; // rax
char *v15; // rcx
char *FileName[2]; // [rsp+30h] [rbp-58h] BYREF
__m128i si128; // [rsp+40h] [rbp-48h]
v7 = nullptr;
*a4 = 0;
(*(void (__fastcall **)(cocos2d::CCFileUtils *, char **, const char *, _QWORD))(*(_QWORD *)this + 40LL))(
this,
FileName,
a2,
0);
v8 = (const char *)FileName;
if ( si128.m128i_i64[1] > 0xFuLL )
v8 = FileName[0];
v9 = fopen(v8, a3);
v10 = v9;
if ( v9 )
{
fseek(v9, 0, 2);
*a4 = ftell(v10);
fseek(v10, 0, 0);
v7 = (void *)sub_1800E4C6C(*a4);
*a4 = fread(v7, 1u, *a4, v10);
fclose(v10);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v12 = FileName[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v12 = *((char **)FileName[0] - 1);
if ( (unsigned __int64)(FileName[0] - v12 - 8) > 0x1F )
goto LABEL_11;
}
j_j_free_0(v12);
}
if ( v7 )
return (unsigned __int8 *)v7;
goto LABEL_14;
}
if ( si128.m128i_i64[1] <= 0xFuLL )
goto LABEL_14;
v11 = FileName[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v11 = *((char **)FileName[0] - 1);
if ( (unsigned __int64)(FileName[0] - v11 - 8) > 0x1F )
LABEL_11:
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v11);
LABEL_14:
*(_OWORD *)FileName = 0;
si128 = 0;
FileName[0] = (char *)sub_18000CE80(0x20u);
si128 = _mm_load_si128((const __m128i *)&xmmword_180106BC0);
strcpy(FileName[0], "Get data from file(");
v13 = strlen(a2);
v14 = sub_180007DF0(FileName, a2, v13);
sub_180007DF0(v14, ") failed!", 9u);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v15 = FileName[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v15 = *((char **)FileName[0] - 1);
if ( (unsigned __int64)(FileName[0] - v15 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v15);
}
return (unsigned __int8 *)v7;
}