//
// cocos2d::CCFileUtils::getPathForFilename from 0x7e91cc to 0x7e9398 (460 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:00:56 +0000
//
int __fastcall cocos2d::CCFileUtils::getPathForFilename(
int a1,
int a2,
unsigned __int8 *a3,
unsigned __int8 *a4,
int a5)
{
int v9; // r4
bool v10; // zf
unsigned __int8 *v11; // r10
const char *v12; // r12
unsigned __int8 *v13; // r4
int v14; // t1
void *v15; // r0
int v16; // r4
size_t v17; // r4
_BYTE *v18; // r2
int v19; // r3
int v20; // r0
size_t v21; // r1
_BYTE *v22; // r2
char *v23; // r1
size_t v24; // r2
int v25; // r2
const void *v26; // r1
size_t v27; // r2
int v28; // r0
size_t v29; // r1
_BYTE *v30; // r2
unsigned __int8 *v32; // [sp+0h] [bp-24h]
const char *v33; // [sp+14h] [bp-10h]
int v34; // [sp+18h] [bp-Ch] BYREF
size_t v35; // [sp+1Ch] [bp-8h]
_BYTE *v36; // [sp+20h] [bp-4h]
int v37; // [sp+24h] [bp+0h] BYREF
size_t v38; // [sp+28h] [bp+4h]
_BYTE *v39; // [sp+2Ch] [bp+8h]
int v40; // [sp+30h] [bp+Ch] BYREF
size_t v41; // [sp+34h] [bp+10h]
_BYTE *v42; // [sp+38h] [bp+14h]
std::string::basic_string(&v34, (int)a3);
v37 = 0;
v38 = 0;
v39 = nullptr;
std::string::__init(&v37, &unk_B6B226, 0);
v9 = *a3;
v10 = (v9 & 1) == 0;
if ( (v9 & 1) != 0 )
{
v11 = *((unsigned __int8 **)a3 + 2);
}
else
{
v11 = a3 + 1;
v9 >>= 1;
}
v12 = "/";
if ( !v10 )
v9 = *((_DWORD *)a3 + 1);
v13 = &v11[v9];
while ( v13 != v11 )
{
v14 = *--v13;
v33 = v12;
v15 = memchr(v12, v14, 1u);
v12 = v33;
if ( v15 )
{
v16 = v13 - v11;
if ( v16 != -1 )
{
v17 = v16 + 1;
std::string::basic_string(&v40, a3, 0, v17);
v19 = v37 & 1;
if ( (v37 & 1) != 0 )
{
v18 = v39;
v19 = 0;
}
else
{
BYTE1(v37) = v37 & 1;
}
if ( (v37 & 1) != 0 )
{
*v18 = v19;
v38 = v19;
}
else
{
LOBYTE(v37) = v19;
}
std::string::reserve(&v37, 0);
v37 = v40;
v38 = v41;
v39 = v42;
v40 = 0;
v41 = 0;
v42 = nullptr;
std::string::~string((int)&v40);
v32 = a3;
std::string::basic_string(&v40, a3, v17, 0xFFFFFFFF);
if ( (v34 & 1) != 0 )
{
*v36 = 0;
v35 = 0;
}
else
{
LOWORD(v34) = 0;
}
std::string::reserve(&v34, 0);
v20 = v40;
v21 = v41;
v22 = v42;
v40 = 0;
v41 = 0;
v42 = nullptr;
v34 = v20;
v35 = v21;
v36 = v22;
std::string::~string((int)&v40);
}
break;
}
}
std::string::basic_string((int *)a1, a5);
if ( (v37 & 1) != 0 )
{
v23 = v39;
v24 = v38;
}
else
{
v24 = (int)(unsigned __int8)v37 >> 1;
v23 = (char *)&v37 + 1;
}
std::string::append((_DWORD *)a1, v23, v24);
v25 = *a4;
if ( (v25 & 1) != 0 )
{
v26 = *((const void **)a4 + 2);
v27 = *((_DWORD *)a4 + 1);
}
else
{
v26 = a4 + 1;
v27 = v25 >> 1;
}
std::string::append((_DWORD *)a1, v26, v27);
(*(void (__fastcall **)(int *, int, int, int *, unsigned __int8 *))(*(_DWORD *)a2 + 116))(&v40, a2, a1, &v34, v32);
if ( (*(_BYTE *)a1 & 1) != 0 )
{
**(_BYTE **)(a1 + 8) = 0;
*(_DWORD *)(a1 + 4) = 0;
}
else
{
*(_BYTE *)(a1 + 1) = 0;
*(_BYTE *)a1 = 0;
}
std::string::reserve((int *)a1, 0);
v28 = v40;
v29 = v41;
v30 = v42;
v40 = 0;
v41 = 0;
v42 = nullptr;
*(_DWORD *)a1 = v28;
*(_DWORD *)(a1 + 4) = v29;
*(_DWORD *)(a1 + 8) = v30;
std::string::~string((int)&v40);
std::string::~string((int)&v37);
std::string::~string((int)&v34);
return a1;
}