//
// cocos2d::CCFileUtils::fullPathForFilename from 0xd7a19c to 0xd7a848 (1708 bytes)
//
// 3 xrefs:
// > ??> @ 0x8f938
// > ??> @ 0x152d900
// > ??> @ 0x152ddc0
//
// This function is hookable on this platform (idp: arm, 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 13:08:06 +0000
//
__int64 *__usercall cocos2d::CCFileUtils::fullPathForFilename@(
cocos2d::CCFileUtils *this@,
char *a2@,
unsigned __int8 a3@,
__int64 *a4@)
{
unsigned int v7; // w27
size_t v8; // x0
unsigned __int8 (__fastcall *v9)(cocos2d::CCFileUtils *, __int64 *); // x24
size_t v10; // x0
int v11; // w24
size_t v12; // x0
__int64 *v13; // x24
__int64 v14; // x1
size_t v16; // x0
size_t v17; // x0
__int64 v18; // x1
cocos2d::CCDirector *v19; // x0
cocos2d::CCDirector *v20; // x0
_BOOL8 v21; // x0
int v22; // w25
char *v23; // x1
size_t v24; // x2
__int64 v25; // x1
__int64 v26; // x0
size_t v27; // x0
__int64 v28; // x0
__int64 v29; // x1
cocos2d::CCDirector *v30; // x0
size_t v31; // x0
__int64 v32; // x2
__int64 v33; // x3
char v34; // w0
size_t v35; // x0
size_t v36; // x2
char *v37; // x1
void (__fastcall *v38)(__int64 *__return_ptr, cocos2d::CCFileUtils *, __int64 *, __int64 *); // [xsp+70h] [xbp+70h]
char *v39; // [xsp+98h] [xbp+98h]
__int64 v40; // [xsp+A0h] [xbp+A0h]
cocos2d::CCDirector *v41; // [xsp+A8h] [xbp+A8h]
__int64 v42[2]; // [xsp+B8h] [xbp+B8h] BYREF
void *v43; // [xsp+C8h] [xbp+C8h]
__int64 v44; // [xsp+D0h] [xbp+D0h] BYREF
size_t v45; // [xsp+D8h] [xbp+D8h]
void *v46; // [xsp+E0h] [xbp+E0h]
__int64 v47; // [xsp+E8h] [xbp+E8h] BYREF
__int64 v48; // [xsp+F0h] [xbp+F0h]
void *v49; // [xsp+F8h] [xbp+F8h]
__int64 v50; // [xsp+100h] [xbp+100h] BYREF
__int64 v51; // [xsp+108h] [xbp+108h]
void *v52; // [xsp+110h] [xbp+110h]
__int64 v53; // [xsp+118h] [xbp+118h] BYREF
size_t v54; // [xsp+120h] [xbp+120h]
void *v55; // [xsp+128h] [xbp+128h]
__int64 v56[2]; // [xsp+130h] [xbp+130h] BYREF
void *v57; // [xsp+140h] [xbp+140h]
__int64 v58; // [xsp+148h] [xbp+148h] BYREF
__int64 v59; // [xsp+150h] [xbp+150h]
void *v60; // [xsp+158h] [xbp+158h]
_BYTE v61[16]; // [xsp+160h] [xbp+160h] BYREF
void *v62; // [xsp+170h] [xbp+170h]
v7 = a3;
if ( !*a2 )
{
*a4 = 0;
a4[1] = 0;
a4[2] = 0;
v17 = strlen(a2);
std::string::__init(a4, a2, v17);
return a4;
}
v42[0] = 0;
v42[1] = 0;
v43 = nullptr;
v8 = strlen(a2);
std::string::__init(v42, a2, v8);
v9 = *(unsigned __int8 (__fastcall **)(cocos2d::CCFileUtils *, __int64 *))(*(_QWORD *)this + 168LL);
v58 = 0;
v59 = 0;
v60 = nullptr;
v10 = strlen(a2);
std::string::__init(&v58, a2, v10);
v11 = v9(this, &v58);
if ( (v58 & 1) != 0 )
{
operator delete(v60);
if ( !v11 )
goto LABEL_4;
LABEL_11:
*a4 = 0;
a4[1] = 0;
a4[2] = 0;
v16 = strlen(a2);
std::string::__init(a4, a2, v16);
if ( (v42[0] & 1) == 0 )
return a4;
LABEL_12:
operator delete(v43);
return a4;
}
if ( v11 )
goto LABEL_11;
LABEL_4:
v39 = (char *)this + 88;
v58 = 0;
v59 = 0;
v60 = nullptr;
v12 = strlen(a2);
std::string::__init(&v58, a2, v12);
v13 = std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::find(
(__int64)this + 88,
(__int64)&v58);
if ( (v58 & 1) != 0 )
operator delete(v60);
if ( v13 != (__int64 *)((char *)this + 96) )
{
*a4 = 0;
a4[1] = 0;
a4[2] = 0;
if ( (v13[7] & 1) != 0 )
{
std::string::__init(a4, (void *)v13[9], v13[8]);
}
else
{
v14 = v13[8];
*a4 = v13[7];
a4[1] = v14;
a4[2] = v13[9];
}
goto LABEL_9;
}
(*(void (__fastcall **)(__int64 *__return_ptr, cocos2d::CCFileUtils *, char *))(*(_QWORD *)this + 200LL))(
&v44,
this,
a2);
v47 = 0;
v48 = 0;
v49 = nullptr;
std::string::__init(&v47, &byte_11B8890, 0);
v18 = *((_QWORD *)this + 6);
v40 = *((_QWORD *)this + 5);
if ( v18 == v40 )
goto LABEL_38;
v19 = *((cocos2d::CCDirector **)this + 3);
do
{
v41 = *((cocos2d::CCDirector **)this + 2);
if ( v19 == v41 )
goto LABEL_37;
while ( 2 )
{
v20 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v19);
v21 = cocos2d::CCDirector::getContentScaleFactor(v20) >= 4.0;
if ( (unsigned int)v21 <= v7 )
{
v30 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v21);
if ( (cocos2d::CCDirector::getContentScaleFactor(v30) >= 2.0) > v7 )
v22 = 1;
else
v22 = 2;
}
else
{
v22 = 0;
}
do
{
v50 = 0;
v51 = 0;
v52 = nullptr;
if ( v22 )
{
if ( v22 != 1 )
{
if ( (v44 & 1) != 0 )
{
v23 = (char *)v46;
v24 = v45;
}
else
{
v24 = (unsigned __int8)v44 >> 1;
v23 = (char *)&v44 + 1;
}
std::string::assign(&v50, v23, v24);
goto LABEL_27;
}
v38 = *(void (__fastcall **)(__int64 *__return_ptr, cocos2d::CCFileUtils *, __int64 *, __int64 *))(*(_QWORD *)this + 216LL);
v53 = 0;
v54 = 0;
v55 = nullptr;
if ( (v44 & 1) != 0 )
{
std::string::__init(&v53, v46, v45);
}
else
{
v55 = v46;
v53 = v44;
v54 = v45;
}
v36 = 3;
v37 = "-hd";
}
else
{
v38 = *(void (__fastcall **)(__int64 *__return_ptr, cocos2d::CCFileUtils *, __int64 *, __int64 *))(*(_QWORD *)this + 216LL);
v53 = 0;
v54 = 0;
v55 = nullptr;
if ( (v44 & 1) != 0 )
{
std::string::__init(&v53, v46, v45);
}
else
{
v55 = v46;
v53 = v44;
v54 = v45;
}
v36 = 4;
v37 = "-uhd";
}
v56[0] = 0;
v56[1] = 0;
v57 = nullptr;
std::string::__init(v56, v37, v36);
v38(&v58, this, &v53, v56);
if ( (v50 & 1) != 0 )
{
*(_BYTE *)v52 = 0;
v51 = 0;
}
else
{
LOWORD(v50) = 0;
}
std::string::reserve(&v50, 0);
v52 = v60;
v50 = v58;
v51 = v59;
if ( (v56[0] & 1) != 0 )
operator delete(v57);
if ( (v53 & 1) != 0 )
operator delete(v55);
LABEL_27:
(*(void (__fastcall **)(__int64 *__return_ptr, cocos2d::CCFileUtils *, __int64 *, cocos2d::CCDirector *, __int64))(*(_QWORD *)this + 224LL))(
&v58,
this,
&v50,
v41,
v40);
if ( (v47 & 1) != 0 )
{
*(_BYTE *)v49 = 0;
v48 = 0;
}
else
{
LOWORD(v47) = 0;
}
std::string::reserve(&v47, 0);
v47 = v58;
v48 = v59;
v25 = (unsigned __int8)v58 >> 1;
v49 = v60;
if ( (v58 & 1) != 0 )
v25 = v59;
if ( v25 )
{
v58 = 0;
v59 = 0;
v60 = nullptr;
v31 = strlen(a2);
std::string::__init(&v58, a2, v31);
std::string::basic_string((unsigned __int64)v61, &v47);
std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args>(
(__int64)v39,
(__int64)&v58,
&v58);
if ( (v61[0] & 1) != 0 )
operator delete(v62);
if ( (v58 & 1) != 0 )
operator delete(v60);
v32 = v47;
v33 = v48;
v34 = v50;
a4[2] = (__int64)v49;
v47 = 0;
v48 = 0;
v49 = nullptr;
*a4 = v32;
a4[1] = v33;
if ( (v34 & 1) != 0 )
operator delete(v52);
goto LABEL_46;
}
if ( (v50 & 1) != 0 )
operator delete(v52);
++v22;
}
while ( v22 != 3 );
v19 = *((cocos2d::CCDirector **)this + 3);
v41 = (cocos2d::CCDirector *)((char *)v41 + 24);
if ( v19 != v41 )
continue;
break;
}
v18 = *((_QWORD *)this + 6);
LABEL_37:
v40 += 24;
}
while ( v18 != v40 );
LABEL_38:
v26 = v48;
if ( (v47 & 1) == 0 )
v26 = (unsigned __int8)v47 >> 1;
if ( v26 )
{
v58 = 0;
v59 = 0;
v60 = nullptr;
v27 = strlen(a2);
std::string::__init(&v58, a2, v27);
std::string::basic_string((unsigned __int64)v61, &v47);
std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args>(
(__int64)v39,
(__int64)&v58,
&v58);
if ( (v61[0] & 1) != 0 )
operator delete(v62);
if ( (v58 & 1) != 0 )
operator delete(v60);
v28 = v47;
v29 = v48;
a4[2] = (__int64)v49;
v47 = 0;
v48 = 0;
v49 = nullptr;
*a4 = v28;
a4[1] = v29;
}
else
{
*a4 = 0;
a4[1] = 0;
a4[2] = 0;
v35 = strlen(a2);
std::string::__init(a4, a2, v35);
}
LABEL_46:
if ( (v47 & 1) != 0 )
operator delete(v49);
if ( (v44 & 1) != 0 )
operator delete(v46);
LABEL_9:
if ( (v42[0] & 1) != 0 )
goto LABEL_12;
return a4;
}