//
// ObjectManager::replaceAllOccurencesOfString from 0x10024d8a0 to 0x10024dc38 (920 bytes)
//
// 2 xrefs:
// > ObjectManager::loadCopiedSets @ 0x10024d534
// > ObjectManager::replaceAllOccurencesOfString @ 0x10024db24
//
// 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::CCDictionary *__fastcall ObjectManager::replaceAllOccurencesOfString(
cocos2d::CCString *a1,
cocos2d::CCString *a2,
cocos2d::CCDictionary *a3)
{
char *CString; // x0
char *v6; // x0
cocos2d::CCDictionary *v7; // x21
cocos2d::CCArray *v8; // x22
unsigned int i; // w23
cocos2d::CCString *v10; // x0
char *v11; // x24
char *v12; // x26
char *v13; // x25
std::string *v14; // x1
bool v15; // w0
bool v16; // w25
__int64 v17; // x25
cocos2d::CCArray *v18; // x22
unsigned int j; // w23
cocos2d::CCString *v20; // x26
char *v21; // x0
__int64 v22; // x0
cocos2d::CCDictionary *v23; // x27
cocos2d::CCDictionary *v24; // x27
char *v25; // x0
char *v26; // x0
std::string *v27; // x0
char *v28; // x1
__int64 v29; // x27
char *v30; // x0
std::string v32; // [xsp+0h] [xbp-E0h] BYREF
void *v33[2]; // [xsp+18h] [xbp-C8h] BYREF
char v34; // [xsp+2Fh] [xbp-B1h]
void *v35[2]; // [xsp+30h] [xbp-B0h] BYREF
char v36; // [xsp+47h] [xbp-99h]
void *v37[2]; // [xsp+48h] [xbp-98h] BYREF
char v38; // [xsp+5Fh] [xbp-81h]
void *__p[2]; // [xsp+60h] [xbp-80h] BYREF
char v40; // [xsp+77h] [xbp-69h]
char __s[8]; // [xsp+78h] [xbp-68h] BYREF
char v42; // [xsp+8Fh] [xbp-51h]
CString = (char *)cocos2d::CCString::getCString(a1);
sub_100009900(v37, CString);
v6 = (char *)cocos2d::CCString::getCString(a2);
sub_100009900(v35, v6);
v7 = cocos2d::CCDictionary::createWithDictionary();
cocos2d::CCObject::retain(v7);
v8 = cocos2d::CCDictionary::allKeys(v7);
for ( i = 0; i < (unsigned int)sub_10024A36C((__int64)v8); ++i )
{
v10 = (cocos2d::CCString *)sub_10024A388((__int64)v8, i);
v11 = (char *)cocos2d::CCString::getCString(v10);
v12 = (char *)cocos2d::CCString::getCString(a1);
v13 = (char *)cocos2d::CCString::getCString(a2);
sub_100009900(&v32, v11);
sub_100009900(__s, v12);
sub_100009900(__p, v13);
sub_10015AEF8(&v32, __s, (__int64)__p);
if ( v40 < 0 )
operator delete(__p[0]);
if ( v42 < 0 )
operator delete(*(void **)__s);
if ( (v32.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v14 = &v32;
else
v14 = (std::string *)v32.__r_.__value_.__r.__words[0];
sub_100009900(v33, (char *)v14);
if ( SHIBYTE(v32.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v32.__r_.__value_.__l.__data_);
sub_100009900(__s, v11);
v15 = sub_1000045BC(v33, __s);
v16 = v15;
if ( v42 < 0 )
{
operator delete(*(void **)__s);
if ( v16 )
goto LABEL_20;
}
else if ( v15 )
{
goto LABEL_20;
}
sub_100009900(__s, v11);
v17 = cocos2d::CCDictionary::objectForKey_1(v7, __s);
if ( v42 < 0 )
operator delete(*(void **)__s);
cocos2d::CCDictionary::setObject_1(v7, v17, v33);
sub_100009900(__s, v11);
cocos2d::CCDictionary::removeObjectForKey_1((int)v7, __s);
if ( v42 < 0 )
operator delete(*(void **)__s);
LABEL_20:
if ( v34 < 0 )
operator delete(v33[0]);
}
v18 = cocos2d::CCDictionary::allKeys(v7);
for ( j = 0; j < (unsigned int)sub_10024A36C((__int64)v18); ++j )
{
v20 = (cocos2d::CCString *)sub_10024A388((__int64)v18, j);
v21 = (char *)cocos2d::CCString::getCString(v20);
sub_100009900(__s, v21);
v22 = cocos2d::CCDictionary::objectForKey_1(v7, __s);
v23 = (cocos2d::CCDictionary *)v22;
if ( v42 < 0 )
{
operator delete(*(void **)__s);
if ( !v23 )
continue;
}
else if ( !v22 )
{
continue;
}
if ( __dynamic_cast(
v23,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCDictionary,
0) )
{
v24 = ObjectManager::replaceAllOccurencesOfString(a1, a2, v23);
v25 = (char *)cocos2d::CCString::getCString(v20);
sub_100009900(__s, v25);
cocos2d::CCDictionary::setObject_1(v7, v24, __s);
}
else
{
v26 = (char *)cocos2d::CCString::getCString((cocos2d::CCString *)v23);
v27 = (std::string *)sub_100009900(__s, v26);
sub_10015AEF8(v27, (char *)v37, (__int64)v35);
if ( v42 >= 0 )
v28 = __s;
else
v28 = *(char **)__s;
sub_100009900(__p, v28);
v29 = sub_100268E48(__p);
if ( v40 < 0 )
operator delete(__p[0]);
v30 = (char *)cocos2d::CCString::getCString(v20);
sub_100009900(__p, v30);
cocos2d::CCDictionary::setObject_1(v7, v29, __p);
if ( v40 < 0 )
operator delete(__p[0]);
}
if ( v42 < 0 )
operator delete(*(void **)__s);
}
if ( v36 < 0 )
operator delete(v35[0]);
if ( v38 < 0 )
operator delete(v37[0]);
return v7;
}