// // ObjectManager::replaceAllOccurencesOfString from 0x100796490 to 0x100796fc8 (2872 bytes) // // 3 xrefs: // > CCAnimateFrameCache::addCustomSpriteFramesWithFile @ 0x10056b8e9 // > ObjectManager::loadCopiedSets @ 0x100795e99 // > ObjectManager::replaceAllOccurencesOfString @ 0x100796c8d // // 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) { double v3; // xmm0_8 const char *CString; // r15 size_t v5; // rax size_t v6; // r14 char *v7; // r12 size_t v8; // r13 const char *v9; // r14 size_t v10; // rax size_t v11; // r15 char *v12; // r12 size_t v13; // r13 cocos2d::CCDictionary *v14; // rbx unsigned int v15; // eax cocos2d::CCString *v16; // rax const char *v17; // r15 const char *v18; // rbx size_t v19; // rax std::string::size_type v20; // r12 char *data; // r13 __int64 v22; // rax size_t v23; // r14 size_t v24; // rax std::string::size_type v25; // r12 char *v26; // r13 __int64 v27; // rax size_t v28; // r14 size_t v29; // rax size_t v30; // r15 char *v31; // r12 __int64 v32; // rax size_t v33; // r14 std::string::pointer v34; // rbx size_t v35; // rax size_t v36; // r15 char *v37; // r12 size_t v38; // rax std::string::size_type v39; // rbx char *v40; // r15 size_t v41; // r14 __int64 v42; // rax size_t v43; // r14 std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v44; // r14 std::string::pointer v45; // rbx size_t v46; // rdx char *v47; // rdi unsigned __int128 v48; // kr00_16 bool v49; // zf bool v50; // r15 bool v51; // r12 size_t v52; // rax std::string::size_type v53; // rbx char *v54; // r15 __int64 v55; // rax size_t v56; // r14 cocos2d::CCObject *v57; // rbx size_t v58; // rax std::string::size_type v59; // rbx char *v60; // r15 __int64 v61; // rax size_t v62; // r14 cocos2d::CCArray *v63; // rbx char *v64; // r14 cocos2d::CCString *v65; // r13 const char *v66; // r15 size_t v67; // rax std::string::size_type v68; // r12 char *v69; // rbx __int64 v70; // rax size_t v71; // r14 cocos2d::CCDictionary *v72; // r15 cocos2d::CCDictionary *v73; // r15 const char *v74; // r13 size_t v75; // rax std::string::size_type v76; // r12 char *v77; // rbx const char *v78; // r15 size_t v79; // rax std::string::size_type v80; // r12 char *v81; // rbx __int64 v82; // rax size_t v83; // r14 __int64 v84; // rax size_t v85; // r14 const char *v86; // r15 size_t v87; // rax size_t v88; // r12 char *v89; // rbx size_t v90; // r14 cocos2d::CCObject *v91; // r15 const char *v92; // r13 size_t v93; // rax size_t v94; // r12 char *v95; // rbx __int64 v96; // rax size_t v97; // r14 _QWORD __dst[2]; // [rsp+10h] [rbp-E0h] BYREF void *v101; // [rsp+20h] [rbp-D0h] _QWORD v102[2]; // [rsp+28h] [rbp-C8h] BYREF void *v103; // [rsp+38h] [rbp-B8h] cocos2d::CCString *v104; // [rsp+40h] [rbp-B0h] __int64 __s1; // [rsp+48h] [rbp-A8h] BYREF size_t v106; // [rsp+50h] [rbp-A0h] void *v107; // [rsp+58h] [rbp-98h] std::string __src; // [rsp+60h] [rbp-90h] BYREF cocos2d::CCArray *v109; // [rsp+78h] [rbp-78h] unsigned int i; // [rsp+84h] [rbp-6Ch] cocos2d::CCDictionary *v111; // [rsp+88h] [rbp-68h] __int64 v112; // [rsp+90h] [rbp-60h] BYREF size_t v113; // [rsp+98h] [rbp-58h] void *__p; // [rsp+A0h] [rbp-50h] char *__s; // [rsp+A8h] [rbp-48h] std::string v116[2]; // [rsp+B0h] [rbp-40h] BYREF v104 = a2; CString = cocos2d::CCString::getCString(a1); v5 = strlen(CString); if ( v5 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v6 = v5; if ( v5 >= 0x17 ) { v8 = 26; if ( (v5 | 7) != 0x17 ) v8 = (v5 | 7) + 1; v7 = (char *)operator new(v8); v101 = v7; __dst[0] = v8 + 1; __dst[1] = v6; goto LABEL_8; } LOBYTE(__dst[0]) = 2 * v5; v7 = (char *)__dst + 1; if ( v5 ) LABEL_8: memmove(v7, CString, v6); v7[v6] = 0; v9 = cocos2d::CCString::getCString(v104); v10 = strlen(v9); if ( v10 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v11 = v10; if ( v10 >= 0x17 ) { v13 = 26; if ( (v10 | 7) != 0x17 ) v13 = (v10 | 7) + 1; v12 = (char *)operator new(v13); v103 = v12; v102[0] = v13 | 1; v102[1] = v11; goto LABEL_16; } LOBYTE(v102[0]) = 2 * v10; v12 = (char *)v102 + 1; if ( v10 ) LABEL_16: memmove(v12, v9, v11); v12[v11] = 0; v14 = cocos2d::CCDictionary::createWithDictionary(); cocos2d::CCObject::retain(v14); v111 = v14; v109 = cocos2d::CCDictionary::allKeys(v14); for ( i = 0; ; ++i ) { v15 = sub_100720070((__int64)v109); if ( i >= v15 ) break; v16 = (cocos2d::CCString *)sub_1007200C0((__int64)v109, i); __s = (char *)cocos2d::CCString::getCString(v16); v17 = cocos2d::CCString::getCString(a1); v18 = cocos2d::CCString::getCString(v104); v19 = strlen(__s); if ( v19 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v20 = v19; if ( v19 >= 0x17 ) { v22 = v19 | 7; v23 = 26; if ( (v20 | 7) != 0x17 ) v23 = v22 + 1; data = (char *)operator new(v23); __src.__r_.__value_.__r.__words[2] = (std::string::size_type)data; __src.__r_.__value_.__r.__words[0] = v23 | 1; __src.__r_.__value_.__l.__size_ = v20; LABEL_27: memcpy(data, __s, v20); goto LABEL_28; } __src.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v19); data = __src.__r_.__value_.__s.__data_; if ( v19 ) goto LABEL_27; LABEL_28: data[v20] = 0; v24 = strlen(v17); if ( v24 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v25 = v24; if ( v24 >= 0x17 ) { v27 = v24 | 7; v28 = 26; if ( (v25 | 7) != 0x17 ) v28 = v27 + 1; v26 = (char *)operator new(v28); v116[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v26; v116[0].__r_.__value_.__r.__words[0] = v28 | 1; v116[0].__r_.__value_.__l.__size_ = v25; LABEL_35: memcpy(v26, v17, v25); goto LABEL_36; } v116[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v24); v26 = v116[0].__r_.__value_.__s.__data_; if ( v24 ) goto LABEL_35; LABEL_36: v26[v25] = 0; v29 = strlen(v18); if ( v29 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v30 = v29; if ( v29 >= 0x17 ) { v32 = v29 | 7; v33 = 26; if ( (v30 | 7) != 0x17 ) v33 = v32 + 1; v31 = (char *)operator new(v33); __p = v31; v112 = v33 | 1; v113 = v30; LABEL_43: memcpy(v31, v18, v30); goto LABEL_44; } LOBYTE(v112) = 2 * v29; v31 = (char *)&v112 + 1; if ( v29 ) goto LABEL_43; LABEL_44: v31[v30] = 0; sub_100596B20(&__src, (unsigned __int8 *)v116, (unsigned __int8 *)&v112); if ( (v112 & 1) != 0 ) { operator delete(__p); if ( (*(_BYTE *)&v116[0].__r_.__value_.__s.0 & 1) == 0 ) { LABEL_46: v34 = __src.__r_.__value_.__s.__data_; if ( (*(_BYTE *)&__src.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_47; goto LABEL_51; } } else if ( (*(_BYTE *)&v116[0].__r_.__value_.__s.0 & 1) == 0 ) { goto LABEL_46; } operator delete(v116[0].__r_.__value_.__l.__data_); v34 = __src.__r_.__value_.__s.__data_; if ( (*(_BYTE *)&__src.__r_.__value_.__s.0 & 1) == 0 ) { LABEL_47: v35 = strlen(__src.__r_.__value_.__s.__data_); if ( v35 >= 0xFFFFFFFFFFFFFFF8LL ) goto LABEL_164; goto LABEL_52; } LABEL_51: v34 = __src.__r_.__value_.__l.__data_; v35 = strlen(__src.__r_.__value_.__l.__data_); if ( v35 >= 0xFFFFFFFFFFFFFFF8LL ) LABEL_164: sub_100006BF0(v3); LABEL_52: v36 = v35; if ( v35 >= 0x17 ) { v41 = (v35 | 7) + 1; if ( (v35 | 7) == 0x17 ) v41 = 26; v37 = (char *)operator new(v41); v107 = v37; __s1 = v41 | 1; v106 = v36; } else { LOBYTE(__s1) = 2 * v35; v37 = (char *)&__s1 + 1; if ( !v35 ) { BYTE1(__s1) = 0; if ( (*(_BYTE *)&__src.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_56; LABEL_55: operator delete(__src.__r_.__value_.__l.__data_); goto LABEL_56; } } memmove(v37, v34, v36); v37[v36] = 0; if ( (*(_BYTE *)&__src.__r_.__value_.__s.0 & 1) != 0 ) goto LABEL_55; LABEL_56: v38 = strlen(__s); if ( v38 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v39 = v38; if ( v38 >= 0x17 ) { v42 = v38 | 7; v43 = 26; if ( (v39 | 7) != 0x17 ) v43 = v42 + 1; v40 = (char *)operator new(v43); v116[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v40; v116[0].__r_.__value_.__r.__words[0] = v43 | 1; v116[0].__r_.__value_.__l.__size_ = v39; LABEL_68: memmove(v40, __s, v39); goto LABEL_69; } v116[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v38); v40 = v116[0].__r_.__value_.__s.__data_; if ( v38 ) goto LABEL_68; LABEL_69: v40[v39] = 0; v44 = v116[0].__r_.__value_.__s.0; v45 = v116[0].__r_.__value_.__l.__data_; if ( (__s1 & 1) != 0 ) { v46 = v106; v47 = (char *)v107; if ( (*(_BYTE *)&v116[0].__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_71; } else { v46 = (unsigned __int8)__s1 >> 1; v47 = (char *)&__s1 + 1; if ( (*(_BYTE *)&v116[0].__r_.__value_.__s.0 & 1) == 0 ) { LABEL_71: v48 = __PAIR128__( (std::string *)((char *)&v116[0].__r_.__value_.__l.0 + 1), *(_BYTE *)&v116[0].__r_.__value_.__l.0 >> 1); goto LABEL_74; } } v48 = *(_OWORD *)&v116[0].__r_.__value_.__r.__words[1]; LABEL_74: v49 = (_QWORD)v48 == v46; if ( (unsigned __int64)v48 < v46 ) v46 = v48; v50 = v49; v51 = memcmp(v47, *((const void **)&v48 + 1), v46) == 0; if ( (*(_BYTE *)&v44 & 1) != 0 ) operator delete(v45); if ( !v50 || !v51 ) { v52 = strlen(__s); if ( v52 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v53 = v52; if ( v52 >= 0x17 ) { v55 = v52 | 7; v56 = 26; if ( (v53 | 7) != 0x17 ) v56 = v55 + 1; v54 = (char *)operator new(v56); v116[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v54; v116[0].__r_.__value_.__r.__words[0] = v56 | 1; v116[0].__r_.__value_.__l.__size_ = v53; } else { v116[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v52); v54 = v116[0].__r_.__value_.__s.__data_; if ( !v52 ) { LABEL_87: v54[v53] = 0; v57 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey_1((__int64)v111, (char *)v116); if ( (*(_BYTE *)&v116[0].__r_.__value_.__s.0 & 1) != 0 ) operator delete(v116[0].__r_.__value_.__l.__data_); cocos2d::CCDictionary::setObject_1((__int64)v111, v57, (char *)&__s1); v58 = strlen(__s); if ( v58 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v59 = v58; if ( v58 >= 0x17 ) { v61 = v58 | 7; v62 = 26; if ( (v59 | 7) != 0x17 ) v62 = v61 + 1; v60 = (char *)operator new(v62); v116[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v60; v116[0].__r_.__value_.__r.__words[0] = v62 | 1; v116[0].__r_.__value_.__l.__size_ = v59; } else { v116[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v58); v60 = v116[0].__r_.__value_.__s.__data_; if ( !v58 ) { LABEL_97: v60[v59] = 0; cocos2d::CCDictionary::removeObjectForKey_1((__int64)v111, (char *)v116); if ( (*(_BYTE *)&v116[0].__r_.__value_.__s.0 & 1) != 0 ) operator delete(v116[0].__r_.__value_.__l.__data_); goto LABEL_99; } } memmove(v60, __s, v59); goto LABEL_97; } } memmove(v54, __s, v53); goto LABEL_87; } LABEL_99: if ( (__s1 & 1) != 0 ) operator delete(v107); } v63 = cocos2d::CCDictionary::allKeys(v111); v64 = nullptr; v109 = v63; while ( (unsigned int)v64 < (unsigned int)sub_100720070((__int64)v63) ) { __s = v64; v65 = (cocos2d::CCString *)sub_1007200C0((__int64)v63, (unsigned int)v64); v66 = cocos2d::CCString::getCString(v65); v67 = strlen(v66); if ( v67 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v68 = v67; if ( v67 >= 0x17 ) { v70 = v67 | 7; v71 = 26; if ( (v68 | 7) != 0x17 ) v71 = v70 + 1; v69 = (char *)operator new(v71); v116[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v69; v116[0].__r_.__value_.__r.__words[0] = v71 | 1; v116[0].__r_.__value_.__l.__size_ = v68; LABEL_111: memmove(v69, v66, v68); goto LABEL_112; } v116[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v67); v69 = v116[0].__r_.__value_.__s.__data_; if ( v67 ) goto LABEL_111; LABEL_112: v69[v68] = 0; v72 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey_1((__int64)v111, (char *)v116); if ( (*(_BYTE *)&v116[0].__r_.__value_.__s.0 & 1) != 0 ) operator delete(v116[0].__r_.__value_.__l.__data_); if ( v72 ) { if ( __dynamic_cast( v72, (const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject, (const struct __class_type_info *)&`typeinfo for'cocos2d::CCDictionary, 0) ) { v73 = ObjectManager::replaceAllOccurencesOfString(a1, v104, v72); v74 = cocos2d::CCString::getCString(v65); v75 = strlen(v74); if ( v75 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v76 = v75; if ( v75 >= 0x17 ) { v82 = v75 | 7; v83 = 26; if ( (v76 | 7) != 0x17 ) v83 = v82 + 1; v77 = (char *)operator new(v83); v116[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v77; v116[0].__r_.__value_.__r.__words[0] = v83 | 1; v116[0].__r_.__value_.__l.__size_ = v76; } else { v116[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v75); v77 = v116[0].__r_.__value_.__s.__data_; if ( !v75 ) { LABEL_128: v77[v76] = 0; cocos2d::CCDictionary::setObject_1((__int64)v111, v73, (char *)v116); LABEL_155: if ( (*(_BYTE *)&v116[0].__r_.__value_.__s.0 & 1) != 0 ) operator delete(v116[0].__r_.__value_.__l.__data_); goto LABEL_102; } } memmove(v77, v74, v76); goto LABEL_128; } v78 = cocos2d::CCString::getCString((cocos2d::CCString *)v72); v79 = strlen(v78); if ( v79 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v80 = v79; if ( v79 >= 0x17 ) { v84 = v79 | 7; v85 = 26; if ( (v80 | 7) != 0x17 ) v85 = v84 + 1; v81 = (char *)operator new(v85); v116[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v81; v116[0].__r_.__value_.__r.__words[0] = v85 | 1; v116[0].__r_.__value_.__l.__size_ = v80; } else { v116[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v79); v81 = v116[0].__r_.__value_.__s.__data_; if ( !v79 ) { LABEL_133: v81[v80] = 0; sub_100596B20(v116, (unsigned __int8 *)__dst, (unsigned __int8 *)v102); v86 = v116[0].__r_.__value_.__s.__data_; if ( (*(_BYTE *)&v116[0].__r_.__value_.__s.0 & 1) != 0 ) v86 = v116[0].__r_.__value_.__l.__data_; v87 = strlen(v86); if ( v87 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v88 = v87; if ( v87 >= 0x17 ) { v90 = (v87 | 7) + 1; if ( (v87 | 7) == 0x17 ) v90 = 26; v89 = (char *)operator new(v90); __p = v89; v112 = v90 | 1; v113 = v88; } else { LOBYTE(v112) = 2 * v87; v89 = (char *)&v112 + 1; if ( !v87 ) { LABEL_143: v89[v88] = 0; v91 = (cocos2d::CCObject *)sub_1007AB360(&v112); if ( (v112 & 1) != 0 ) operator delete(__p); v92 = cocos2d::CCString::getCString(v65); v93 = strlen(v92); if ( v93 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v3); v94 = v93; if ( v93 >= 0x17 ) { v96 = v93 | 7; v97 = 26; if ( (v94 | 7) != 0x17 ) v97 = v96 + 1; v95 = (char *)operator new(v97); __p = v95; v112 = v97 | 1; v113 = v94; } else { LOBYTE(v112) = 2 * v93; v95 = (char *)&v112 + 1; if ( !v93 ) { LABEL_153: v95[v94] = 0; cocos2d::CCDictionary::setObject_1((__int64)v111, v91, (char *)&v112); if ( (v112 & 1) != 0 ) operator delete(__p); goto LABEL_155; } } memmove(v95, v92, v94); goto LABEL_153; } } memmove(v89, v86, v88); goto LABEL_143; } } memmove(v81, v78, v80); goto LABEL_133; } LABEL_102: v64 = (char *)(unsigned int)((_DWORD)__s + 1); v63 = v109; } if ( (v102[0] & 1) != 0 ) operator delete(v103); if ( (__dst[0] & 1) != 0 ) operator delete(v101); return v111; }
GD Web Decomp Icon

GD Web Decomp

Raw Source