//
// cocos2d::CCFileUtils::sharedFileUtils from 0xb0b430 to 0xb0b5cc (412 bytes)
//
// 67 xrefs:
// > PlatformToolbox::doesFileExist @ 0x4ecd3c
// > GameToolbox::saveStringToFile @ 0x582c40
// > FMODAudioEngine::createStream @ 0x5abdf0
// > FMODAudioEngine::preloadEffectAsync @ 0x5b20e8
// > FMODAudioEngine::preloadEffect @ 0x5b4a50
// > AppDelegate::applicationDidFinishLaunching @ 0x5be064
// > GameManager::unloadBackground @ 0x5ebde8
// > GameManager::reloadAllStep2 @ 0x5eedcc
// > GameManager::recountUserStats @ 0x5f9c20
// > LocalLevelManager::tryLoadMainLevelString @ 0x7ea368
// > MusicDownloadManager::pathForSFXFolder @ 0x82efc4
// > MusicDownloadManager::pathForSFXFolder @ 0x82f018
// > MusicDownloadManager::isSFXDownloaded @ 0x82f5a4
// > MusicDownloadManager::pathForSongFolder @ 0x82f7d0
// > MusicDownloadManager::pathForSongFolder @ 0x82f824
// > MusicDownloadManager::isSongDownloaded @ 0x82fbf0
// > MusicDownloadManager::parseSFXLibrary @ 0x830890
// > MusicDownloadManager::parseMusicLibrary @ 0x83821c
// > cocos2d::extension::AssetsManager::setSearchPath @ 0xa98bd8
// > cocos2d::extension::AssetsManager::setSearchPath @ 0xa98cb0
// > cocos2d::CCDictionary::createWithContentsOfFileThreadSafe @ 0xad16d8
// > cocos2d::CCDictionary::writeToFile @ 0xad17e8
// > cocos2d::CCString::createWithContentsOfFile @ 0xad3c70
// > cocos2d::CCArray::createWithContentsOfFileThreadSafe @ 0xad3db0
// > cocos2d::CCLabelAtlas::initWithString @ 0xae1d40
// > cocos2d::CCBMFontConfiguration::parseImageFileName @ 0xae3220
// > cocos2d::CCBMFontConfiguration::parseConfigFile @ 0xae4e50
// > cocos2d::CCRenderTexture::saveToFile @ 0xafa514
// > cocos2d::CCParticleSystem::initWithDictionary @ 0xb01760
// > cocos2d::CCParticleSystem::initWithDictionary @ 0xb01774
// > cocos2d::CCParticleSystem::initWithDictionary @ 0xb0179c
// > cocos2d::CCParticleSystem::initWithFile @ 0xb0196c
// > cocos2d::CCSAXParser::parse @ 0xb040e0
// > cocos2d::CCImage::initWithImageFileThreadSafe @ 0xb0c6ac
// > cocos2d::CCImage::initWithImageFile @ 0xb0c774
// > cocos2d::CCImage::initWithImageFile @ 0xb0c790
// > cocos2d::CCImage::initWithString @ 0xb0d494
// > cocos2d::CCImage::initWithStringShadowStroke @ 0xb0d8c8
// > cocos2d::CCGLProgram::initWithVertexShaderFilename @ 0xb10cd0
// > cocos2d::CCGLProgram::initWithVertexShaderFilename @ 0xb10d10
// > cocos2d::CCAnimationCache::addAnimationsWithDictionary @ 0xb14564
// > cocos2d::CCAnimationCache::addAnimationsWithFile @ 0xb1471c
// > cocos2d::CCSpriteFrameCache::removeSpriteFramesFromFile @ 0xb1b6fc
// > sub_B1F9A4 @ 0xb1fa00
// > cocos2d::tgaLoad @ 0xb21f1c
// > cocos2d::ZipUtils::ccInflateCCZFile @ 0xb2aadc
// > cocos2d::CCTextureCache::addETCImage @ 0xb34090
// > cocos2d::CCTextureCache::removeTextureForKey @ 0xb34334
// > cocos2d::CCTextureCache::textureForKey @ 0xb34410
// > cocos2d::CCTextureCache::addPVRImage @ 0xb34da8
// > cocos2d::CCTextureCache::addImage @ 0xb34f24
// > cocos2d::CCTextureCache::reloadTexture @ 0xb35448
// > cocos2d::CCTextureCache::addUIImage @ 0xb35604
// > cocos2d::VolatileTexture::reloadAllTextures @ 0xb35ce8
// > cocos2d::CCTextureCache::addImageAsync @ 0xb36708
// > cocos2d::CCTextureETC::initWithFile @ 0xb37190
// > cocos2d::CCTexturePVR::initWithContentsOfFile @ 0xb37dec
// > cocos2d::CCTMXMapInfo::internalInit @ 0xb3bc14
// > cocos2d::CCTMXMapInfo::parseXMLFile @ 0xb3c014
// > cocos2d::CCTMXMapInfo::startElement @ 0xb3c6d4
// > cocos2d::CCTileMapAtlas::loadTGAfile @ 0xb3dedc
// > FileOperation::getFilePath @ 0xb414c8
// > DS_Dictionary::loadRootSubDictFromFile @ 0xb47b2c
// > DS_Dictionary::loadRootSubDictFromFile @ 0xb47b5c
// > DS_Dictionary::loadRootSubDictFromFile @ 0xb47c70
// > DS_Dictionary::loadRootSubDictFromCompressedFile @ 0xb47e6c
// > ??> @ 0x75930
//
// 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
//
cocos2d::CCFileUtils *cocos2d::CCFileUtils::sharedFileUtils()
{
cocos2d::CCFileUtils *result; // x0
cocos2d::CCFileUtilsAndroid *v1; // x25
char *ApkPath; // x0
cocos2d::ZipFile *v3; // x21
char *v4; // x0
char *v5; // x0
unsigned int *v6; // x1
int v7; // w2
unsigned int *v8; // x1
int v9; // w2
__int64 v10; // [xsp+0h] [xbp+0h] BYREF
std::string v11; // [xsp+68h] [xbp+68h] BYREF
std::string v12; // [xsp+70h] [xbp+70h] BYREF
result = (cocos2d::CCFileUtils *)cocos2d::CCFileUtils::s_sharedFileUtils;
if ( !cocos2d::CCFileUtils::s_sharedFileUtils )
{
v1 = (cocos2d::CCFileUtilsAndroid *)operator new(0x80u);
cocos2d::CCFileUtilsAndroid::CCFileUtilsAndroid(v1);
cocos2d::CCFileUtils::s_sharedFileUtils = (__int64)v1;
((void (__fastcall *)(cocos2d::CCFileUtilsAndroid *))v1->removeSearchPath)(v1);
ApkPath = (char *)getApkPath();
sub_D153B8((unsigned int)&v10 + 104, ApkPath);
sub_D153B8((int)&v12, "assets/");
v3 = (cocos2d::ZipFile *)operator new(0x18u);
cocos2d::ZipFile::ZipFile(v3, &v11, &v12);
v4 = (char *)v12.m_data.m_data - 24;
qword_1245848 = (__int64)v3;
if ( (__int64 *)v12.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)((char *)v12.m_data.m_data - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *((_DWORD *)v12.m_data.m_data - 2);
*((_DWORD *)v12.m_data.m_data - 2) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v4);
}
v5 = (char *)v11.m_data.m_data - 24;
if ( (__int64 *)v11.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)((char *)v11.m_data.m_data - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *((_DWORD *)v11.m_data.m_data - 2);
*((_DWORD *)v11.m_data.m_data - 2) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v5);
}
return (cocos2d::CCFileUtils *)cocos2d::CCFileUtils::s_sharedFileUtils;
}
return result;
}