// // GameStatsManager::awardDiamondsForLevel from 0x7bb008 to 0x7bb4b0 (1192 bytes) // // 3 xrefs: // > PlayLayer::levelComplete @ 0x5d11f0 // > PlayLayer::destroyPlayer @ 0x5d1f70 // > @ 0xc9378 // // 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 GameStatsManager::awardDiamondsForLevel(GameStatsManager *a1, GJGameLevel *a2) { int v4; // w22 int BaseDiamonds; // w28 int v6; // w0 int v7; // w27 cocos2d::CCDictionary *m_timelyDiamondScores; // x25 cocos2d::CCString *v9; // x0 int v10; // w21 char *v11; // x0 int v12; // w21 void *v13; // x0 int v14; // w3 cocos2d::CCDictionary *m_timelyStars; // x19 cocos2d::CCString *v16; // x0 int v17; // w25 char *v18; // x0 cocos2d::CCObject *v19; // x25 void *v20; // x0 unsigned int *v21; // x1 int v22; // w2 char *v23; // x22 unsigned int *v24; // x19 int v25; // w0 unsigned int *v26; // x1 int v27; // w2 unsigned int *v28; // x1 int v29; // w2 unsigned int *v30; // x1 int v31; // w2 cocos2d::CCObject *v32; // [xsp+68h] [xbp+68h] char *v33; // [xsp+80h] [xbp+80h] BYREF std::string v34; // [xsp+88h] [xbp+88h] BYREF __int64 v35; // [xsp+90h] [xbp+90h] BYREF std::string v36; // [xsp+98h] [xbp+98h] BYREF __int64 v37; // [xsp+A0h] [xbp+A0h] BYREF if ( a2->m_dailyID.random - a2->m_dailyID.seed > 0 || a2->m_gauntletLevel ) { v4 = a2->m_stars.random - a2->m_stars.seed; BaseDiamonds = GameStatsManager::getBaseDiamonds(a1, v4); v6 = a2->m_orbCompletion.random - a2->m_orbCompletion.seed; if ( BaseDiamonds > 0 && v6 > 0 ) { v7 = 100; if ( v6 <= 99 ) v7 = a2->m_orbCompletion.random - a2->m_orbCompletion.seed; GameStatsManager::getCurrencyKey(a1, a2, (__int64)&v33); m_timelyDiamondScores = a1->m_timelyDiamondScores; if ( a2->m_dailyID.random - a2->m_dailyID.seed <= 0 ) m_timelyDiamondScores = a1->m_gauntletDiamondScores; sub_D153B8((int)&v34, v33); v9 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(m_timelyDiamondScores, &v34); v10 = cocos2d::CCString::intValue(v9); v11 = (char *)v34.m_data.m_data - 24; if ( (__int64 *)v34.m_data.m_data - 3 != &qword_124B6B0 ) { if ( &pthread_create ) { v26 = (unsigned int *)((char *)v34.m_data.m_data - 8); do v27 = __ldaxr(v26); while ( __stlxr(v27 - 1, v26) ); } else { v27 = *((_DWORD *)v34.m_data.m_data - 2); *((_DWORD *)v34.m_data.m_data - 2) = v27 - 1; } if ( v27 <= 0 ) operator delete(v11); } if ( v7 > v10 ) { v12 = vcvtms_s32_f32((float)BaseDiamonds * (float)((float)v7 / 100.0)) - vcvtms_s32_f32((float)BaseDiamonds * (float)((float)v10 / 100.0)); if ( v12 > 0 ) { v32 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat( (cocos2d::CCString *)"%i", (const char *)(unsigned int)v7); sub_D153B8((int)&v35, v33); cocos2d::CCDictionary::setObject((int)m_timelyDiamondScores, v32); v13 = (void *)(v35 - 24); if ( (__int64 *)(v35 - 24) != &qword_124B6B0 ) { if ( &pthread_create ) { v30 = (unsigned int *)(v35 - 8); do v31 = __ldaxr(v30); while ( __stlxr(v31 - 1, v30) ); } else { v31 = *(_DWORD *)(v35 - 8); *(_DWORD *)(v35 - 8) = v31 - 1; } if ( v31 <= 0 ) operator delete(v13); } v14 = a2->m_dailyID.random - a2->m_dailyID.seed; m_timelyStars = a1->m_timelyStars; if ( v14 <= 0 ) m_timelyStars = a1->m_onlineStars; sub_D153B8((int)&v36, v33); v16 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(m_timelyStars, &v36); v17 = cocos2d::CCString::intValue(v16); v18 = (char *)v36.m_data.m_data - 24; if ( (__int64 *)v36.m_data.m_data - 3 != &qword_124B6B0 ) { if ( &pthread_create ) { v28 = (unsigned int *)((char *)v36.m_data.m_data - 8); do v29 = __ldaxr(v28); while ( __stlxr(v29 - 1, v28) ); } else { v29 = *((_DWORD *)v36.m_data.m_data - 2); *((_DWORD *)v36.m_data.m_data - 2) = v29 - 1; } if ( v29 <= 0 ) operator delete(v18); } if ( v17 < v4 ) { v19 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat( (cocos2d::CCString *)"%i", (const char *)(unsigned int)v4); sub_D153B8((int)&v37, v33); cocos2d::CCDictionary::setObject((int)m_timelyStars, v19); v20 = (void *)(v37 - 24); if ( (__int64 *)(v37 - 24) != &qword_124B6B0 ) { if ( &pthread_create ) { v21 = (unsigned int *)(v37 - 8); do v22 = __ldaxr(v21); while ( __stlxr(v22 - 1, v21) ); } else { v22 = *(_DWORD *)(v37 - 8); *(_DWORD *)(v37 - 8) = v22 - 1; } if ( v22 <= 0 ) operator delete(v20); } } GameStatsManager::incrementStat(a1, "13", v12); } } v23 = v33 - 24; if ( v33 - 24 != (char *)&qword_124B6B0 ) { if ( &pthread_create ) { v24 = (unsigned int *)(v33 - 8); do v25 = __ldaxr(v24); while ( __stlxr(v25 - 1, v24) ); } else { v25 = *((_DWORD *)v33 - 2); *((_DWORD *)v33 - 2) = v25 - 1; } if ( v25 <= 0 ) operator delete(v23); } } } }
GD Web Decomp Icon

GD Web Decomp

Raw Source