//
// cocos2d::CCFileUtilsIOS::isFileExist from 0x1002d2d08 to 0x1002d2ef4 (492 bytes)
//
// 1 xrefs:
// > ??> @ 0x100920388
//
// 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 11:02:39 +0000
//
void *__fastcall cocos2d::CCFileUtilsIOS::isFileExist(int a1, std::string *__str)
{
const std::string *v2; // x19
std::string::size_type size; // x8
std::string *v4; // x10
_BOOL8 v6; // x19
std::string::size_type v7; // x9
std::string *v8; // x8
int v9; // t1
std::string::size_type v10; // x20
NSBundle *v11; // x19
std::string *p_p; // x2
NSString *v13; // x20
std::string *v14; // x2
std::string v15; // [xsp+8h] [xbp-78h] BYREF
std::string __p; // [xsp+20h] [xbp-60h] BYREF
std::string v17; // [xsp+40h] [xbp-40h] BYREF
std::allocator __a; // [xsp+5Fh] [xbp-21h] BYREF
v2 = __str;
size = SHIBYTE(__str->__r_.__value_.__r.__words[2]);
if ( (size & 0x8000000000000000LL) != 0 )
{
size = __str->__r_.__value_.__l.__size_;
if ( size )
{
v4 = (std::string *)__str->__r_.__value_.__r.__words[0];
if ( *__str->__r_.__value_.__l.__data_ != 47 )
{
memset(&v17, 0, sizeof(v17));
*(_OWORD *)&__p.__r_.__value_.__l.__data_ = 0u;
LABEL_11:
__p.__r_.__value_.__r.__words[2] = 0;
v7 = ~size;
v8 = (std::string *)((char *)v4 + size - 1);
do
{
if ( v7 == -1 )
goto LABEL_18;
v9 = (unsigned __int8)v8->__r_.__value_.__s.__data_[0];
v8 = (std::string *)((char *)v8 - 1);
++v7;
}
while ( v9 != 47 );
if ( !v7 )
{
LABEL_18:
std::string::operator=(&__p, __str);
goto LABEL_19;
}
v10 = -(__int64)v7;
std::string::basic_string(&v15, __str, -(__int64)v7, 0xFFFFFFFFFFFFFFFFLL, &__a);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
__p = v15;
std::string::basic_string(&v15, v2, 0, v10, &__a);
v17 = v15;
LABEL_19:
v11 = +[NSBundle mainBundle](&OBJC_CLASS___NSBundle, "mainBundle");
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
v13 = +[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", p_p);
if ( (v17.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v14 = &v17;
else
v14 = (std::string *)v17.__r_.__value_.__r.__words[0];
v6 = -[NSBundle pathForResource:ofType:inDirectory:](
v11,
"pathForResource:ofType:inDirectory:",
v13,
0,
+[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", v14)) != nullptr;
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( SHIBYTE(v17.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v17.__r_.__value_.__l.__data_);
return (void *)v6;
}
v2 = (const std::string *)__str->__r_.__value_.__r.__words[0];
return objc_msgSend(
(id)qword_1009F5C60,
"fileExistsAtPath:",
+[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", v2));
}
}
else if ( *((_BYTE *)&__str->__r_.__value_.__s + 23) )
{
if ( __str->__r_.__value_.__s.__data_[0] != 47 )
{
memset(&v17, 0, sizeof(v17));
*(_OWORD *)&__p.__r_.__value_.__l.__data_ = 0u;
v4 = __str;
goto LABEL_11;
}
return objc_msgSend(
(id)qword_1009F5C60,
"fileExistsAtPath:",
+[NSString stringWithUTF8String:](&OBJC_CLASS___NSString, "stringWithUTF8String:", v2));
}
return nullptr;
}