//
// cocos2d::CCConfiguration::loadConfigFile from 0x1800c0f20 to 0x1800c12ef (975 bytes)
//
// 2 xrefs:
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c339c
//
// This function is hookable on this platform (idp: pc, 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:22:25 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall cocos2d::CCConfiguration::loadConfigFile(cocos2d::CCConfiguration *this, const char *a2)
{
struct cocos2d::CCDictionary *v3; // rdi
__int64 v4; // rbx
void *v5; // r8
cocos2d::CCString *v6; // rbx
void *v7; // r8
__int64 v8; // rdi
void *v9; // r8
__int64 v10; // rdi
__int64 v11; // rbx
__int64 v12; // r14
void *v13; // rcx
void *v14; // rcx
cocos2d::CCDirector *v15; // rax
void *v16[2]; // [rsp+30h] [rbp-50h] BYREF
__m128i v17; // [rsp+40h] [rbp-40h]
void *Block[2]; // [rsp+50h] [rbp-30h] BYREF
__m128i si128; // [rsp+60h] [rbp-20h]
v3 = cocos2d::CCDictionary::createWithContentsOfFile(a2);
sub_180005A10(Block, "metadata");
v4 = cocos2d::CCDictionary::objectForKey((__int64)v3, (__int64)Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v5 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v5);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);
LOBYTE(Block[0]) = 0;
if ( v4
&& _RTDynamicCast(
v4,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCDictionary `RTTI Type Descriptor',
0) )
{
*(_OWORD *)v16 = 0;
v17 = _mm_load_si128((const __m128i *)&xmmword_180109E30);
strcpy((char *)v16, "format");
v6 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v4, (__int64)v16);
if ( v17.m128i_i64[1] > 0xFuLL )
{
v7 = v16[0];
if ( (unsigned __int64)(v17.m128i_i64[1] + 1) >= 0x1000 )
{
v7 = *((void **)v16[0] - 1);
if ( (unsigned __int64)((char *)v16[0] - (char *)v7 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v7);
}
v17 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);
LOBYTE(v16[0]) = 0;
if ( v6
&& _RTDynamicCast(v6, 0, &cocos2d::CCObject `RTTI Type Descriptor', &cocos2d::CCString `RTTI Type Descriptor', 0)
&& cocos2d::CCString::uintValue(v6) == 1 )
{
*(_OWORD *)v16 = 0;
v17 = _mm_load_si128((const __m128i *)&xmmword_18010D960);
strcpy((char *)v16, "data");
v8 = cocos2d::CCDictionary::objectForKey((__int64)v3, (__int64)v16);
if ( v17.m128i_i64[1] > 0xFuLL )
{
v9 = v16[0];
if ( (unsigned __int64)(v17.m128i_i64[1] + 1) >= 0x1000 )
{
v9 = *((void **)v16[0] - 1);
if ( (unsigned __int64)((char *)v16[0] - (char *)v9 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v9);
}
v17 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);
LOBYTE(v16[0]) = 0;
if ( v8
&& _RTDynamicCast(
v8,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCDictionary `RTTI Type Descriptor',
0) )
{
v10 = *(_QWORD *)(v8 + 56);
if ( v10 )
v11 = *(_QWORD *)(v10 + 288);
else
v11 = 0;
while ( v10 )
{
sub_180005A10(Block, (char *)v10);
v12 = cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 11), (__int64)Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v13 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v13 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v13 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v13);
}
if ( !v12 )
{
sub_180005A10(Block, (char *)v10);
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 11), *(cocos2d::CCObject **)(v10 + 264), (__int64)Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v14 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v14 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v14 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v14);
}
}
v10 = v11;
if ( v11 )
v11 = *(_QWORD *)(v11 + 288);
else
v11 = 0;
}
v15 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::setDefaultValues(v15);
}
}
}
}