// // CCAnimateFrameCache::addCustomSpriteFramesWithFile from 0x10056b010 to 0x10056bb1c (2828 bytes) // // 0 xrefs: // // 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 // void __fastcall CCAnimateFrameCache::addCustomSpriteFramesWithFile(CCAnimateFrameCache *a1, const char *a2) { double v2; // xmm0_8 cocos2d::CCDictionary *m_animateDescriptions; // rbx size_t v4; // rax size_t v5; // r14 char *v6; // r15 size_t v7; // r12 __int64 v8; // rbx cocos2d::CCDictionary *v9; // rbx cocos2d::CCNode *v10; // r14 size_t v11; // rax size_t v12; // r15 char *v13; // r12 size_t v14; // r13 DS_Dictionary *v15; // rbx cocos2d::CCDictionary *DictForKey; // rax __int64 *p_dst; // rsi cocos2d::CCString *v18; // rbx const char *CString; // r14 const char *v20; // rdi size_t v21; // rax size_t v22; // rbx char *v23; // r15 size_t v24; // r12 char *v25; // rax unsigned __int64 v26; // r13 __int64 v27; // r14 unsigned __int64 v28; // rsi char *v29; // rdx unsigned __int64 v30; // r12 bool v31; // zf unsigned __int64 v32; // rbx char *v33; // r15 size_t v34; // rbx char *v35; // r12 char v36; // al const char *v37; // rbx size_t v38; // r13 size_t v39; // rax size_t v40; // r15 std::string::value_type *v41; // r12 size_t v42; // r13 __int64 v43; // rax __int64 v44; // rbx char *v45; // rax unsigned __int64 v46; // rsi char *v47; // rdx unsigned __int64 v48; // rdi __int64 v49; // r14 unsigned int v50; // ebx const char *v51; // rbx size_t v52; // rax std::string::size_type v53; // r15 char *data; // r14 size_t v55; // r12 size_t v56; // rax size_t v57; // r15 std::string::value_type *v58; // r14 size_t v59; // r12 signed __int64 v60; // r12 char *v61; // rbx unsigned __int128 v62; // kr00_16 std::string::size_type v63; // rbx const std::string::value_type *v64; // rcx std::string::size_type v65; // r8 size_t v66; // rax unsigned int v67; // ecx std::string::pointer v68; // rbx size_t v69; // rax size_t v70; // r15 char *v71; // r14 cocos2d::CCString *v72; // rax cocos2d::CCDictionary *v73; // rbx char v74; // r15 void *v75; // r14 const char *v76; // rdx size_t v77; // r12 signed __int64 v78; // rdx char *v79; // r13 int v80; // r14d char *v81; // r15 size_t v82; // rdx char *v83; // rax char *v84; // r15 std::string::size_type v85; // r15 const std::string::value_type *v86; // rcx std::string::size_type v87; // r8 size_t v88; // rax unsigned int v89; // r13d std::string::size_type v90; // r13 std::string::size_type v91; // rax std::string::size_type v92; // rax unsigned int v93; // [rsp+0h] [rbp-D0h] cocos2d::CCDictionary *v94; // [rsp+8h] [rbp-C8h] void *v95; // [rsp+10h] [rbp-C0h] __int64 v97; // [rsp+20h] [rbp-B0h] unsigned __int64 v98; // [rsp+28h] [rbp-A8h] cocos2d::CCString *v99; // [rsp+28h] [rbp-A8h] std::string::pointer v100; // [rsp+30h] [rbp-A0h] unsigned __int64 v102; // [rsp+40h] [rbp-90h] char v103; // [rsp+40h] [rbp-90h] std::string v104; // [rsp+48h] [rbp-88h] BYREF std::string::value_type __s[8]; // [rsp+60h] [rbp-70h] BYREF size_t v106; // [rsp+68h] [rbp-68h] void *v107; // [rsp+70h] [rbp-60h] __int64 v108; // [rsp+78h] [rbp-58h] BYREF unsigned __int64 v109; // [rsp+80h] [rbp-50h] void *v110; // [rsp+88h] [rbp-48h] __int64 __dst; // [rsp+90h] [rbp-40h] BYREF size_t __n; // [rsp+98h] [rbp-38h] void *__p; // [rsp+A0h] [rbp-30h] m_animateDescriptions = a1->m_animateDescriptions; v4 = strlen(a2); if ( v4 >= 0xFFFFFFFFFFFFFFF8LL ) goto LABEL_174; v5 = v4; if ( v4 >= 0x17 ) { v7 = 26; if ( (v4 | 7) != 0x17 ) v7 = (v4 | 7) + 1; v6 = (char *)operator new(v7); __p = v6; __dst = v7 + 1; __n = v5; goto LABEL_8; } LOBYTE(__dst) = 2 * v4; v6 = (char *)&__dst + 1; if ( v4 ) LABEL_8: memcpy(v6, a2, v5); v6[v5] = 0; v8 = cocos2d::CCDictionary::objectForKey_1((__int64)m_animateDescriptions, (char *)&__dst); if ( (__dst & 1) != 0 ) operator delete(__p); if ( !v8 ) { v9 = a1->m_animateDescriptions; v10 = cocos2d::CCNode::create(); v11 = strlen(a2); if ( v11 >= 0xFFFFFFFFFFFFFFF8LL ) goto LABEL_174; v12 = v11; if ( v11 >= 0x17 ) { v14 = 26; if ( (v11 | 7) != 0x17 ) v14 = (v11 | 7) + 1; v13 = (char *)operator new(v14); __p = v13; __dst = v14 + 1; __n = v12; } else { LOBYTE(__dst) = 2 * v11; v13 = (char *)&__dst + 1; if ( !v11 ) { LABEL_21: v13[v12] = 0; cocos2d::CCDictionary::setObject_1((__int64)v9, v10, (char *)&__dst); if ( (__dst & 1) != 0 ) operator delete(__p); v15 = (DS_Dictionary *)operator new(0xF0u); sub_100179B00(v15); DS_Dictionary::loadRootSubDictFromFile(v15, a2); DictForKey = DS_Dictionary::getDictForKey(v15, nullptr, 0); __dst = 0x736569706F630CLL; p_dst = &__dst; v94 = DictForKey; v18 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1((__int64)DictForKey, (char *)&__dst); if ( (__dst & 1) != 0 ) operator delete(__p); if ( !v18 ) return; CString = cocos2d::CCString::getCString(v18); v20 = CString; v21 = strlen(CString); if ( v21 < 0xFFFFFFFFFFFFFFF8LL ) { v22 = v21; if ( v21 >= 0x17 ) { v24 = 26; if ( (v21 | 7) != 0x17 ) v24 = (v21 | 7) + 1; v23 = (char *)operator new(v24); v110 = v23; v108 = v24 + 1; v109 = v22; } else { LOBYTE(v108) = 2 * v21; v23 = (char *)&v108 + 1; if ( !v21 ) { LABEL_34: v23[v22] = 0; v97 = sub_10071F9E0(v20, p_dst); if ( (v108 & 1) != 0 ) { v25 = (char *)v110; v26 = v109; v27 = -1; if ( !v109 ) goto LABEL_44; } else { v26 = (unsigned __int8)v108 >> 1; v25 = (char *)&v108 + 1; v27 = -1; if ( !((unsigned __int8)v108 >> 1) ) { LABEL_44: v30 = 0; v98 = v26; while ( 1 ) { if ( (v108 & 1) != 0 ) { v32 = v109; if ( v109 < v30 ) LABEL_172: sub_1000547C0(); v33 = (char *)v110; } else { v32 = (unsigned __int8)v108 >> 1; v33 = (char *)&v108 + 1; if ( v30 > v32 ) goto LABEL_172; } v34 = v32 - v30; if ( v34 >= v27 - v30 ) v34 = v27 - v30; if ( v34 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v102 = v30; if ( v34 >= 0x17 ) { v38 = (v34 | 7) + 1; if ( (v34 | 7) == 0x17 ) v38 = 26; v35 = (char *)operator new(v38); __p = v35; __dst = v38 | 1; __n = v34; v26 = v98; } else { LOBYTE(__dst) = 2 * v34; v35 = (char *)&__dst + 1; if ( !v34 ) { BYTE1(__dst) = 0; v36 = __dst; if ( (__dst & 1) == 0 ) goto LABEL_57; goto LABEL_64; } } memmove(v35, &v33[v102], v34); v35[v34] = 0; v36 = __dst; if ( (__dst & 1) == 0 ) { LABEL_57: v30 = v102; if ( !v36 && v102 == v26 ) goto LABEL_77; v37 = (char *)&__dst + 1; goto LABEL_67; } LABEL_64: v30 = v102; if ( !__n && v102 == v26 ) goto LABEL_77; v37 = (const char *)__p; LABEL_67: v39 = strlen(v37); if ( v39 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v40 = v39; if ( v39 >= 0x17 ) { v42 = (v39 | 7) + 1; if ( (v39 | 7) == 0x17 ) v42 = 26; v41 = (std::string::value_type *)operator new(v42); v107 = v41; *(_QWORD *)__s = v42 | 1; v106 = v40; v26 = v98; LABEL_74: memmove(v41, v37, v40); goto LABEL_75; } __s[0] = 2 * v39; v41 = &__s[1]; if ( v39 ) goto LABEL_74; LABEL_75: v41[v40] = 0; v43 = sub_1007AB360(__s); sub_10071FCD0(v97, v43); v30 = v102; if ( (__s[0] & 1) != 0 ) operator delete(v107); LABEL_77: v44 = -1; if ( v27 != -1 ) { if ( (v108 & 1) != 0 ) { v45 = (char *)v110; v46 = v109; v30 = v27 + 1; if ( v109 > v27 + 1 ) goto LABEL_84; } else { v46 = (unsigned __int8)v108 >> 1; v45 = (char *)&v108 + 1; v30 = v27 + 1; if ( v46 > v27 + 1 ) { LABEL_84: v47 = &v45[v30]; v48 = v46 + ~v27; while ( *v47 != 32 ) { ++v47; if ( !--v48 ) { v47 = &v45[v46]; break; } } v44 = v47 - v45; if ( v47 == &v45[v46] ) v44 = -1; } } } if ( (__dst & 1) != 0 ) operator delete(__p); v31 = v27 == -1; v27 = v44; if ( v31 ) { if ( (v108 & 1) != 0 ) operator delete(v110); v49 = v97; if ( !(unsigned int)sub_100720070(v97) ) return; v50 = 0; while ( 2 ) { v93 = v50; v99 = (cocos2d::CCString *)sub_1007200C0(v49, v50); v51 = cocos2d::CCString::getCString(v99); v52 = strlen(a2); if ( v52 >= 0xFFFFFFFFFFFFFFF8LL ) goto LABEL_174; v53 = v52; if ( v52 >= 0x17 ) { v55 = (v52 | 7) + 1; if ( (v52 | 7) == 0x17 ) v55 = 26; data = (char *)operator new(v55); v104.__r_.__value_.__r.__words[2] = (std::string::size_type)data; v104.__r_.__value_.__r.__words[0] = v55 + 1; v104.__r_.__value_.__l.__size_ = v53; } else { v104.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v52); data = v104.__r_.__value_.__s.__data_; if ( !v52 ) { LABEL_104: data[v53] = 0; LOBYTE(__dst) = 6; *(_DWORD *)((char *)&__dst + 1) = 8026488; v56 = strlen(v51); if ( v56 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v57 = v56; if ( v56 >= 0x17 ) { v59 = (v56 | 7) + 1; if ( (v56 | 7) == 0x17 ) v59 = 26; v58 = (std::string::value_type *)operator new(v59); v107 = v58; *(_QWORD *)__s = v59 | 1; v106 = v57; } else { __s[0] = 2 * v56; v58 = &__s[1]; if ( !v56 ) { LABEL_112: v58[v57] = 0; if ( (__dst & 1) != 0 ) { v60 = __n; v61 = (char *)__p; v95 = __p; v103 = __dst; if ( !__n ) goto LABEL_117; LABEL_114: if ( (*(_BYTE *)&v104.__r_.__value_.__s.0 & 1) != 0 ) v62 = *(_OWORD *)&v104.__r_.__value_.__r.__words[1]; else v62 = __PAIR128__( (std::string *)((char *)&v104.__r_.__value_.__l.0 + 1), *(_BYTE *)&v104.__r_.__value_.__l.0 >> 1); v100 = *((std::string::pointer *)&v62 + 1); while ( 2 ) { v78 = v62 - *((_QWORD *)&v62 + 1); if ( (_QWORD)v62 - *((_QWORD *)&v62 + 1) >= v60 ) { v79 = &v100[v62]; v80 = *v61; v81 = &v100[*((_QWORD *)&v62 + 1)]; while ( 1 ) { v82 = v78 - v60 + 1; if ( !v82 ) goto LABEL_128; v83 = (char *)memchr(v81, v80, v82); if ( !v83 ) goto LABEL_128; v84 = v83; if ( !memcmp(v83, v61, v60) ) break; v81 = v84 + 1; v78 = v79 - v81; if ( v79 - v81 < v60 ) goto LABEL_128; } if ( v84 == v79 ) break; v85 = v84 - v100; if ( v85 == -1 ) break; if ( (__s[0] & 1) != 0 ) { v86 = (const std::string::value_type *)v107; v87 = v106; } else { v87 = (unsigned __int8)__s[0] >> 1; v86 = &__s[1]; } std::string::replace(&v104, v85, v60, v86, v87); if ( (__s[0] & 1) != 0 ) { v88 = v106; v89 = (unsigned int)v104.__r_.__value_.__l.0; if ( (*(_BYTE *)&v104.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_167; } else { v88 = (unsigned __int8)__s[0] >> 1; v89 = (unsigned int)v104.__r_.__value_.__l.0; if ( (*(_BYTE *)&v104.__r_.__value_.__s.0 & 1) == 0 ) { LABEL_167: v90 = v89 >> 1; v100 = v104.__r_.__value_.__s.__data_; v91 = v85 + v88; v62 = __PAIR128__(v91, v90); if ( v90 >= v91 ) continue; break; } } v100 = v104.__r_.__value_.__l.__data_; v92 = v85 + v88; v62 = __PAIR128__(v92, v104.__r_.__value_.__l.__size_); if ( v104.__r_.__value_.__l.__size_ >= v92 ) continue; } break; } LABEL_128: if ( (__s[0] & 1) != 0 ) { operator delete(v107); if ( (v103 & 1) != 0 ) goto LABEL_134; LABEL_130: v68 = v104.__r_.__value_.__s.__data_; if ( (*(_BYTE *)&v104.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_131; LABEL_135: v68 = v104.__r_.__value_.__l.__data_; v69 = strlen(v104.__r_.__value_.__l.__data_); if ( v69 >= 0xFFFFFFFFFFFFFFF8LL ) LABEL_176: sub_100006BF0(v2); } else { if ( (v103 & 1) == 0 ) goto LABEL_130; LABEL_134: operator delete(v95); v68 = v104.__r_.__value_.__s.__data_; if ( (*(_BYTE *)&v104.__r_.__value_.__s.0 & 1) != 0 ) goto LABEL_135; LABEL_131: v69 = strlen(v104.__r_.__value_.__s.__data_); if ( v69 >= 0xFFFFFFFFFFFFFFF8LL ) goto LABEL_176; } v70 = v69; if ( v69 >= 0x17 ) { v77 = (v69 | 7) + 1; if ( (v69 | 7) == 0x17 ) v77 = 26; v71 = (char *)operator new(v77); v110 = v71; v108 = v77 | 1; v109 = v70; } else { LOBYTE(v108) = 2 * v69; v71 = (char *)&v108 + 1; if ( !v69 ) { BYTE1(v108) = 0; if ( (*(_BYTE *)&v104.__r_.__value_.__s.0 & 1) != 0 ) goto LABEL_139; goto LABEL_140; } } memmove(v71, v68, v70); v71[v70] = 0; if ( (*(_BYTE *)&v104.__r_.__value_.__s.0 & 1) != 0 ) LABEL_139: operator delete(v104.__r_.__value_.__l.__data_); LABEL_140: LOBYTE(__dst) = 6; *(_DWORD *)((char *)&__dst + 1) = 8026488; v72 = (cocos2d::CCString *)sub_1007AB360(&__dst); v73 = ObjectManager::replaceAllOccurencesOfString(v72, v99, v94); if ( (__dst & 1) != 0 ) operator delete(__p); v74 = v108 & 1; v75 = v110; v76 = (const char *)v110; if ( (v108 & 1) == 0 ) v76 = (char *)&v108 + 1; CCAnimateFrameCache::addDict(a1, v73, v76); if ( v74 ) operator delete(v75); v50 = v93 + 1; v49 = v97; if ( v93 + 1 >= (unsigned int)sub_100720070(v97) ) return; continue; } v60 = (unsigned __int8)__dst >> 1; v61 = (char *)&__dst + 1; v95 = __p; v103 = __dst; if ( (unsigned __int8)__dst >> 1 ) goto LABEL_114; LABEL_117: v63 = 0; while ( 1 ) { if ( v63 == -1 ) goto LABEL_128; if ( (__s[0] & 1) != 0 ) { v64 = (const std::string::value_type *)v107; v65 = v106; } else { v65 = (unsigned __int8)__s[0] >> 1; v64 = &__s[1]; } std::string::replace(&v104, v63, 0, v64, v65); if ( (__s[0] & 1) != 0 ) { v66 = v106; v67 = (unsigned int)v104.__r_.__value_.__l.0; if ( (*(_BYTE *)&v104.__r_.__value_.__s.0 & 1) != 0 ) goto LABEL_118; } else { v66 = (unsigned __int8)__s[0] >> 1; v67 = (unsigned int)v104.__r_.__value_.__l.0; if ( (*(_BYTE *)&v104.__r_.__value_.__s.0 & 1) != 0 ) { LABEL_118: v63 += v66; if ( v104.__r_.__value_.__l.__size_ < v63 ) goto LABEL_128; continue; } } v63 += v66; if ( v67 >> 1 < v63 ) goto LABEL_128; } } } memcpy(v58, v51, v57); goto LABEL_112; } } break; } memcpy(data, a2, v53); goto LABEL_104; } } } } v28 = v26; v29 = v25; while ( *v29 != 32 ) { ++v29; if ( !--v28 ) { v29 = &v25[v26]; break; } } v27 = -1; if ( v29 != &v25[v26] ) v27 = v29 - v25; goto LABEL_44; } } v20 = v23; p_dst = (__int64 *)CString; memmove(v23, CString, v22); goto LABEL_34; } LABEL_174: sub_100006BF0(v2); } } memcpy(v13, a2, v12); goto LABEL_21; } }