//
// cocos2d::CCFileUtils::fullPathFromRelativeFile from 0x18006f710 to 0x18006f977 (615 bytes)
//
// 4 xrefs:
// > ??> @ 0x180100380
// > ??> @ 0x1801010a8
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b4188
//
// 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=3
std::string *__fastcall cocos2d::CCFileUtils::fullPathFromRelativeFile(
cocos2d::CCFileUtils *this,
const char *a2,
const char *a3)
{
size_t v6; // r8
cocos2d::CCString *v7; // rsi
void *v8; // rcx
void **v9; // rcx
void **v10; // r8
__int64 v11; // r8
size_t v12; // r8
void **v13; // rdx
void *v14; // rcx
__int64 v15; // rax
const void *v16; // rdx
void *v17; // rcx
std::string *CString; // rbx
void *v19; // rcx
void *v21[2]; // [rsp+28h] [rbp-31h] BYREF
size_t v22; // [rsp+38h] [rbp-21h]
unsigned __int64 v23; // [rsp+40h] [rbp-19h]
void *Block[2]; // [rsp+48h] [rbp-11h] BYREF
__int64 v25; // [rsp+58h] [rbp-1h]
unsigned __int64 v26; // [rsp+60h] [rbp+7h]
void *v27[2]; // [rsp+68h] [rbp+Fh] BYREF
__int128 v28; // [rsp+78h] [rbp+1Fh]
*(_OWORD *)v21 = 0;
v22 = 0;
v23 = 0;
v6 = -1;
do
++v6;
while ( a3[v6] );
sub_18000CE60(v21, a3, v6);
*(_OWORD *)Block = 0;
v25 = 0;
v26 = 15;
LOBYTE(Block[0]) = 0;
v7 = (cocos2d::CCString *)cocos2d::CCString::create((__int64)Block);
if ( v26 > 0xF )
{
v8 = Block[0];
if ( v26 + 1 >= 0x1000 )
{
v8 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v8);
}
v25 = 0;
v26 = 15;
LOBYTE(Block[0]) = 0;
v9 = v21;
if ( v23 > 0xF )
v9 = (void **)v21[0];
if ( v22 )
{
v10 = (void **)((char *)v9 + v22 - 1);
if ( *(_BYTE *)v10 == 47 )
{
LABEL_14:
v11 = (char *)v10 - (char *)v9;
goto LABEL_16;
}
while ( v10 != v9 )
{
v10 = (void **)((char *)v10 - 1);
if ( *(_BYTE *)v10 == 47 )
goto LABEL_14;
}
}
v11 = -1;
LABEL_16:
*(_OWORD *)v27 = 0;
v28 = 0;
v12 = v11 + 1;
if ( v22 < v12 )
v12 = v22;
v13 = v21;
if ( v23 > 0xF )
v13 = (void **)v21[0];
sub_18000CE60(v27, v13, v12);
sub_1800656E0((__int64)&v7->m_sString, (__int64)v27);
if ( *((_QWORD *)&v28 + 1) > 0xFu )
{
v14 = v27[0];
if ( (unsigned __int64)(*((_QWORD *)&v28 + 1) + 1LL) >= 0x1000 )
{
v14 = *((void **)v27[0] - 1);
if ( (unsigned __int64)((char *)v27[0] - (char *)v14 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v14);
}
v15 = ((__int64 (__fastcall *)(cocos2d::CCFileUtils *, void **, const char *))this->setFilenameLookupDictionary)(
this,
v27,
a2);
v16 = (const void *)v15;
if ( *(_QWORD *)(v15 + 24) > 0xFu )
v16 = *(const void **)v15;
sub_180007CF0(&v7->m_sString.m_data.m_bigStorage, v16, *(_QWORD *)(v15 + 16));
if ( *((_QWORD *)&v28 + 1) > 0xFu )
{
v17 = v27[0];
if ( (unsigned __int64)(*((_QWORD *)&v28 + 1) + 1LL) >= 0x1000 )
{
v17 = *((void **)v27[0] - 1);
if ( (unsigned __int64)((char *)v27[0] - (char *)v17 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v17);
}
CString = cocos2d::CCString::getCString(v7);
if ( v23 > 0xF )
{
v19 = v21[0];
if ( v23 + 1 >= 0x1000 )
{
v19 = *((void **)v21[0] - 1);
if ( (unsigned __int64)((char *)v21[0] - (char *)v19 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v19);
}
return CString;
}