//
// cocos2d::CCFileUtilsMac::getFullPathForDirectoryAndFilename from 0x1006e55b0 to 0x1006e5866 (694 bytes)
//
// 1 xrefs:
// > ??> @ 0x100b93fe0
//
// 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:35:47 +0000
//
size_t *__fastcall cocos2d::CCFileUtilsMac::getFullPathForDirectoryAndFilename(
size_t *a1,
__int64 a2,
unsigned __int8 *a3,
unsigned __int8 *a4)
{
unsigned int v6; // r15d
unsigned __int8 *v7; // rbx
_BYTE *v8; // rsi
size_t v9; // r15
unsigned int v10; // ecx
_BYTE *v11; // rax
unsigned __int8 *v12; // r14
unsigned __int64 v13; // r12
size_t *v14; // r13
char v15; // r12
char *v16; // rbx
NSString *v17; // r14
NSString *v18; // rax
NSString *v19; // rax
const char *v20; // r14
size_t v21; // rax
size_t v22; // rbx
char *v23; // r15
size_t v24; // r13
size_t v25; // r13
bool v26; // zf
char *v27; // r12
char *v28; // rbx
const void *v29; // r14
size_t v30; // r12
char *v31; // r15
id v32; // rbx
NSString *v33; // rax
char v35; // [rsp+4h] [rbp-3Ch]
NSBundle *v36; // [rsp+8h] [rbp-38h]
_BYTE *v37; // [rsp+8h] [rbp-38h]
v6 = *a3;
v7 = a3 + 1;
v8 = a3 + 1;
if ( (v6 & 1) != 0 )
v8 = *((_BYTE **)a3 + 2);
if ( *v8 != 47 )
{
v36 = +[NSBundle mainBundle](&OBJC_CLASS___NSBundle, "mainBundle");
if ( (*a4 & 1) != 0 )
v12 = *((unsigned __int8 **)a4 + 2);
else
v12 = a4 + 1;
v17 = +[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", v12);
if ( (*a3 & 1) != 0 )
v7 = *((unsigned __int8 **)a3 + 2);
v18 = +[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", v7);
v19 = -[NSBundle pathForResource:ofType:inDirectory:](v36, "pathForResource:ofType:inDirectory:", v17, 0, v18);
v14 = a1;
if ( !v19 )
goto LABEL_44;
v20 = -[NSString UTF8String](v19, "UTF8String");
v21 = strlen(v20);
if ( v21 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_47:
sub_100003630();
v22 = v21;
if ( v21 >= 0x17 )
{
v30 = 26;
if ( (v21 | 7) != 0x17 )
v30 = (v21 | 7) + 1;
v23 = (char *)operator new(v30);
a1[2] = (size_t)v23;
*a1 = v30 + 1;
a1[1] = v22;
}
else
{
*(_BYTE *)a1 = 2 * v21;
v23 = (char *)a1 + 1;
if ( !v21 )
goto LABEL_36;
}
memmove(v23, v20, v22);
LABEL_36:
v31 = &v23[v22];
LABEL_45:
*v31 = 0;
return v14;
}
if ( (v6 & 1) != 0 )
{
v9 = *((_QWORD *)a3 + 1);
v10 = *a4;
if ( (v10 & 1) == 0 )
{
LABEL_6:
v11 = (_BYTE *)(v10 >> 1);
goto LABEL_11;
}
}
else
{
v9 = v6 >> 1;
v10 = *a4;
if ( (v10 & 1) == 0 )
goto LABEL_6;
}
v11 = *((_BYTE **)a4 + 1);
LABEL_11:
v37 = v11;
v13 = (unsigned __int64)&v11[v9];
if ( (unsigned __int64)&v11[v9] >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_47;
v35 = v10;
if ( v13 > 0x16 )
{
v24 = 26;
if ( (v13 | 7) != 0x17 )
v24 = (v13 | 7) + 1;
v16 = (char *)operator new(v24);
v25 = v24 + 1;
*a1 = v25;
a1[2] = (size_t)v16;
a1[1] = v13;
v15 = v25;
v14 = a1;
}
else
{
v14 = a1;
*(_OWORD *)a1 = 0;
a1[2] = 0;
v15 = 2 * v13;
*(_BYTE *)a1 = v15;
v16 = nullptr;
}
v26 = (v15 & 1) == 0;
v27 = (char *)v14 + 1;
if ( v26 )
v16 = (char *)v14 + 1;
if ( v9 )
memmove(v16, v8, v9);
v28 = &v16[v9];
if ( v37 )
{
if ( (v35 & 1) != 0 )
v29 = *((const void **)a4 + 2);
else
v29 = a4 + 1;
memmove(v28, v29, (size_t)v37);
}
v37[(_QWORD)v28] = 0;
if ( (*(_BYTE *)v14 & 1) != 0 )
v27 = (char *)v14[2];
v32 = qword_100BE6498;
v33 = +[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", v27);
if ( !(unsigned __int8)objc_msgSend(v32, "fileExistsAtPath:", v33) )
{
if ( (*(_BYTE *)v14 & 1) != 0 )
operator delete((void *)v14[2]);
LABEL_44:
*(_BYTE *)v14 = 0;
v31 = (char *)v14 + 1;
goto LABEL_45;
}
return v14;
}