//
// cocos2d::CCSpriteFrameCache::addSpriteFramesWithDictionary from 0xd8ae74 to 0xd8b934 (2752 bytes)
//
// 3 xrefs:
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0xd8b970
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0xd8c658
// > ??> @ 0x9bd10
//
// 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 13:08:16 +0000
//
__int64 __fastcall cocos2d::CCSpriteFrameCache::addSpriteFramesWithDictionary(
cocos2d::CCSpriteFrameCache *this,
cocos2d::CCDictionary *a2,
cocos2d::CCTexture2D *a3)
{
__int64 v5; // x23
__int64 v6; // x19
cocos2d::CCString *v7; // x0
int v8; // w23
__int64 v9; // x26
__int64 i; // x19
size_t v11; // x0
size_t v12; // x25
__int64 v13; // x24
char *v14; // x3
_QWORD *v15; // x27
_DWORD *v16; // x24
unsigned __int64 v18; // x27
char *v19; // x0
cocos2d::CCString *v20; // x0
float v21; // s11
cocos2d::CCString *v22; // x0
float v23; // s10
cocos2d::CCString *v24; // x0
float v25; // s13
cocos2d::CCString *v26; // x0
float v27; // s12
cocos2d::CCString *v28; // x0
float v29; // s9
cocos2d::CCString *v30; // x0
float v31; // s8
cocos2d::CCString *v32; // x0
__int64 v33; // x26
cocos2d::CCString *v34; // x0
__int64 v35; // x25
_QWORD *v36; // x0
cocos2d::CCString *v37; // x0
char *CString; // x0
cocos2d::CCString *v39; // x0
char *v40; // x0
cocos2d::CCString *v41; // x0
char *v42; // x0
_QWORD *v43; // x0
cocos2d::CCString *v44; // x0
char *v45; // x0
cocos2d::CCString *v46; // x0
char *v47; // x0
cocos2d::CCString *v48; // x0
char *v49; // x0
cocos2d::CCString *v50; // x0
char *v51; // x0
cocos2d::CCString *v52; // x0
_QWORD *v53; // x24
_QWORD *v54; // x0
cocos2d::CCString *v55; // x0
char v56; // [xsp+A0h] [xbp+A0h]
char v57; // [xsp+A0h] [xbp+A0h]
float v59[2]; // [xsp+D0h] [xbp+D0h] BYREF
float v60; // [xsp+D8h] [xbp+D8h] BYREF
float v61; // [xsp+E0h] [xbp+E0h] BYREF
float v62[4]; // [xsp+E8h] [xbp+E8h] BYREF
_BYTE v63[16]; // [xsp+F8h] [xbp+F8h] BYREF
__int64 v64; // [xsp+108h] [xbp+108h] BYREF
size_t v65; // [xsp+110h] [xbp+110h]
void *v66; // [xsp+118h] [xbp+118h]
__int64 v67; // [xsp+120h] [xbp+120h] BYREF
__int64 v68; // [xsp+128h] [xbp+128h]
void *v69; // [xsp+130h] [xbp+130h]
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "metadata", 8u);
v5 = cocos2d::CCDictionary::objectForKey((__int64)a2, (__int64)&v67);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "frames", 6u);
v6 = cocos2d::CCDictionary::objectForKey((__int64)a2, (__int64)&v67);
if ( (v67 & 1) == 0 )
{
if ( v5 )
goto LABEL_5;
LABEL_26:
v8 = 0;
goto LABEL_7;
}
operator delete(v69);
if ( !v5 )
goto LABEL_26;
LABEL_5:
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "format", 6u);
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v5, (__int64)&v67);
v8 = cocos2d::CCString::intValue(v7);
if ( (v67 & 1) != 0 )
operator delete(v69);
LABEL_7:
if ( v6 )
{
v9 = *(_QWORD *)(v6 + 56);
if ( v9 )
{
for ( i = *(_QWORD *)(v9 + 288); ; i = *(_QWORD *)(i + 288) )
{
v64 = 0;
v65 = 0;
v66 = nullptr;
v11 = strlen((const char *)v9);
v12 = v11;
v13 = *(_QWORD *)(v9 + 264);
if ( v11 > 0x16 )
{
v18 = (v11 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v19 = (char *)operator new(v18);
v65 = v12;
v14 = v19;
v66 = v19;
v64 = v18 | 1;
}
else
{
LOBYTE(v64) = 2 * v11;
v14 = (char *)&v64 + 1;
if ( !v11 )
goto LABEL_12;
}
v14 = (char *)memcpy(v14, (const void *)v9, v12);
LABEL_12:
v14[v12] = 0;
v15 = (_QWORD *)cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 7), (__int64)&v64);
if ( v15 )
{
if ( (v64 & 1) == 0 )
goto LABEL_14;
}
else
{
if ( v8 )
{
if ( (unsigned int)(v8 - 1) <= 1 )
{
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "frame", 5u);
v37 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
CString = cocos2d::CCString::getCString(v37);
cocos2d::CCRectFromString((cocos2d *)CString, (cocos2d::CCRect *)v63);
if ( (v67 & 1) != 0 )
operator delete(v69);
v56 = 0;
if ( v8 == 2 )
{
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "rotated", 7u);
v55 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v56 = cocos2d::CCString::boolValue(v55);
if ( (v67 & 1) != 0 )
operator delete(v69);
}
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "offset", 6u);
v39 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v40 = cocos2d::CCString::getCString(v39);
cocos2d::CCPointFromString(&v61, (cocos2d *)v40);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "sourceSize", 0xAu);
v41 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v42 = cocos2d::CCString::getCString(v41);
cocos2d::CCSizeFromString((cocos2d *)v42, v62);
if ( (v67 & 1) != 0 )
operator delete(v69);
v43 = (_QWORD *)operator new(0xB8u);
v43[22] = 0;
*v43 = 0;
v43[1] = 0;
v43[2] = 0;
v43[3] = 0;
v43[4] = 0;
v43[5] = 0;
v43[6] = 0;
v43[7] = 0;
v43[8] = 0;
v43[9] = 0;
v43[10] = 0;
v43[11] = 0;
v43[12] = 0;
v43[13] = 0;
v43[14] = 0;
v43[15] = 0;
v43[16] = 0;
v43[17] = 0;
v43[18] = 0;
v43[19] = 0;
v43[20] = 0;
v43[21] = 0;
v15 = v43;
v16 = v43;
cocos2d::CCObject::CCObject((__int64)v43);
*v15 = &off_152ED40;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v15 + 7));
cocos2d::CCSize::CCSize((cocos2d::CCSize *)(v15 + 8));
cocos2d::CCRect::CCRect((cocos2d::CCRect *)(v15 + 9));
cocos2d::CCRect::CCRect((cocos2d::CCRect *)((char *)v15 + 92));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)((char *)v15 + 108));
cocos2d::CCSize::CCSize((cocos2d::CCSize *)((char *)v15 + 116));
v15[17] = 0;
v15[18] = 0;
v15[19] = 0;
v15[20] = 0;
v15[21] = 0;
v15[22] = 0;
cocos2d::CCSpriteFrame::initWithTexture(
(cocos2d::CCSpriteFrame *)v15,
a3,
(const cocos2d::CCRect *)v63,
v56,
(const cocos2d::CCPoint *)&v61,
(const cocos2d::CCSize *)v62);
}
else if ( v8 == 3 )
{
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "spriteSize", 0xAu);
v44 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v45 = cocos2d::CCString::getCString(v44);
cocos2d::CCSizeFromString((cocos2d *)v45, v59);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "spriteOffset", 0xCu);
v46 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v47 = cocos2d::CCString::getCString(v46);
cocos2d::CCPointFromString(&v60, (cocos2d *)v47);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "spriteSourceSize", 0x10u);
v48 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v49 = cocos2d::CCString::getCString(v48);
cocos2d::CCSizeFromString((cocos2d *)v49, &v61);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "textureRect", 0xBu);
v50 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v51 = cocos2d::CCString::getCString(v50);
cocos2d::CCRectFromString((cocos2d *)v51, (cocos2d::CCRect *)v62);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "textureRotated", 0xEu);
v52 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v57 = cocos2d::CCString::boolValue(v52);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "aliases", 7u);
cocos2d::CCDictionary::objectForKey(v13, (__int64)&v67);
if ( (v67 & 1) != 0 )
operator delete(v69);
v53 = (_QWORD *)operator new(0x50u);
cocos2d::CCString::CCString(v53, &v64);
cocos2d::CCObject::release(v53);
v54 = (_QWORD *)operator new(0xB8u);
v54[22] = 0;
*v54 = 0;
v54[1] = 0;
v54[2] = 0;
v54[3] = 0;
v54[4] = 0;
v54[5] = 0;
v54[6] = 0;
v54[7] = 0;
v54[8] = 0;
v54[9] = 0;
v54[10] = 0;
v54[11] = 0;
v54[12] = 0;
v54[13] = 0;
v54[14] = 0;
v54[15] = 0;
v54[16] = 0;
v54[17] = 0;
v54[18] = 0;
v54[19] = 0;
v54[20] = 0;
v54[21] = 0;
v15 = v54;
v16 = v54;
cocos2d::CCObject::CCObject((__int64)v54);
*v15 = &off_152ED40;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v15 + 7));
cocos2d::CCSize::CCSize((cocos2d::CCSize *)(v15 + 8));
cocos2d::CCRect::CCRect((cocos2d::CCRect *)(v15 + 9));
cocos2d::CCRect::CCRect((cocos2d::CCRect *)((char *)v15 + 92));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)((char *)v15 + 108));
cocos2d::CCSize::CCSize((cocos2d::CCSize *)((char *)v15 + 116));
v15[17] = 0;
v15[18] = 0;
v15[19] = 0;
v15[20] = 0;
v15[21] = 0;
v15[22] = 0;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v63, v62[0], v62[1], v59[0], v59[1]);
cocos2d::CCSpriteFrame::initWithTexture(
(cocos2d::CCSpriteFrame *)v15,
a3,
(const cocos2d::CCRect *)v63,
v57,
(const cocos2d::CCPoint *)&v60,
(const cocos2d::CCSize *)&v61);
}
else
{
v16 = nullptr;
}
}
else
{
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "x", 1u);
v20 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v21 = cocos2d::CCString::floatValue(v20);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "y", 1u);
v22 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v23 = cocos2d::CCString::floatValue(v22);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "width", 5u);
v24 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v25 = cocos2d::CCString::floatValue(v24);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "height", 6u);
v26 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v27 = cocos2d::CCString::floatValue(v26);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "offsetX", 7u);
v28 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v29 = cocos2d::CCString::floatValue(v28);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "offsetY", 7u);
v30 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v31 = cocos2d::CCString::floatValue(v30);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "originalWidth", 0xDu);
v32 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v33 = (int)cocos2d::CCString::intValue(v32);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "originalHeight", 0xEu);
v34 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (__int64)&v67);
v35 = (int)cocos2d::CCString::intValue(v34);
if ( (v67 & 1) != 0 )
operator delete(v69);
v36 = (_QWORD *)operator new(0xB8u);
*v36 = 0;
v36[1] = 0;
v36[2] = 0;
v36[3] = 0;
v36[4] = 0;
v36[5] = 0;
v36[6] = 0;
v36[7] = 0;
v36[8] = 0;
v36[9] = 0;
v36[10] = 0;
v36[11] = 0;
v36[12] = 0;
v36[13] = 0;
v36[14] = 0;
v36[15] = 0;
v36[16] = 0;
v36[17] = 0;
v36[18] = 0;
v36[19] = 0;
v36[20] = 0;
v36[21] = 0;
v36[22] = 0;
v15 = v36;
v16 = v36;
cocos2d::CCObject::CCObject((__int64)v36);
*v15 = &off_152ED40;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v15 + 7));
cocos2d::CCSize::CCSize((cocos2d::CCSize *)(v15 + 8));
cocos2d::CCRect::CCRect((cocos2d::CCRect *)(v15 + 9));
cocos2d::CCRect::CCRect((cocos2d::CCRect *)((char *)v15 + 92));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)((char *)v15 + 108));
cocos2d::CCSize::CCSize((cocos2d::CCSize *)((char *)v15 + 116));
v15[17] = 0;
v15[18] = 0;
v15[19] = 0;
v15[20] = 0;
v15[21] = 0;
v15[22] = 0;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v63, v21, v23, v25, v27);
cocos2d::CCPoint::CCPoint(&v61, v29, v31);
cocos2d::CCSize::CCSize(v62, (float)(int)abs64(v33), (float)(int)abs64(v35));
cocos2d::CCSpriteFrame::initWithTexture(
(cocos2d::CCSpriteFrame *)v15,
a3,
(const cocos2d::CCRect *)v63,
0,
(const cocos2d::CCPoint *)&v61,
(const cocos2d::CCSize *)v62);
}
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 7), (cocos2d::CCObject *)v15, (__int64)&v64);
cocos2d::CCObject::release(v16);
if ( (v64 & 1) == 0 )
{
LABEL_14:
if ( !i )
return _stack_chk_guard;
goto LABEL_15;
}
}
operator delete(v66);
if ( !i )
return _stack_chk_guard;
LABEL_15:
v9 = i;
}
}
}
return _stack_chk_guard;
}