//
// cocos2d::CCDictionary::copyWithZone from 0x1004242c4 to 0x1004243bc (248 bytes)
//
// 1 xrefs:
// > ??> @ 0x100825d40
//
// 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::CCObject *__fastcall cocos2d::CCDictionary::copyWithZone(cocos2d::CCDictionary *a1, cocos2d::CCZone *a2)
{
cocos2d::CCDictionary *v3; // x19
cocos2d::CCDictionary::CCDictType m_eDictType; // w8
cocos2d::CCDictElement *v5; // x21
cocos2d::CCDictElement *next; // x22
cocos2d::CCObject *v7; // x20
cocos2d::CCDictElement *m_pElements; // x22
cocos2d::CCDictElement *v9; // x21
cocos2d::CCObject *v10; // x20
void *__p[2]; // [xsp+8h] [xbp-38h] BYREF
char v13; // [xsp+1Fh] [xbp-21h]
v3 = (cocos2d::CCDictionary *)operator new(0x48u);
cocos2d::CCObject::CCObject((__int64)v3);
v3->__vftable = (cocos2d::CCDictionary_vtbl *)off_100825D40;
v3->m_pElements = nullptr;
v3->m_eDictType = kCCDictUnknown;
m_eDictType = a1->m_eDictType;
if ( m_eDictType == kCCDictStr )
{
m_pElements = a1->m_pElements;
while ( m_pElements )
{
v9 = m_pElements;
m_pElements = (cocos2d::CCDictElement *)m_pElements->hh.next;
v10 = (cocos2d::CCObject *)sub_10008496C(v9->m_pObject);
sub_100009900(__p, v9->m_szKey);
cocos2d::CCDictionary::setObject_1((__int64)v3, v10, (__int64)__p);
if ( v13 < 0 )
operator delete(__p[0]);
cocos2d::CCObject::release(v10);
}
}
else if ( m_eDictType == kCCDictInt )
{
v5 = a1->m_pElements;
if ( v5 )
{
do
{
next = (cocos2d::CCDictElement *)v5->hh.next;
v7 = (cocos2d::CCObject *)sub_10008496C(v5->m_pObject);
cocos2d::CCDictionary::setObject(v3, v7, v5->m_iKey);
cocos2d::CCObject::release(v7);
v5 = next;
}
while ( next );
}
}
return v3;
}