//
// cocos2d::CCAnimationCache::parseVersion2 from 0x18008aab0 to 0x18008b0d6 (1574 bytes)
//
// 3 xrefs:
// > cocos2d::CCAnimationCache::addAnimationsWithDictionary @ 0x18008a66e
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b5a9c
//
// 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
//
// Hidden C++ exception states: #wind=4
void __fastcall cocos2d::CCAnimationCache::parseVersion2(
cocos2d::CCAnimationCache *this,
struct cocos2d::CCDictionary *a2)
{
cocos2d::CCSpriteFrameCache *v3; // r14
cocos2d::CCDictElement *m_pElements; // rsi
cocos2d::CCDictElement *i; // rdi
__int64 m_pObject; // r13
cocos2d::CCString *v7; // r15
void *v8; // rcx
cocos2d::CCString *v9; // rax
void *v10; // rcx
cocos2d::CCArray *v11; // rbx
void *v12; // rcx
unsigned int v13; // eax
cocos2d::CCArray *v14; // r12
cocos2d::ccArray *data; // rcx
__int64 num; // rdx
__int64 *arr; // rdi
__int64 *v18; // r15
__int64 v19; // rbx
cocos2d::CCString *v20; // rax
std::string *CString; // rsi
void *v22; // rcx
struct cocos2d::CCSpriteFrame *v23; // r14
cocos2d::CCString *v24; // rax
float v25; // xmm6_4
void *v26; // rcx
struct cocos2d::CCDictionary *v27; // rsi
void *v28; // rcx
cocos2d::CCAnimationFrame *v29; // rax
cocos2d::CCAnimationFrame *v30; // rbx
cocos2d::CCString *v31; // rax
float v32; // xmm6_4
void *v33; // rcx
cocos2d::CCAnimation *v34; // rax
cocos2d::CCAnimation *v35; // rbx
unsigned int v36; // eax
cocos2d::CCSpriteFrameCache *v37; // rax
bool v38; // [rsp+28h] [rbp-59h]
cocos2d::CCDictElement *v39; // [rsp+30h] [rbp-51h]
cocos2d::CCString *v40; // [rsp+38h] [rbp-49h]
cocos2d::CCDictElement *v41; // [rsp+40h] [rbp-41h]
cocos2d::CCSpriteFrameCache *v42; // [rsp+48h] [rbp-39h]
__int128 v43; // [rsp+60h] [rbp-21h] BYREF
__int64 v44; // [rsp+70h] [rbp-11h]
unsigned __int64 v45; // [rsp+78h] [rbp-9h]
__int128 v46; // [rsp+80h] [rbp-1h] BYREF
__int64 v47; // [rsp+90h] [rbp+Fh]
unsigned __int64 v48; // [rsp+98h] [rbp+17h]
v3 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v42 = v3;
if ( a2 )
{
m_pElements = a2->m_pElements;
v41 = m_pElements;
if ( m_pElements )
{
for ( i = (cocos2d::CCDictElement *)m_pElements->hh.next; ; i = (cocos2d::CCDictElement *)i->hh.next )
{
v39 = i;
m_pObject = (__int64)m_pElements->m_pObject;
v46 = 0;
v47 = 5;
v48 = 15;
strcpy((char *)&v46, "loops");
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(m_pObject, (unsigned __int8 *)&v46);
v40 = v7;
if ( v48 > 0xF )
{
v8 = (void *)v46;
if ( v48 + 1 >= 0x1000 )
{
v8 = *(void **)(v46 - 8);
if ( (unsigned __int64)(v46 - (_QWORD)v8 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v8);
}
v47 = 0;
v48 = 15;
LOBYTE(v46) = 0;
v43 = 0;
v44 = 0;
v45 = 15;
*(_QWORD *)&v43 = operator new(0x20u);
v44 = 20;
v45 = 31;
strcpy((char *)v43, "restoreOriginalFrame");
v9 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(m_pObject, (unsigned __int8 *)&v43);
v38 = cocos2d::CCString::boolValue(v9);
if ( v45 > 0xF )
{
v10 = (void *)v43;
if ( v45 + 1 >= 0x1000 )
{
v10 = *(void **)(v43 - 8);
if ( (unsigned __int64)(v43 - (_QWORD)v10 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v10);
}
v43 = 0;
v44 = 6;
v45 = 15;
strcpy((char *)&v43, "frames");
v11 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(m_pObject, (unsigned __int8 *)&v43);
if ( v45 > 0xF )
{
v12 = (void *)v43;
if ( v45 + 1 >= 0x1000 )
{
v12 = *(void **)(v43 - 8);
if ( (unsigned __int64)(v43 - (_QWORD)v12 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v12);
}
v44 = 0;
v45 = 15;
LOBYTE(v43) = 0;
if ( v11 )
{
v13 = cocos2d::CCArray::count(v11);
v14 = cocos2d::CCArray::createWithCapacity(v13);
cocos2d::CCObject::retain(v14);
data = v11->data;
num = data->num;
if ( (_DWORD)num )
{
arr = (__int64 *)data->arr;
v18 = &arr[num - 1];
if ( arr <= v18 )
{
do
{
v19 = *arr;
if ( !*arr )
break;
v44 = 11;
v45 = 15;
*(_QWORD *)&v43 = 0x7266657469727073LL;
*((_QWORD *)&v43 + 1) = 6647137;
v20 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v19, (unsigned __int8 *)&v43);
CString = cocos2d::CCString::getCString(v20);
if ( v45 > 0xF )
{
v22 = (void *)v43;
if ( v45 + 1 >= 0x1000 )
{
v22 = *(void **)(v43 - 8);
if ( (unsigned __int64)(v43 - (_QWORD)v22 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v22);
}
v44 = 0;
v45 = 15;
LOBYTE(v43) = 0;
v23 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v3, CString->m_data.m_smallStorage._Elems);
if ( v23 )
{
*((_QWORD *)&v43 + 1) = 29556;
v44 = 10;
v45 = 15;
*(_QWORD *)&v43 = 0x696E5579616C6564LL;
v24 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v19, (unsigned __int8 *)&v43);
v25 = cocos2d::CCString::floatValue(v24);
if ( v45 > 0xF )
{
v26 = (void *)v43;
if ( v45 + 1 >= 0x1000 )
{
v26 = *(void **)(v43 - 8);
if ( (unsigned __int64)(v43 - (_QWORD)v26 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v26);
}
v44 = 12;
v45 = 15;
strcpy((char *)&v43, "notification");
BYTE13(v43) = 0;
HIWORD(v43) = 0;
v27 = (struct cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(
v19,
(unsigned __int8 *)&v43);
if ( v45 > 0xF )
{
v28 = (void *)v43;
if ( v45 + 1 >= 0x1000 )
{
v28 = *(void **)(v43 - 8);
if ( (unsigned __int64)(v43 - (_QWORD)v28 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v28);
}
v44 = 0;
v45 = 15;
LOBYTE(v43) = 0;
v29 = (cocos2d::CCAnimationFrame *)operator new(0x50u);
if ( v29 )
v30 = cocos2d::CCAnimationFrame::CCAnimationFrame(v29);
else
v30 = nullptr;
cocos2d::CCAnimationFrame::initWithSpriteFrame(v30, v23, v25, v27);
cocos2d::CCArray::addObject(v14, v30);
cocos2d::CCObject::release(v30);
}
++arr;
v3 = v42;
}
while ( arr <= v18 );
m_pElements = v41;
}
i = v39;
v7 = v40;
}
v44 = 12;
v45 = 15;
strcpy((char *)&v43, "delayPerUnit");
BYTE13(v43) = 0;
HIWORD(v43) = 0;
v31 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(m_pObject, (unsigned __int8 *)&v43);
v32 = cocos2d::CCString::floatValue(v31);
if ( v45 > 0xF )
{
v33 = (void *)v43;
if ( v45 + 1 >= 0x1000 )
{
v33 = *(void **)(v43 - 8);
if ( (unsigned __int64)(v43 - (_QWORD)v33 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v33);
}
v34 = (cocos2d::CCAnimation *)operator new(0x58u);
if ( v34 )
v35 = cocos2d::CCAnimation::CCAnimation(v34);
else
v35 = nullptr;
if ( (unsigned int)cocos2d::CCString::length(v7) )
v36 = cocos2d::CCString::uintValue(v7);
else
v36 = 1;
cocos2d::CCAnimation::initWithAnimationFrames(v35, (struct cocos2d::CCDictionary *)v14, v32, v36);
cocos2d::CCObject::release(v14);
v35->m_bRestoreOriginalFrame = v38;
v37 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCAnimationCache::sharedAnimationCache();
cocos2d::CCSpriteFrameCache::addSpriteFrame(v37, (struct cocos2d::CCSpriteFrame *)v35, m_pElements->m_szKey);
cocos2d::CCObject::release(v35);
}
m_pElements = i;
v41 = i;
if ( !i )
break;
}
}
}
}