// // cocos2d::CCLabelAtlas::initWithString_2 from 0x100879be0 to 0x10087a072 (1170 bytes) // // 1 xrefs: // > cocos2d::CCLabelAtlas::create_1 @ 0x100879bab // // This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 12:36:54 +0000 // char __fastcall cocos2d::CCLabelAtlas::initWithString_2(_DWORD *a1, char *a2, const char *a3) { __int64 v4; // rax size_t v5; // rax char *v6; // rbx size_t v7; // rcx std::string::size_type v8; // r12 char *data; // r14 size_t v11; // r13 std::string::pointer p_dst; // rdi std::string *v13; // rax __int64 v14; // rax __int64 v15; // rbx __int64 v16; // rax __int64 v17; // rax size_t v18; // rbx size_t v19; // rax std::string::size_type v20; // r15 size_t v21; // r13 std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v22; // r15 char *v23; // r14 size_t v24; // r12 char *v25; // rsi char *v26; // r14 __int64 v27; // r13 __int64 v28; // rax int v29; // r12d __int64 v30; // rax __int64 v31; // rax int v32; // ebx __int64 v33; // rax __int64 v34; // rax int v35; // r15d const char *CString; // r14 _QWORD *v37; // rax _DWORD *v38; // r14 unsigned int v39; // eax _DWORD *v40; // rdi __int64 v42; // [rsp+0h] [rbp-C0h] unsigned __int8 v43; // [rsp+8h] [rbp-B8h] BYREF char v44; // [rsp+9h] [rbp-B7h] BYREF size_t __len; // [rsp+10h] [rbp-B0h] void *__src; // [rsp+18h] [rbp-A8h] char *v47; // [rsp+20h] [rbp-A0h] _DWORD *v48; // [rsp+28h] [rbp-98h] size_t v49[2]; // [rsp+30h] [rbp-90h] BYREF void *v50; // [rsp+40h] [rbp-80h] float v51; // [rsp+4Ch] [rbp-74h] char *__s; // [rsp+50h] [rbp-70h] int v53; // [rsp+5Ch] [rbp-64h] std::string __dst; // [rsp+60h] [rbp-60h] BYREF char v55; // [rsp+80h] [rbp-40h] BYREF _BYTE v56[46]; // [rsp+81h] [rbp-3Fh] BYREF v47 = a2; v48 = a1; v4 = cocos2d::CCFileUtils::sharedFileUtils(); (*(void (__fastcall **)(unsigned __int8 *, __int64, const char *, _QWORD))(*(_QWORD *)v4 + 48LL))(&v43, v4, a3, 0); v5 = v43 >> 1; v6 = &v44; if ( (v43 & 1) != 0 ) { v6 = (char *)__src; v5 = __len; } v7 = v5; while ( v7 ) { v8 = v7 - 1; if ( v6[--v7] == 47 ) goto LABEL_8; } v8 = -1; LABEL_8: if ( v5 < v8 ) v8 = v5; if ( v8 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100003630(); data = __dst.__r_.__value_.__s.__data_; if ( v8 >= 0x17 ) { v11 = 26; if ( (v8 | 7) != 0x17 ) v11 = (v8 | 7) + 1; data = (char *)operator new(v11); __dst.__r_.__value_.__r.__words[2] = (std::string::size_type)data; __dst.__r_.__value_.__r.__words[0] = v11 | 1; __dst.__r_.__value_.__l.__size_ = v8; goto LABEL_17; } __dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v8); if ( v8 ) LABEL_17: memmove(data, v6, v8); data[v8] = 0; p_dst = (std::string::pointer)&__dst; v13 = std::string::append(&__dst, "/"); v50 = v13->__r_.__value_.__l.__data_; *(_OWORD *)v49 = *(_OWORD *)&v13->__r_.__value_.__l.0; *(_OWORD *)&v13->__r_.__value_.__l.0 = 0; v13->__r_.__value_.__r.__words[2] = 0; if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 ) { p_dst = __dst.__r_.__value_.__l.__data_; operator delete(__dst.__r_.__value_.__l.__data_); } v14 = CCContentManager::sharedManager((__int64)p_dst, (__int64)"/"); v15 = CCContentManager::addDict(v14, a3, 0); __dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)14; strcpy(__dst.__r_.__value_.__s.__data_, "version"); v16 = cocos2d::CCDictionary::objectForKey(v15, (char *)&__dst); cocos2d::CCString::intValue(v16); if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 ) operator delete(__dst.__r_.__value_.__l.__data_); v55 = 30; strcpy(v56, "textureFilename"); v42 = v15; v17 = cocos2d::CCDictionary::objectForKey(v15, &v55); __s = (char *)cocos2d::CCString::getCString(v17); v53 = LOBYTE(v49[0]); if ( (v49[0] & 1) != 0 ) v18 = v49[1]; else v18 = LOBYTE(v49[0]) >> 1; v19 = strlen(__s); v20 = v18 + v19; if ( v18 + v19 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100003630(); v21 = v19; if ( v20 > 0x16 ) { v24 = 26; if ( (v20 | 7) != 0x17 ) v24 = (v20 | 7) + 1; v23 = (char *)operator new(v24); __dst.__r_.__value_.__r.__words[0] = v24 | 1; __dst.__r_.__value_.__r.__words[2] = (std::string::size_type)v23; __dst.__r_.__value_.__l.__size_ = v20; v22 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(v24 | 1); } else { memset(&__dst, 0, sizeof(__dst)); v22 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v20); __dst.__r_.__value_.__s.0 = v22; v23 = nullptr; } if ( (*(_BYTE *)&v22 & 1) == 0 ) v23 = __dst.__r_.__value_.__s.__data_; if ( v18 ) { if ( (v53 & 1) != 0 ) v25 = (char *)v50; else v25 = (char *)v49 + 1; memmove(v23, v25, v18); } v26 = &v23[v18]; if ( v21 ) memmove(v26, __s, v21); v26[v21] = 0; if ( (v55 & 1) != 0 ) operator delete(*(void **)&v56[15]); v27 = sub_10088E600(&__dst); v55 = 18; strcpy(v56, "itemWidth"); v28 = cocos2d::CCDictionary::objectForKey(v42, &v55); v29 = cocos2d::CCString::intValue(v28); v30 = cocos2d::CCDirector::sharedDirector(); LODWORD(__s) = sub_100479350(v30); if ( (v55 & 1) != 0 ) operator delete(*(void **)&v56[15]); v55 = 20; strcpy(v56, "itemHeight"); v31 = cocos2d::CCDictionary::objectForKey(v42, &v55); v32 = cocos2d::CCString::intValue(v31); v33 = cocos2d::CCDirector::sharedDirector(); v51 = sub_100479350(v33); if ( (v55 & 1) != 0 ) operator delete(*(void **)&v56[15]); v55 = 18; strcpy(v56, "firstChar"); v34 = cocos2d::CCDictionary::objectForKey(v42, &v55); v35 = cocos2d::CCString::intValue(v34); if ( (v55 & 1) != 0 ) operator delete(*(void **)&v56[15]); CString = (const char *)cocos2d::CCString::getCString(v27); v37 = cocos2d::CCTextureCache::sharedTextureCache(); v38 = cocos2d::CCTextureCache::addImage((__int64)v37, CString, 0); v39 = strlen(v47); if ( cocos2d::CCAtlasNode::initWithTexture( v48, (__int64)v38, (int)(float)((float)v29 / *(float *)&__s), (int)(float)((float)v32 / v51), v39) ) { v40 = v48; v48[110] = v35; (*(void (__fastcall **)(_DWORD *, char *))(*(_QWORD *)v40 + 1080LL))(v40, v47); } if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) == 0 ) { if ( (v53 & 1) == 0 ) goto LABEL_52; LABEL_56: operator delete(v50); if ( (v43 & 1) == 0 ) return 1; goto LABEL_53; } operator delete(__dst.__r_.__value_.__l.__data_); if ( (v53 & 1) != 0 ) goto LABEL_56; LABEL_52: if ( (v43 & 1) != 0 ) LABEL_53: operator delete(__src); return 1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source