//
// cocos2d::CCSpriteFrameCache::addSpriteFramesWithDictionary from 0x1003075c0 to 0x100308048 (2696 bytes)
//
// 3 xrefs:
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x100308148
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_1 @ 0x1003081a2
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_2 @ 0x100308402
//
// 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 12:28:35 +0000
//
void __fastcall cocos2d::CCSpriteFrameCache::addSpriteFramesWithDictionary(
__int64 a1,
__int64 a2,
__int64 a3,
double a4)
{
__int64 v5; // r15
__int64 v6; // rbx
void *v7; // rax
char *v8; // rbx
__int64 v9; // r12
char *v10; // r14
size_t v11; // rax
size_t v12; // r15
char *v13; // r14
__int64 v14; // r12
size_t v15; // r13
void *v16; // rax
__int64 v17; // rax
void *v18; // rax
unsigned __int8 v19; // r15
void *v20; // rax
void *v21; // rax
void *v22; // rax
void *v23; // rax
void *v24; // rax
void *v25; // rax
void *v26; // rax
int v27; // ebx
void *v28; // rax
int v29; // r14d
int v30; // r15d
int v31; // ebx
_OWORD *v32; // r12
void *v33; // rax
__int64 CString; // rax
void *v35; // rax
__int64 v36; // rax
void *v37; // rax
__int64 v38; // rax
void *v39; // rax
__int64 v40; // rax
void *v41; // rax
unsigned __int8 v42; // r15
void *v43; // r14
void *v44; // rax
__int64 v45; // rax
void *v46; // rax
__int64 v47; // rax
_BYTE v48[8]; // [rsp+0h] [rbp-C0h] BYREF
char *__s; // [rsp+8h] [rbp-B8h]
float v50[4]; // [rsp+14h] [rbp-ACh] BYREF
_BYTE v51[8]; // [rsp+24h] [rbp-9Ch] BYREF
float v52; // [rsp+2Ch] [rbp-94h]
unsigned int v53; // [rsp+30h] [rbp-90h]
unsigned int v54; // [rsp+34h] [rbp-8Ch]
float v55; // [rsp+38h] [rbp-88h]
float v56; // [rsp+3Ch] [rbp-84h]
__int64 v57; // [rsp+40h] [rbp-80h]
__int64 v58; // [rsp+48h] [rbp-78h]
__int64 (__fastcall **v59)(); // [rsp+50h] [rbp-70h]
float v60[2]; // [rsp+5Ch] [rbp-64h] BYREF
unsigned int v61; // [rsp+64h] [rbp-5Ch]
__int128 __dst; // [rsp+68h] [rbp-58h] BYREF
void *__p; // [rsp+78h] [rbp-48h]
void *v64[8]; // [rsp+80h] [rbp-40h] BYREF
v58 = a3;
LOBYTE(__dst) = 16;
strcpy((char *)&__dst + 1, "metadata");
v5 = cocos2d::CCDictionary::objectForKey(a2, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
LOBYTE(__dst) = 12;
*(_DWORD *)((char *)&__dst + 1) = 1835102822;
*(_WORD *)((char *)&__dst + 5) = 29541;
BYTE7(__dst) = 0;
v6 = cocos2d::CCDictionary::objectForKey(a2, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( !v5 )
{
v61 = 0;
if ( !v6 )
return;
goto LABEL_11;
}
LOBYTE(__dst) = 12;
*(_DWORD *)((char *)&__dst + 1) = 1836216166;
*(_WORD *)((char *)&__dst + 5) = 29793;
BYTE7(__dst) = 0;
v7 = cocos2d::CCDictionary::valueForKey(v5, (__int64)&__dst);
v61 = cocos2d::CCString::intValue(v7);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( v6 )
{
LABEL_11:
v8 = *(char **)(v6 + 56);
if ( !v8 )
return;
v9 = *((_QWORD *)v8 + 33);
v10 = *((char **)v8 + 36);
v11 = strlen(v8);
if ( v11 > 0xFFFFFFFFFFFFFFF7LL )
LABEL_76:
sub_100003630();
v12 = v11;
v59 = off_100B1F0D0;
while ( 1 )
{
__s = v10;
if ( v12 >= 0x17 )
break;
LOBYTE(__dst) = 2 * v12;
v13 = (char *)&__dst + 1;
if ( v12 )
goto LABEL_20;
LABEL_21:
v13[v12] = 0;
if ( !cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 56), (char *)&__dst) )
{
if ( v61 )
{
if ( v61 > 2 )
{
if ( v61 == 3 )
{
LOBYTE(v64[0]) = 20;
strcpy((char *)v64 + 1, "spriteSize");
v33 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
CString = cocos2d::CCString::getCString(v33);
cocos2d::CCSizeFromString(v60, CString);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
LOBYTE(v64[0]) = 24;
strcpy((char *)v64 + 1, "spriteOffset");
v35 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
v36 = cocos2d::CCString::getCString(v35);
cocos2d::CCPointFromString(v51, v36);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
strcpy((char *)v64, " spriteSourceSize");
v37 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
v38 = cocos2d::CCString::getCString(v37);
cocos2d::CCSizeFromString(v48, v38);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
LOBYTE(v64[0]) = 22;
strcpy((char *)v64 + 1, "textureRect");
v39 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
v40 = cocos2d::CCString::getCString(v39);
cocos2d::CCRectFromString(v50, v40);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
LOBYTE(v64[0]) = 28;
strcpy((char *)v64 + 1, "textureRotated");
v41 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
v42 = cocos2d::CCString::boolValue(v41);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
LOBYTE(v64[0]) = 14;
strcpy((char *)v64 + 1, "aliases");
cocos2d::CCDictionary::objectForKey(v9, (char *)v64);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
v43 = operator new(0x50u);
sub_10088DEE0(v43, &__dst);
cocos2d::CCObject::release(v43);
v32 = operator new(0xB8u);
v32[10] = 0;
v32[9] = 0;
v32[8] = 0;
v32[7] = 0;
v32[6] = 0;
v32[5] = 0;
v32[4] = 0;
v32[3] = 0;
v32[2] = 0;
v32[1] = 0;
*v32 = 0;
*((_QWORD *)v32 + 22) = 0;
cocos2d::CCObject::CCObject(v32);
*(_QWORD *)v32 = v59;
sub_1002782A0((_QWORD *)v32 + 7);
sub_100278600((_QWORD *)v32 + 8);
sub_1002787A0((_OWORD *)((char *)v32 + 72));
sub_1002787A0((_OWORD *)((char *)v32 + 92));
sub_1002782A0((_OWORD *)((char *)v32 + 108));
sub_100278600((_OWORD *)((char *)v32 + 116));
*(_OWORD *)((char *)v32 + 168) = 0;
*(_OWORD *)((char *)v32 + 152) = 0;
*(_OWORD *)((char *)v32 + 136) = 0;
*(_QWORD *)&a4 = LODWORD(v50[0]);
sub_100278270((__int64)v64, v50[0], v50[1], (__m128)LODWORD(v60[0]), (__m128)LODWORD(v60[1]));
cocos2d::CCSpriteFrame::initWithTexture(v32, v58, v64, v42, v51, v48);
}
else
{
v32 = nullptr;
}
}
else
{
strcpy((char *)v64, "\nframe");
v16 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
v17 = cocos2d::CCString::getCString(v16);
cocos2d::CCRectFromString(v50, v17);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
if ( v61 == 2 )
{
LOBYTE(v64[0]) = 14;
strcpy((char *)v64 + 1, "rotated");
v18 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
v19 = cocos2d::CCString::boolValue(v18);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
}
else
{
v19 = 0;
}
LOBYTE(v64[0]) = 12;
strcpy((char *)v64 + 1, "offset");
v44 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
v45 = cocos2d::CCString::getCString(v44);
cocos2d::CCPointFromString(v60, v45);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
LOBYTE(v64[0]) = 20;
strcpy((char *)v64 + 1, "sourceSize");
v46 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
v47 = cocos2d::CCString::getCString(v46);
cocos2d::CCSizeFromString(v51, v47);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
v32 = operator new(0xB8u);
v32[10] = 0;
v32[9] = 0;
v32[8] = 0;
v32[7] = 0;
v32[6] = 0;
v32[5] = 0;
v32[4] = 0;
v32[3] = 0;
v32[2] = 0;
v32[1] = 0;
*v32 = 0;
*((_QWORD *)v32 + 22) = 0;
cocos2d::CCObject::CCObject(v32);
*(_QWORD *)v32 = v59;
sub_1002782A0((_QWORD *)v32 + 7);
sub_100278600((_QWORD *)v32 + 8);
sub_1002787A0((_OWORD *)((char *)v32 + 72));
sub_1002787A0((_OWORD *)((char *)v32 + 92));
sub_1002782A0((_OWORD *)((char *)v32 + 108));
sub_100278600((_OWORD *)((char *)v32 + 116));
a4 = 0.0;
*(_OWORD *)((char *)v32 + 168) = 0;
*(_OWORD *)((char *)v32 + 152) = 0;
*(_OWORD *)((char *)v32 + 136) = 0;
cocos2d::CCSpriteFrame::initWithTexture(v32, v58, v50, v19, v60, v51);
}
}
else
{
LOWORD(v64[0]) = 30722;
BYTE2(v64[0]) = 0;
v20 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
*(float *)&a4 = cocos2d::CCString::floatValue(v20, a4);
LODWORD(v57) = LODWORD(a4);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
LOWORD(v64[0]) = 30978;
BYTE2(v64[0]) = 0;
v21 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
*(float *)&a4 = cocos2d::CCString::floatValue(v21, a4);
v52 = *(float *)&a4;
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
strcpy((char *)v64, "\nwidth");
v22 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
*(float *)&a4 = cocos2d::CCString::floatValue(v22, a4);
v53 = LODWORD(a4);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
LOBYTE(v64[0]) = 12;
strcpy((char *)v64 + 1, "height");
v23 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
*(float *)&a4 = cocos2d::CCString::floatValue(v23, a4);
v54 = LODWORD(a4);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
LOBYTE(v64[0]) = 14;
strcpy((char *)v64 + 1, "offsetX");
v24 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
*(float *)&a4 = cocos2d::CCString::floatValue(v24, a4);
v55 = *(float *)&a4;
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
LOBYTE(v64[0]) = 14;
strcpy((char *)v64 + 1, "offsetY");
v25 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
v56 = cocos2d::CCString::floatValue(v25, a4);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
LOBYTE(v64[0]) = 26;
strcpy((char *)v64 + 1, "originalWidth");
v26 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
v27 = cocos2d::CCString::intValue(v26);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
LOBYTE(v64[0]) = 28;
strcpy((char *)v64 + 1, "originalHeight");
v28 = cocos2d::CCDictionary::valueForKey(v9, (__int64)v64);
v29 = cocos2d::CCString::intValue(v28);
if ( ((__int64)v64[0] & 1) != 0 )
operator delete(v64[2]);
v30 = -v27;
if ( v27 > 0 )
v30 = v27;
v31 = -v29;
if ( v29 > 0 )
v31 = v29;
v32 = operator new(0xB8u);
v32[10] = 0;
v32[9] = 0;
v32[8] = 0;
v32[7] = 0;
v32[6] = 0;
v32[5] = 0;
v32[4] = 0;
v32[3] = 0;
v32[2] = 0;
v32[1] = 0;
*v32 = 0;
*((_QWORD *)v32 + 22) = 0;
cocos2d::CCObject::CCObject(v32);
*(_QWORD *)v32 = v59;
sub_1002782A0((_QWORD *)v32 + 7);
sub_100278600((_QWORD *)v32 + 8);
sub_1002787A0((_OWORD *)((char *)v32 + 72));
sub_1002787A0((_OWORD *)((char *)v32 + 92));
sub_1002782A0((_OWORD *)((char *)v32 + 108));
sub_100278600((_OWORD *)((char *)v32 + 116));
*(_OWORD *)((char *)v32 + 168) = 0;
*(_OWORD *)((char *)v32 + 152) = 0;
*(_OWORD *)((char *)v32 + 136) = 0;
sub_100278270((__int64)v64, *(float *)&v57, v52, (__m128)v53, (__m128)v54);
sub_100278250(v50, v55, v56);
HIDWORD(a4) = 0;
*(float *)&a4 = (float)v30;
sub_100278260(v60, (float)v30, (float)v31);
cocos2d::CCSpriteFrame::initWithTexture(v32, v58, v64, 0, v50, v60);
}
cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 56), (__int64)v32, (char *)&__dst);
cocos2d::CCObject::release(v32);
}
if ( (__dst & 1) != 0 )
operator delete(__p);
v8 = __s;
if ( !__s )
return;
v9 = *((_QWORD *)__s + 33);
v10 = *((char **)__s + 36);
v12 = strlen(__s);
if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_76;
}
v57 = v9;
v14 = a1;
v15 = (v12 | 7) + 1;
if ( (v12 | 7) == 0x17 )
v15 = 26;
v13 = (char *)operator new(v15);
__p = v13;
*(_QWORD *)&__dst = v15 + 1;
a1 = v14;
v9 = v57;
*((_QWORD *)&__dst + 1) = v12;
LABEL_20:
memmove(v13, v8, v12);
goto LABEL_21;
}
}