//
// cocos2d::CCFileUtils::init from 0x180070630 to 0x18007072a (250 bytes)
//
// 4 xrefs:
// > cocos2d::CCFileUtilsWin32::init @ 0x18007abb9
// > ??> @ 0x1801003f0
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b4248
//
// 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
//
// Hidden C++ exception states: #wind=1
char __fastcall cocos2d::CCFileUtils::init(cocos2d::CCFileUtils *this)
{
unsigned __int64 v2; // rdx
_OWORD *v3; // rax
void *v4; // rcx
void *Block[2]; // [rsp+20h] [rbp-38h] BYREF
__int128 v7; // [rsp+30h] [rbp-28h]
if ( *((_QWORD *)this + 6) == *((_QWORD *)this + 7) )
{
sub_18006C540((__int64 *)this + 5, *((_QWORD *)this + 6), (__int64)(this + 8));
}
else
{
sub_180016C80(*((_QWORD *)this + 6), (__int64)(this + 8));
*((_QWORD *)this + 6) += 32LL;
}
*(_OWORD *)Block = 0;
*(_QWORD *)&v7 = 0;
v2 = 15;
*((_QWORD *)&v7 + 1) = 15;
LOBYTE(Block[0]) = 0;
v3 = *((_OWORD **)this + 3);
if ( v3 == *((_OWORD **)this + 4) )
{
sub_18000D000((__int64 *)this + 2, *((_QWORD *)this + 3), (__int64)Block);
v2 = *((_QWORD *)&v7 + 1);
}
else
{
*v3 = *(_OWORD *)Block;
v3[1] = v7;
LOBYTE(Block[0]) = 0;
*((_QWORD *)this + 3) += 32LL;
}
if ( v2 > 0xF )
{
v4 = Block[0];
if ( v2 + 1 >= 0x1000 )
{
v4 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v4 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v4);
}
return 1;
}