// // GameStatsManager::tryFixPathBug from 0x1000316b0 to 0x100031ec6 (2070 bytes) // // 2 xrefs: // > GJAccountManager::onSyncAccountCompleted @ 0x10009f7c3 // > GameManager::dataLoaded @ 0x100373570 // // 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:19:30 +0000 // void __fastcall GameStatsManager::tryFixPathBug(__int64 a1, __m128 a2) { __int64 v2; // rax int Stat; // ebx __int64 v4; // rax int v5; // eax int v6; // ecx unsigned int v7; // ecx int v8; // edx unsigned int v9; // eax __int64 v10; // r13 __int64 v11; // r12 const char *v12; // rsi int v13; // r14d __int64 v14; // rdi const char *v15; // rsi unsigned int v16; // eax __int64 v17; // rbx __int64 v18; // rbx size_t v19; // r15 __int64 v20; // r15 unsigned __int64 v21; // r13 _QWORD *v22; // r14 unsigned __int64 v23; // rax __int64 v24; // rax __int64 v25; // rdx const char *v26; // r12 const char *v27; // rsi const char *v28; // rsi const char *v29; // rsi const char *v30; // rsi const char *v31; // rsi const char *v32; // rsi const char *v33; // rsi const char *v34; // rsi const char *v35; // rsi int i; // r14d const char *v37; // rsi __int64 v38; // rax const char *CString; // r15 const char *v40; // rdi size_t v41; // rax __int64 v42; // rdx size_t v43; // r13 __int8 *v44; // rbx __int64 v45; // rax size_t v46; // r12 __int64 v47; // r15 char v48; // bl char *v49; // r12 int v50; // r14d const char *v51; // rsi bool v52; // cc bool v53; // zf unsigned int j; // ebx const char *v55; // rsi int v56; // r12d const char *v57; // rsi int v58; // r12d __m128 v59; // [rsp+0h] [rbp-C0h] BYREF void *v60; // [rsp+10h] [rbp-B0h] __m128 v61; // [rsp+20h] [rbp-A0h] BYREF void *v62; // [rsp+30h] [rbp-90h] __int64 v63; // [rsp+40h] [rbp-80h] __int64 v64; // [rsp+48h] [rbp-78h] int v65; // [rsp+54h] [rbp-6Ch] size_t __n; // [rsp+58h] [rbp-68h] void *__src; // [rsp+60h] [rbp-60h] size_t v68; // [rsp+68h] [rbp-58h] char v69; // [rsp+77h] [rbp-49h] __int64 v70; // [rsp+78h] [rbp-48h] __m128 __dst; // [rsp+80h] [rbp-40h] BYREF void *__p; // [rsp+90h] [rbp-30h] if ( *(_BYTE *)(a1 + 913) != 1 ) return; v69 = *(_BYTE *)(AchievementManager::sharedState() + 360); *(_BYTE *)(AchievementManager::sharedState() + 360) = 1; v70 = a1; *(_BYTE *)(a1 + 913) = 0; v2 = GameStatsManager::sharedState(); Stat = GameStatsManager::getStat(v2, "6", a2); v4 = GameStatsManager::sharedState(); v5 = Stat + GameStatsManager::getStat(v4, "28", a2); v6 = 1000; if ( v5 >= 1001 ) v6 = v5; v7 = v6 - 1000; v8 = 5000; if ( Stat >= 30001 ) v8 = 6000; v9 = 7000; if ( Stat < 100001 ) v9 = v8; if ( v7 < v9 ) v9 = v7; v65 = v9; v10 = 0; v11 = 30; __src = nullptr; __n = 0; v68 = 0; do { while ( 1 ) { GameToolbox::intToString(&__dst, (unsigned int)v11); v12 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v12 = (const char *)__p; v13 = GameStatsManager::getStat(v70, v12, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); v14 = 1000; if ( v13 <= 999 ) { GameToolbox::intToString(&__dst, (unsigned int)v11); v15 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v15 = (const char *)__p; v16 = GameStatsManager::getStat(v70, v15, a2); v14 = v16; if ( (__dst.i8[0] & 1) != 0 ) { v17 = v16; operator delete(__p); v14 = v17; } } v18 = v11 + (v14 << 32); v19 = __n; if ( __n >= v68 ) break; *(_QWORD *)__n = v18; __n = v19 + 8; v10 = (unsigned int)(v14 + v10); if ( ++v11 == 40 ) goto LABEL_34; } v63 = v10; __n -= (unsigned __int64)__src; v20 = (__int64)(v19 - (_QWORD)__src) >> 3; if ( (unsigned __int64)(v20 + 1) > 0x1FFFFFFFFFFFFFFFLL ) sub_100056B00(); v21 = (__int64)(v68 - (_QWORD)__src) >> 2; if ( v21 <= v20 + 1 ) v21 = v20 + 1; if ( v68 - (unsigned __int64)__src >= 0x7FFFFFFFFFFFFFF8LL ) v21 = 0x1FFFFFFFFFFFFFFFLL; v64 = v14; if ( v21 ) { if ( v21 > 0x1FFFFFFFFFFFFFFFLL ) sub_10001ADB0(); v22 = operator new(8 * v21); } else { v22 = nullptr; } v68 = (size_t)&v22[v21]; v22[v20] = v18; memcpy(v22, __src, __n); if ( __src ) operator delete(__src); __src = v22; __n = (size_t)&v22[v20 + 1]; v10 = (unsigned int)(v64 + v63); ++v11; } while ( v11 != 40 ); LABEL_34: if ( (int)v10 <= v65 ) goto LABEL_126; _BitScanReverse64(&v23, (__int64)(__n - (_QWORD)__src) >> 3); v24 = (2 * ((unsigned int)v23 ^ 0x3F)) ^ 0x7ELL; v25 = 0; if ( (void *)__n != __src ) v25 = v24; sub_100056B10(__src, __n, v25, 1); GameToolbox::intToString(&__dst, 30); v26 = &__dst.i8[1]; v27 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v27 = (const char *)__p; GameStatsManager::setStat(v70, v27, 0, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); GameToolbox::intToString(&__dst, 31); v28 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v28 = (const char *)__p; GameStatsManager::setStat(v70, v28, 0, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); GameToolbox::intToString(&__dst, 32); v29 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v29 = (const char *)__p; GameStatsManager::setStat(v70, v29, 0, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); GameToolbox::intToString(&__dst, 33); v30 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v30 = (const char *)__p; GameStatsManager::setStat(v70, v30, 0, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); GameToolbox::intToString(&__dst, 34); v31 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v31 = (const char *)__p; GameStatsManager::setStat(v70, v31, 0, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); GameToolbox::intToString(&__dst, 35); v32 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v32 = (const char *)__p; GameStatsManager::setStat(v70, v32, 0, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); GameToolbox::intToString(&__dst, 36); v33 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v33 = (const char *)__p; GameStatsManager::setStat(v70, v33, 0, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); GameToolbox::intToString(&__dst, 37); v34 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v34 = (const char *)__p; GameStatsManager::setStat(v70, v34, 0, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); GameToolbox::intToString(&__dst, 38); v35 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v35 = (const char *)__p; GameStatsManager::setStat(v70, v35, 0, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); GameToolbox::intToString(&__dst, 39); if ( (__dst.i8[0] & 1) != 0 ) v26 = (const char *)__p; GameStatsManager::setStat(v70, v26, 0, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); LODWORD(v68) = 1; while ( 2 ) { for ( i = 1; i != 11; ++i ) { v37 = (const char *)(unsigned int)v68; v38 = sub_10088E820("geometry.ach.path%02d.%02d", v59.i8[0]); CString = (const char *)cocos2d::CCString::getCString(v38); v40 = CString; v41 = strlen(CString); if ( v41 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100003630(); v43 = v41; if ( v41 >= 0x17 ) { v45 = v41 | 7; v46 = 26; if ( (v43 | 7) != 0x17 ) v46 = v45 + 1; v44 = (__int8 *)operator new(v46); __p = v44; __dst.i64[0] = v46 | 1; __dst.i64[1] = v43; LABEL_88: v40 = v44; v37 = CString; memmove(v44, CString, v43); goto LABEL_89; } __dst.i8[0] = 2 * v41; v44 = &__dst.i8[1]; if ( v41 ) goto LABEL_88; LABEL_89: v44[v43] = 0; v47 = GameManager::sharedState(v40, v37, v42); v48 = __dst.i8[0] & 1; if ( (__dst.i8[0] & 1) != 0 ) { sub_10001AD30(&v59, __p, __dst.u64[1]); } else { v60 = __p; a2 = __dst; v59 = __dst; } GameManager::resetAchievement(v47, &v59); if ( (v59.i8[0] & 1) != 0 ) { operator delete(v60); if ( !v48 ) continue; } else if ( !v48 ) { continue; } operator delete(__p); } LODWORD(v68) = v68 + 1; if ( (_DWORD)v68 != 11 ) continue; break; } if ( (void *)__n != __src ) { v49 = (char *)__src + 8; do { v50 = 1000; if ( v65 < 1000 ) v50 = v65; GameToolbox::intToString(&__dst, *((unsigned int *)v49 - 2)); v51 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v51 = (const char *)__p; GameStatsManager::setStat(v70, v51, v50, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); v52 = v65 <= v50; v65 -= v50; if ( v52 ) break; v53 = v49 == (char *)__n; v49 += 8; } while ( !v53 ); } for ( j = 30; j != 40; ++j ) { GameToolbox::intToString(&__dst, j); v55 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v55 = (const char *)__p; v56 = GameStatsManager::getStat(v70, v55, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); if ( v56 <= 999 ) { GameToolbox::intToString(&__dst, j); v57 = &__dst.i8[1]; if ( (__dst.i8[0] & 1) != 0 ) v57 = (const char *)__p; v58 = GameStatsManager::getStat(v70, v57, a2); if ( (__dst.i8[0] & 1) != 0 ) operator delete(__p); if ( v58 <= 999 ) { GameStatsManager::getPathRewardKey(&__dst, v57, j - 29); LOBYTE(v68) = __dst.i8[0]; if ( (__dst.i8[0] & 1) != 0 ) { sub_10001AD30(&v61, __p, __dst.u64[1]); } else { v62 = __p; a2 = __dst; v61 = __dst; } cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(v70 + 784), &v61); if ( (v61.i8[0] & 1) != 0 ) operator delete(v62); if ( (v68 & 1) != 0 ) operator delete(__p); } } } LABEL_126: *(_BYTE *)(AchievementManager::sharedState() + 360) = v69; *(_BYTE *)(v70 + 912) = 1; if ( __src ) operator delete(__src); }
GD Web Decomp Icon

GD Web Decomp

Raw Source