// // cocos2d::CCBMFontConfiguration::parseConfigFile from 0x1002f8f1c to 0x1002f98b4 (2456 bytes) // // 1 xrefs: // > cocos2d::CCBMFontConfiguration::create @ 0x1002f8e94 // // 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 // std::set *__fastcall cocos2d::CCBMFontConfiguration::parseConfigFile( cocos2d::CCBMFontConfiguration *a1, const char *a2) { cocos2d::CCFileUtils *v4; // x0 const char *v5; // x0 cocos2d::CCString *v6; // x22 std::set *v7; // x21 char *CString; // x0 __int64 v9; // x26 std::string::size_type v10; // x0 std::string::size_type v11; // x22 _BOOL4 v14; // w19 bool v15; // zf _BOOL4 v19; // w19 _BOOL4 v22; // w19 _BOOL4 v25; // w19 int v26; // w19 cocos2d::tCCFontDefHashElement *v27; // x0 cocos2d::tCCFontDefHashElement *v28; // x22 void *v30; // x0 _BOOL4 v32; // w19 int32x2_t **p_hh; // x19 cocos2d::tCCFontDefHashElement *m_pFontDefDictionary; // x8 UT_hash_table *tbl; // x23 UT_hash_handle *tail; // x9 UT_hash_table *v37; // x0 UT_hash_bucket *v38; // x0 int v39; // w9 unsigned int v40; // w10 unsigned int v41; // w11 int v42; // w9 unsigned int v43; // w10 unsigned int v44; // w11 int v45; // w9 unsigned int v46; // w9 __int64 v47; // x9 unsigned int v48; // w8 UT_hash_handle *v49; // x10 __int64 v50; // x21 const char *v51; // x26 char *v52; // x0 char *v53; // x24 unsigned int num_items; // w10 __int64 num_buckets; // x8 int v56; // w9 unsigned int v57; // w10 UT_hash_bucket *buckets; // x0 int v59; // w11 __int64 i; // x12 UT_hash_handle *hh_head; // x13 UT_hash_handle *hh_next; // x14 char *v63; // x15 unsigned int v64; // w16 UT_hash_handle *v65; // x16 int32x2_t *v66; // x8 int32x2_t v67; // d0 int32x2_t v68; // d1 unsigned int v69; // w9 std::set *v71; // [xsp+8h] [xbp-188h] std::string v72; // [xsp+10h] [xbp-180h] BYREF std::string __p; // [xsp+30h] [xbp-160h] BYREF std::string v74; // [xsp+50h] [xbp-140h] BYREF std::string __dst; // [xsp+70h] [xbp-120h] BYREF std::string __s; // [xsp+90h] [xbp-100h] BYREF std::string v77; // [xsp+A8h] [xbp-E8h] BYREF std::string __str; // [xsp+C0h] [xbp-D0h] BYREF std::string v79; // [xsp+E0h] [xbp-B0h] BYREF void *v80[2]; // [xsp+100h] [xbp-90h] BYREF char v81; // [xsp+117h] [xbp-79h] std::allocator __a; // [xsp+11Fh] [xbp-71h] BYREF v4 = cocos2d::CCFileUtils::sharedFileUtils(); ((void (__fastcall *)(void **__return_ptr, cocos2d::CCFileUtils *, const char *, _QWORD))v4->createCCArrayWithContentsOfFile)( v80, v4, a2, 0); if ( v81 >= 0 ) v5 = (const char *)v80; else v5 = (const char *)v80[0]; v6 = cocos2d::CCString::createWithContentsOfFile(v5); v7 = (std::set *)operator new(0x18u); v7->__tree_.__pair3_.__value_ = 0; v7->__tree_.__pair1_.__value_.__left_ = nullptr; v7->__tree_.__begin_node_ = &v7->__tree_.__pair1_.__value_; if ( !v6 ) { v7 = nullptr; goto LABEL_172; } memset(&v79, 0, sizeof(v79)); CString = (char *)cocos2d::CCString::getCString(v6); sub_100009900(&__str, CString); v9 = 0x6C206E6F6D6D6F63LL; while ( 1 ) { if ( (SHIBYTE(__str.__r_.__value_.__r.__words[2]) & 0x80000000) == 0 ) { if ( !*((_BYTE *)&__str.__r_.__value_.__s + 23) ) goto LABEL_170; goto LABEL_10; } if ( !__str.__r_.__value_.__l.__size_ ) break; LABEL_10: v10 = std::string::find(&__str, 10, 0); v11 = v10; if ( (_DWORD)v10 == -1 ) { std::string::operator=(&v79, &__str); std::string::erase(&__str, 0, 0xFFFFFFFFFFFFFFFFLL); } else { std::string::basic_string(&v77, &__str, 0, (int)v10, &__a); if ( SHIBYTE(v79.__r_.__value_.__r.__words[2]) < 0 ) operator delete(v79.__r_.__value_.__l.__data_); v79 = v77; std::string::basic_string( &v77, &__str, (__int64)((__int64)&_mh_execute_header + (v11 << 32)) >> 32, 0xFFFFFFFFFFFFFFFFLL, &__a); if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__str.__r_.__value_.__l.__data_); __str = v77; } std::string::basic_string(&v77, &v79, 0, 9u, &__a); if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) < 0 ) { if ( v77.__r_.__value_.__l.__size_ == 9 ) { v14 = *(_QWORD *)v77.__r_.__value_.__l.__data_ != 0x636166206F666E69LL || *(_BYTE *)(v77.__r_.__value_.__r.__words[0] + 8) != 101; operator delete(v77.__r_.__value_.__l.__data_); if ( v14 ) goto LABEL_36; goto LABEL_33; } operator delete(v77.__r_.__value_.__l.__data_); LABEL_36: std::string::basic_string(&v77, &v79, 0, 0x11u, &__a); if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) < 0 ) { if ( v77.__r_.__value_.__l.__size_ == 17 ) { v19 = *(_QWORD *)v77.__r_.__value_.__l.__data_ != v9 || *(_QWORD *)(v77.__r_.__value_.__r.__words[0] + 8) != 0x6867696548656E69LL || *(_BYTE *)(v77.__r_.__value_.__r.__words[0] + 16) != 116; operator delete(v77.__r_.__value_.__l.__data_); if ( v19 ) goto LABEL_61; goto LABEL_58; } operator delete(v77.__r_.__value_.__l.__data_); LABEL_61: std::string::basic_string(&v77, &v79, 0, 7u, &__a); if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) < 0 ) { if ( v77.__r_.__value_.__l.__size_ == 7 ) { v22 = *(_DWORD *)v77.__r_.__value_.__l.__data_ != 1701273968 || *(_DWORD *)(v77.__r_.__value_.__r.__words[0] + 3) != 1684611173; operator delete(v77.__r_.__value_.__l.__data_); if ( v22 ) goto LABEL_80; goto LABEL_77; } operator delete(v77.__r_.__value_.__l.__data_); LABEL_80: std::string::basic_string(&v77, &v79, 0, 7u, &__a); if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) < 0 ) { if ( v77.__r_.__value_.__l.__size_ == 7 ) { v25 = *(_DWORD *)v77.__r_.__value_.__l.__data_ != 1918986339 || *(_DWORD *)(v77.__r_.__value_.__r.__words[0] + 3) != 1663071090; operator delete(v77.__r_.__value_.__l.__data_); if ( v25 ) goto LABEL_98; } else { operator delete(v77.__r_.__value_.__l.__data_); LABEL_98: std::string::basic_string(&v77, &v79, 0, 4u, &__a); if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) < 0 ) { if ( v77.__r_.__value_.__l.__size_ == 4 ) { v26 = *(_DWORD *)v77.__r_.__value_.__l.__data_; operator delete(v77.__r_.__value_.__l.__data_); if ( v26 == 1918986339 ) goto LABEL_104; } else { operator delete(v77.__r_.__value_.__l.__data_); } LABEL_107: std::string::basic_string(&v77, &v79, 0, 0xDu, &__a); if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) < 0 ) { v30 = (void *)v77.__r_.__value_.__r.__words[0]; if ( v77.__r_.__value_.__l.__size_ != 13 ) goto LABEL_165; v32 = *(_QWORD *)v77.__r_.__value_.__l.__data_ != 0x20676E696E72656BLL || *(_QWORD *)(v77.__r_.__value_.__r.__words[0] + 5) != 0x747372696620676ELL; operator delete(v77.__r_.__value_.__l.__data_); if ( !v32 ) goto LABEL_123; } else if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) == 13 && v77.__r_.__value_.__r.__words[0] == 0x20676E696E72656BLL && *(std::string::size_type *)((char *)v77.__r_.__value_.__r.__words + 5) == 0x747372696620676ELL ) { LABEL_123: if ( SHIBYTE(v79.__r_.__value_.__r.__words[2]) < 0 ) sub_1000097D0(&v72, v79.__r_.__value_.__l.__data_, v79.__r_.__value_.__l.__size_); else v72 = v79; cocos2d::CCBMFontConfiguration::parseKerningEntry((int)a1, &v72); if ( SHIBYTE(v72.__r_.__value_.__r.__words[2]) < 0 ) { v30 = (void *)v72.__r_.__value_.__r.__words[0]; LABEL_165: operator delete(v30); } } } else { if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) != 4 || LODWORD(v77.__r_.__value_.__l.__data_) != 1918986339 ) { goto LABEL_107; } LABEL_104: v27 = (cocos2d::tCCFontDefHashElement *)malloc(0x58u); v28 = v27; if ( SHIBYTE(v79.__r_.__value_.__r.__words[2]) < 0 ) LODWORD(v27) = (unsigned int)sub_1000097D0( &__p, v79.__r_.__value_.__l.__data_, v79.__r_.__value_.__l.__size_); else __p = v79; cocos2d::CCBMFontConfiguration::parseCharacterDefinition((int)v27, &__p); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); v28->key = v28->fontDef.charID; p_hh = (int32x2_t **)&v28->hh; v28->hh.next = nullptr; v28->hh.key = v28; v28->hh.keylen = 4; m_pFontDefDictionary = a1->m_pFontDefDictionary; if ( m_pFontDefDictionary ) { tbl = m_pFontDefDictionary->hh.tbl; tail = tbl->tail; tail->next = v28; v28->hh.prev = (char *)tail - tbl->hho; tbl->tail = (UT_hash_handle *)p_hh; } else { a1->m_pFontDefDictionary = v28; v28->hh.prev = nullptr; v37 = (UT_hash_table *)calloc(1u, 0x40u); v28->hh.tbl = v37; if ( !v37 || (tbl = v37, *(_QWORD *)&v37->num_buckets = 0x500000020LL, v37->tail = (UT_hash_handle *)p_hh, v37->hho = 32, v38 = (UT_hash_bucket *)calloc(1u, 0x200u), (tbl->buckets = v38) == nullptr) ) { exit(-1); } tbl->signature = -1609490463; m_pFontDefDictionary = v28; } ++tbl->num_items; v28->hh.tbl = tbl; v39 = (v28->key + 17973517) ^ 0x7F76D; v40 = (-1622558010 - v39) ^ (v39 << 8); v41 = (-17973517 - v39 - v40) ^ (v40 >> 13); v42 = (v39 - v40 - v41) ^ (v41 >> 12); v43 = (v40 - v41 - v42) ^ (v42 << 16); v44 = (v41 - v42 - v43) ^ (v43 >> 5); v45 = (v42 - v43 - v44) ^ (v44 >> 3); v46 = (v44 - v45 - ((v43 - v44 - v45) ^ (v45 << 10))) ^ (((v43 - v44 - v45) ^ (v45 << 10)) >> 15); v28->hh.hashv = v46; v47 = (__int64)&m_pFontDefDictionary->hh.tbl->buckets[v46 & (m_pFontDefDictionary->hh.tbl->num_buckets - 1)]; v48 = *(_DWORD *)(v47 + 8) + 1; *(_DWORD *)(v47 + 8) = v48; v49 = *(UT_hash_handle **)v47; v28->hh.hh_prev = nullptr; v28->hh.hh_next = v49; if ( v49 ) v49->hh_prev = (UT_hash_handle *)p_hh; *(_QWORD *)v47 = p_hh; if ( v48 >= 10 * *(_DWORD *)(v47 + 12) + 10 && tbl->noexpand != 1 ) { v71 = v7; v50 = v9; v51 = a2; v52 = (char *)calloc(1u, 32LL * tbl->num_buckets); if ( !v52 ) exit(-1); v53 = v52; num_items = tbl->num_items; num_buckets = tbl->num_buckets; v56 = 2 * num_buckets - 1; if ( (v56 & num_items) != 0 ) v57 = (num_items >> (tbl->log2_num_buckets + 1)) + 1; else v57 = num_items >> (tbl->log2_num_buckets + 1); tbl->ideal_chain_maxlen = v57; tbl->nonideal_items = 0; buckets = tbl->buckets; if ( (_DWORD)num_buckets ) { v59 = 0; for ( i = 0; i != num_buckets; ++i ) { hh_head = buckets[i].hh_head; if ( hh_head ) { do { hh_next = hh_head->hh_next; v63 = &v53[16 * (hh_head->hashv & v56)]; v64 = *((_DWORD *)v63 + 2) + 1; *((_DWORD *)v63 + 2) = v64; if ( v64 > v57 ) { tbl->nonideal_items = ++v59; *((_DWORD *)v63 + 3) = v64 / v57; } hh_head->hh_prev = nullptr; v65 = *(UT_hash_handle **)v63; hh_head->hh_next = *(UT_hash_handle **)v63; if ( v65 ) v65->hh_prev = hh_head; *(_QWORD *)v63 = hh_head; hh_head = hh_next; } while ( hh_next ); } } } free(buckets); v66 = *p_hh; v67 = (*p_hh)[1]; v68.i32[0] = vadd_s32(v67, v67).u32[0]; v68.i32[1] = vadd_s32(v67, (int32x2_t)0x100000001LL).i32[1]; v66[1] = v68; *v66 = (int32x2_t)v53; if ( v66[5].i32[1] <= (unsigned __int32)v66[2].i32[0] >> 1 ) { v66[6].i32[0] = 0; a2 = v51; v9 = v50; v7 = v71; } else { v69 = v66[6].i32[0] + 1; v66[6].i32[0] = v69; a2 = v51; v9 = v50; v7 = v71; if ( v69 >= 2 ) v66[6].i32[1] = 1; } } sub_1002FCEE0(v7, &v28->fontDef, &v28->fontDef); } } } else { if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) != 7 ) goto LABEL_98; if ( LODWORD(v77.__r_.__value_.__l.__data_) != 1918986339 || *(_DWORD *)((char *)v77.__r_.__value_.__r.__words + 3) != 1663071090 ) { goto LABEL_98; } } } else { if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) != 7 ) goto LABEL_80; if ( LODWORD(v77.__r_.__value_.__l.__data_) != 1701273968 || *(_DWORD *)((char *)v77.__r_.__value_.__r.__words + 3) != 1684611173 ) { goto LABEL_80; } LABEL_77: if ( SHIBYTE(v79.__r_.__value_.__r.__words[2]) < 0 ) sub_1000097D0(&v74, v79.__r_.__value_.__l.__data_, v79.__r_.__value_.__l.__size_); else v74 = v79; cocos2d::CCBMFontConfiguration::parseImageFileName((int)a1, &v74); if ( SHIBYTE(v74.__r_.__value_.__r.__words[2]) < 0 ) { v30 = (void *)v74.__r_.__value_.__r.__words[0]; goto LABEL_165; } } } else { if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) != 17 ) goto LABEL_61; v15 = v77.__r_.__value_.__r.__words[0] == v9 && v77.__r_.__value_.__l.__size_ == 0x6867696548656E69LL; if ( !v15 || v77.__r_.__value_.__s.__data_[16] != 116 ) goto LABEL_61; LABEL_58: if ( SHIBYTE(v79.__r_.__value_.__r.__words[2]) < 0 ) sub_1000097D0(&__dst, v79.__r_.__value_.__l.__data_, v79.__r_.__value_.__l.__size_); else __dst = v79; cocos2d::CCBMFontConfiguration::parseCommonArguments((int)a1, &__dst); if ( SHIBYTE(__dst.__r_.__value_.__r.__words[2]) < 0 ) { v30 = (void *)__dst.__r_.__value_.__r.__words[0]; goto LABEL_165; } } } else { if ( SHIBYTE(v77.__r_.__value_.__r.__words[2]) != 9 ) goto LABEL_36; if ( v77.__r_.__value_.__r.__words[0] != 0x636166206F666E69LL || v77.__r_.__value_.__s.__data_[8] != 101 ) goto LABEL_36; LABEL_33: if ( SHIBYTE(v79.__r_.__value_.__r.__words[2]) < 0 ) sub_1000097D0(&__s, v79.__r_.__value_.__l.__data_, v79.__r_.__value_.__l.__size_); else __s = v79; cocos2d::CCBMFontConfiguration::parseInfoArguments((int)a1, &__s); if ( SHIBYTE(__s.__r_.__value_.__r.__words[2]) < 0 ) { v30 = (void *)__s.__r_.__value_.__r.__words[0]; goto LABEL_165; } } } operator delete(__str.__r_.__value_.__l.__data_); LABEL_170: if ( SHIBYTE(v79.__r_.__value_.__r.__words[2]) < 0 ) operator delete(v79.__r_.__value_.__l.__data_); LABEL_172: if ( v81 < 0 ) operator delete(v80[0]); return v7; }
GD Web Decomp Icon

GD Web Decomp

Raw Source