// // LocalLevelManager::tryLoadMainLevelString from 0x1005f69f0 to 0x1005f6d8d (925 bytes) // // 1 xrefs: // > LocalLevelManager::getMainLevelString @ 0x1005f6e1e // // 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 // // local variable allocation has failed, the output may be wrong! void __fastcall LocalLevelManager::tryLoadMainLevelString(LocalLevelManager *a1, int a2) { double v2; // xmm0_8 int v3; // r14d unsigned __int64 value; // rdi float *p_m_mainLevels; // rbx unsigned __int64 v7; // r9 __int64 **v8; // rax __int64 *v9; // r8 unsigned __int64 v10; // rdi __int64 v11; // rax unsigned __int64 v12; // rax cocos2d::CCFileUtils *v13; // r15 cocos2d::CCString *v14; // rax const char *CString; // r12 size_t v16; // rax size_t v17; // r14 char *v18; // r13 char *v19; // rdx float *v20; // r15 size_t v21; // rbx const char *v22; // rdi cocos2d::CCString *v23; // rax const char *v24; // r14 size_t v25; // rax std::string::size_type v26; // r15 char *data; // r12 size_t v28; // r13 char v29; // al char *v30; // rax int *v31; // [rsp+0h] [rbp-90h] BYREF cocos2d::CCFileUtils *v32; // [rsp+8h] [rbp-88h] char v33; // [rsp+10h] [rbp-80h] BYREF char v34; // [rsp+11h] [rbp-7Fh] BYREF void *__p; // [rsp+20h] [rbp-70h] int v36; // [rsp+2Ch] [rbp-64h] BYREF _QWORD __dst[2]; // [rsp+30h] [rbp-60h] BYREF void *v38; // [rsp+40h] [rbp-50h] std::string __str; // [rsp+48h] [rbp-48h] BYREF v3 = a2; v36 = a2; value = a1->m_mainLevels.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_; p_m_mainLevels = (float *)&a1->m_mainLevels; if ( value ) { v7 = (0x101010101010101LL * ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL) + (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL) + ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL) + (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4)) & 0xF0F0F0F0F0F0F0FLL)) >> 56; if ( v7 <= 1 ) { *(_QWORD *)&a2 = a2 & (value - 1); v8 = *(__int64 ***)(*(_QWORD *)p_m_mainLevels + 8LL * *(_QWORD *)&a2); if ( !v8 ) goto LABEL_28; goto LABEL_9; } *(_QWORD *)&a2 = a2; if ( value <= a2 ) { if ( !((value | a2) >> 32) ) { *(_QWORD *)&a2 = a2 % (unsigned int)value; v8 = *(__int64 ***)(*(_QWORD *)p_m_mainLevels + 8LL * *(_QWORD *)&a2); if ( !v8 ) goto LABEL_28; goto LABEL_9; } *(_QWORD *)&a2 = a2 % value; } v8 = *(__int64 ***)(*(_QWORD *)p_m_mainLevels + 8LL * *(_QWORD *)&a2); if ( !v8 ) goto LABEL_28; LABEL_9: v9 = *v8; if ( !*v8 ) goto LABEL_28; if ( (unsigned int)v7 < 2 ) { v10 = value - 1; while ( 1 ) { v11 = v9[1]; if ( v11 == v3 ) { if ( *((_DWORD *)v9 + 4) == v3 ) return; } else if ( (v10 & v11) != *(_QWORD *)&a2 ) { goto LABEL_28; } v9 = (__int64 *)*v9; if ( !v9 ) goto LABEL_28; } } while ( 1 ) { v12 = v9[1]; if ( v12 == v3 ) { if ( *((_DWORD *)v9 + 4) == v3 ) return; goto LABEL_18; } if ( v12 < value ) goto LABEL_23; if ( (value | v12) >> 32 ) break; if ( (unsigned int)v12 % (unsigned int)value != *(_QWORD *)&a2 ) goto LABEL_28; LABEL_18: v9 = (__int64 *)*v9; if ( !v9 ) goto LABEL_28; } v12 %= value; LABEL_23: if ( v12 != *(_QWORD *)&a2 ) goto LABEL_28; goto LABEL_18; } LABEL_28: v13 = cocos2d::CCFileUtils::sharedFileUtils(); v14 = (cocos2d::CCString *)sub_1007AB580("levels/%i.txt", (char)v31); CString = cocos2d::CCString::getCString(v14); v16 = strlen(CString); if ( v16 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v17 = v16; if ( v16 >= 0x17 ) { v32 = v13; v20 = p_m_mainLevels; v21 = 26; if ( (v16 | 7) != 0x17 ) v21 = (v16 | 7) + 1; v18 = (char *)operator new(v21); v38 = v18; __dst[0] = v21 + 1; p_m_mainLevels = v20; v13 = v32; __dst[1] = v17; LABEL_36: memmove(v18, CString, v17); v18[v17] = 0; if ( (__dst[0] & 1) != 0 ) goto LABEL_32; goto LABEL_37; } LOBYTE(__dst[0]) = 2 * v16; v18 = (char *)__dst + 1; if ( v16 ) goto LABEL_36; BYTE1(__dst[0]) = 0; if ( (__dst[0] & 1) != 0 ) { LABEL_32: v19 = (char *)v38; goto LABEL_38; } LABEL_37: v19 = (char *)__dst + 1; LABEL_38: ((void (__fastcall *)(char *, cocos2d::CCFileUtils *, char *, _QWORD))v13->createCCArrayWithContentsOfFile)( &v33, v13, v19, 0); if ( (v33 & 1) != 0 ) v22 = (const char *)__p; else v22 = &v34; v23 = cocos2d::CCString::createWithContentsOfFile(v22); if ( v23 ) { v24 = cocos2d::CCString::getCString(v23); v25 = strlen(v24); if ( v25 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v26 = v25; if ( v25 >= 0x17 ) { v28 = 26; if ( (v25 | 7) != 0x17 ) v28 = (v25 | 7) + 1; data = (char *)operator new(v28); __str.__r_.__value_.__r.__words[2] = (std::string::size_type)data; __str.__r_.__value_.__r.__words[0] = v28 | 1; __str.__r_.__value_.__l.__size_ = v26; } else { __str.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v25); data = __str.__r_.__value_.__s.__data_; if ( !v25 ) { LABEL_50: data[v26] = 0; v29 = *(_BYTE *)&__str.__r_.__value_.__s.0 & 1; if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 ) { if ( !__str.__r_.__value_.__l.__size_ ) { LABEL_55: if ( v29 ) operator delete(__str.__r_.__value_.__l.__data_); goto LABEL_57; } } else if ( !(*(_BYTE *)&__str.__r_.__value_.__l.0 >> 1) ) { goto LABEL_55; } v31 = &v36; v30 = sub_100172F30(p_m_mainLevels, &v36, (__int64)&unk_100821C06, &v31); std::string::operator=((std::string *)v30 + 1, &__str); v29 = *(_BYTE *)&__str.__r_.__value_.__s.0 & 1; goto LABEL_55; } } memmove(data, v24, v26); goto LABEL_50; } LABEL_57: if ( (v33 & 1) != 0 ) operator delete(__p); if ( (__dst[0] & 1) != 0 ) operator delete(v38); }
GD Web Decomp Icon

GD Web Decomp

Raw Source