//
// cocos2d::CCDictionary::createWithContentsOfFileThreadSafe from 0x100310000 to 0x1003100c8 (200 bytes)
//
// 3 xrefs:
// > CCContentManager::addDict @ 0x10018444a
// > cocos2d::CCDictionary::createWithContentsOfFile @ 0x100310116
// > cocos2d::CCSpriteFrameCache::removeSpriteFramesFromFile @ 0x10031d79f
//
// 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::CCDictionary *__fastcall cocos2d::CCDictionary::createWithContentsOfFileThreadSafe(const char *a1)
{
double v1; // xmm0_8
cocos2d::CCFileUtils *v2; // rbx
size_t v3; // rax
size_t v4; // r15
char *v5; // r12
size_t v6; // r13
cocos2d::CCDictionary *result; // rax
cocos2d::CCDictionary *v8; // rbx
_QWORD __dst[2]; // [rsp+0h] [rbp-40h] BYREF
void *__p; // [rsp+10h] [rbp-30h]
v2 = cocos2d::CCFileUtils::sharedFileUtils();
v3 = strlen(a1);
if ( v3 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v1);
v4 = v3;
if ( v3 >= 0x17 )
{
v6 = 26;
if ( (v3 | 7) != 0x17 )
v6 = (v3 | 7) + 1;
v5 = (char *)operator new(v6);
__p = v5;
__dst[0] = v6 + 1;
__dst[1] = v4;
goto LABEL_8;
}
LOBYTE(__dst[0]) = 2 * v3;
v5 = (char *)__dst + 1;
if ( v3 )
LABEL_8:
memcpy(v5, a1, v4);
v5[v4] = 0;
result = (cocos2d::CCDictionary *)((__int64 (__fastcall *)(cocos2d::CCFileUtils *, _QWORD *))v2->writeToFile)(
v2,
__dst);
if ( (__dst[0] & 1) != 0 )
{
v8 = result;
operator delete(__p);
return v8;
}
return result;
}