//
// PlatformToolbox::getRawPath from 0x1004c4910 to 0x1004c4a1b (267 bytes)
//
// 0 xrefs:
//
// 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
//
_QWORD *__fastcall PlatformToolbox::getRawPath(_QWORD *a1, __int64 a2, double a3)
{
__int64 v3; // rdx
NSString *v4; // r14
NSArray *v5; // rax
id v6; // rax
id v7; // rax
const char *v8; // r15
size_t v9; // rax
size_t v10; // r14
void *v11; // r12
size_t v12; // r13
if ( (*(_BYTE *)a2 & 1) != 0 )
v3 = *(_QWORD *)(a2 + 16);
else
v3 = a2 + 1;
v4 = +[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", v3);
v5 = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, 1u, 1);
v6 = -[NSArray objectAtIndex:](v5, "objectAtIndex:", 0);
v7 = objc_msgSend(v6, "stringByAppendingPathComponent:", v4);
v8 = (const char *)objc_msgSend(v7, "cStringUsingEncoding:", 4);
v9 = strlen(v8);
if ( v9 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a3);
v10 = v9;
if ( v9 >= 0x17 )
{
v12 = 26;
if ( (v9 | 7) != 0x17 )
v12 = (v9 | 7) + 1;
v11 = operator new(v12);
a1[2] = v11;
*a1 = v12 + 1;
a1[1] = v10;
}
else
{
*(_BYTE *)a1 = 2 * v9;
v11 = (char *)a1 + 1;
if ( !v9 )
goto LABEL_12;
}
memmove(v11, v8, v10);
LABEL_12:
*((_BYTE *)v11 + v10) = 0;
return a1;
}