// // GameStatsManager::getTotalCollectedCurrency from 0x100074900 to 0x10007555a (3162 bytes) // // 1 xrefs: // > GameStatsManager::recountSpecialStats @ 0x100075d18 // // 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 // int __fastcall GameStatsManager::getTotalCollectedCurrency(GameStatsManager *a1) { int v1; // r14d double v2; // xmm0_8 GameLevelManager *v3; // rax GJGameLevel *MainLevel; // rax cocos2d::CCString *v5; // rax const char *CString; // r15 size_t v7; // rax size_t v8; // r13 char *v9; // rbx __int64 v10; // rax size_t v11; // r12 cocos2d::CCDictionary *m_mainCurrencyScores; // r13 const char *v13; // r15 size_t v14; // rax size_t v15; // r12 char *v16; // rbx cocos2d::CCDictionary *v17; // r15 size_t v18; // r13 int i; // r14d GameLevelManager *v20; // rax GJGameLevel *v21; // rax cocos2d::CCString *v22; // rax const char *v23; // r15 size_t v24; // rax size_t v25; // r13 char *v26; // rbx __int64 v27; // rax size_t v28; // r12 cocos2d::CCDictionary *v29; // r13 const char *v30; // r15 size_t v31; // rax size_t v32; // r12 char *v33; // rbx cocos2d::CCDictionary *v34; // r15 size_t v35; // r13 int j; // r14d GameLevelManager *v37; // rax GJGameLevel *v38; // rax cocos2d::CCString *v39; // rax const char *v40; // r15 size_t v41; // rax size_t v42; // r13 char *v43; // rbx __int64 v44; // rax size_t v45; // r12 cocos2d::CCDictionary *v46; // r13 const char *v47; // r15 size_t v48; // rax size_t v49; // r12 char *v50; // rbx cocos2d::CCDictionary *v51; // r15 size_t v52; // r13 cocos2d::CCArray *v53; // r14 unsigned int v54; // r13d cocos2d::CCString *v55; // rax int v56; // ebx GameLevelManager *v57; // rax GJGameLevel *SavedLevel; // rax cocos2d::CCString *v59; // rax const char *v60; // r12 size_t v61; // rax size_t v62; // r15 char *v63; // rbx __int64 v64; // rax size_t v65; // r14 cocos2d::CCDictionary *m_onlineCurrencyScores; // r15 const char *v67; // r12 size_t v68; // rax size_t v69; // rbx char *v70; // r14 cocos2d::CCDictionary *v71; // r12 size_t v72; // r15 cocos2d::CCArray *v73; // r14 unsigned int v74; // r13d cocos2d::CCString *v75; // rax int v76; // ebx GameLevelManager *v77; // rax GJGameLevel *SavedGauntletLevel; // rax cocos2d::CCString *v79; // rax const char *v80; // r12 size_t v81; // rax size_t v82; // r15 char *v83; // rbx __int64 v84; // rax size_t v85; // r14 cocos2d::CCDictionary *m_gauntletCurrencyScores; // r15 const char *v87; // r12 size_t v88; // rax size_t v89; // rbx char *v90; // r14 cocos2d::CCDictionary *v91; // r12 size_t v92; // r15 cocos2d::CCArray *v93; // r14 unsigned int v94; // r13d cocos2d::CCString *v95; // rax int v96; // ebx GameLevelManager *v97; // rax GJGameLevel *SavedDailyLevel; // rax cocos2d::CCString *v99; // rax const char *v100; // r12 size_t v101; // rax size_t v102; // r15 char *v103; // rbx __int64 v104; // rax size_t v105; // r14 cocos2d::CCDictionary *m_timelyCurrencyScores; // r15 const char *v107; // r12 size_t v108; // rax size_t v109; // rbx char *v110; // r14 cocos2d::CCDictionary *v111; // r12 size_t v112; // r15 cocos2d::CCDictionary *m_timelyStars; // r15 const char *v114; // r12 size_t v115; // rax size_t v116; // rbx char *v117; // r14 cocos2d::CCDictionary *v118; // r12 size_t v119; // r15 char v121; // [rsp+0h] [rbp-80h] const char *v122; // [rsp+8h] [rbp-78h] const char *v123; // [rsp+8h] [rbp-78h] const char *v124; // [rsp+8h] [rbp-78h] const char *v125; // [rsp+8h] [rbp-78h] const char *v126; // [rsp+10h] [rbp-70h] const char *v127; // [rsp+10h] [rbp-70h] const char *v128; // [rsp+10h] [rbp-70h] cocos2d::CCArray *v129; // [rsp+10h] [rbp-70h] cocos2d::CCArray *v130; // [rsp+10h] [rbp-70h] cocos2d::CCArray *v131; // [rsp+10h] [rbp-70h] __int64 v132; // [rsp+20h] [rbp-60h] BYREF size_t v133; // [rsp+28h] [rbp-58h] void *__p; // [rsp+30h] [rbp-50h] size_t __dst; // [rsp+38h] [rbp-48h] BYREF size_t v136; // [rsp+40h] [rbp-40h] void *v137; // [rsp+48h] [rbp-38h] float v138; // [rsp+54h] [rbp-2Ch] v1 = 1; v2 = 0.0; v138 = 0.0; do { v3 = GameLevelManager::sharedState(); MainLevel = GameLevelManager::getMainLevel(v3, v1, 1); if ( MainLevel ) { HIDWORD(v2) = 0; *(float *)&v2 = (float)GameStatsManager::getAwardedCurrencyForLevel(a1, MainLevel); v138 = v138 + *(float *)&v2; goto LABEL_3; } v5 = (cocos2d::CCString *)sub_1007AB580("%i", v121); CString = cocos2d::CCString::getCString(v5); v7 = strlen(CString); if ( v7 >= 0xFFFFFFFFFFFFFFF8LL ) LABEL_176: sub_100006BF0(v2); v8 = v7; if ( v7 >= 0x17 ) { v10 = v7 | 7; v11 = 26; if ( (v8 | 7) != 0x17 ) v11 = v10 + 1; v9 = (char *)operator new(v11); v137 = v9; __dst = v11 + 1; v136 = v8; LABEL_12: memmove(v9, CString, v8); goto LABEL_13; } LOBYTE(__dst) = 2 * v7; v9 = (char *)&__dst + 1; if ( v7 ) goto LABEL_12; LABEL_13: v9[v8] = 0; m_mainCurrencyScores = a1->m_mainCurrencyScores; v13 = (char *)&__dst + 1; if ( (__dst & 1) != 0 ) v13 = (const char *)v137; v14 = strlen(v13); if ( v14 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v15 = v14; if ( v14 >= 0x17 ) { v126 = v13; v17 = a1->m_mainCurrencyScores; v18 = (v14 | 7) + 1; if ( (v14 | 7) == 0x17 ) v18 = 26; v16 = (char *)operator new(v18); __p = v16; v132 = v18 | 1; v133 = v15; m_mainCurrencyScores = v17; v13 = v126; LABEL_22: memmove(v16, v13, v15); goto LABEL_23; } LOBYTE(v132) = 2 * v14; v16 = (char *)&v132 + 1; if ( v14 ) goto LABEL_22; LABEL_23: v16[v15] = 0; cocos2d::CCDictionary::removeObjectForKey_1(m_mainCurrencyScores, &v132); if ( (v132 & 1) != 0 ) { operator delete(__p); if ( (__dst & 1) == 0 ) goto LABEL_3; } else if ( (__dst & 1) == 0 ) { goto LABEL_3; } operator delete(v137); LABEL_3: ++v1; } while ( v1 != 23 ); for ( i = 5001; i != 5005; ++i ) { v20 = GameLevelManager::sharedState(); v21 = GameLevelManager::getMainLevel(v20, i, 1); if ( v21 ) { HIDWORD(v2) = 0; *(float *)&v2 = (float)GameStatsManager::getAwardedCurrencyForLevel(a1, v21); v138 = v138 + *(float *)&v2; continue; } v22 = (cocos2d::CCString *)sub_1007AB580("%i", v121); v23 = cocos2d::CCString::getCString(v22); v24 = strlen(v23); if ( v24 >= 0xFFFFFFFFFFFFFFF8LL ) goto LABEL_176; v25 = v24; if ( v24 >= 0x17 ) { v27 = v24 | 7; v28 = 26; if ( (v25 | 7) != 0x17 ) v28 = v27 + 1; v26 = (char *)operator new(v28); v137 = v26; __dst = v28 + 1; v136 = v25; LABEL_39: memmove(v26, v23, v25); goto LABEL_40; } LOBYTE(__dst) = 2 * v24; v26 = (char *)&__dst + 1; if ( v24 ) goto LABEL_39; LABEL_40: v26[v25] = 0; v29 = a1->m_mainCurrencyScores; v30 = (char *)&__dst + 1; if ( (__dst & 1) != 0 ) v30 = (const char *)v137; v31 = strlen(v30); if ( v31 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v32 = v31; if ( v31 >= 0x17 ) { v127 = v30; v34 = a1->m_mainCurrencyScores; v35 = (v31 | 7) + 1; if ( (v31 | 7) == 0x17 ) v35 = 26; v33 = (char *)operator new(v35); __p = v33; v132 = v35 | 1; v133 = v32; v29 = v34; v30 = v127; LABEL_49: memmove(v33, v30, v32); goto LABEL_50; } LOBYTE(v132) = 2 * v31; v33 = (char *)&v132 + 1; if ( v31 ) goto LABEL_49; LABEL_50: v33[v32] = 0; cocos2d::CCDictionary::removeObjectForKey_1(v29, &v132); if ( (v132 & 1) != 0 ) { operator delete(__p); if ( (__dst & 1) == 0 ) continue; } else if ( (__dst & 1) == 0 ) { continue; } operator delete(v137); } for ( j = 2001; j != 2011; ++j ) { v37 = GameLevelManager::sharedState(); v38 = GameLevelManager::getMainLevel(v37, j, 1); if ( v38 ) { HIDWORD(v2) = 0; *(float *)&v2 = (float)GameStatsManager::getAwardedCurrencyForLevel(a1, v38); v138 = v138 + *(float *)&v2; continue; } v39 = (cocos2d::CCString *)sub_1007AB580("%i", v121); v40 = cocos2d::CCString::getCString(v39); v41 = strlen(v40); if ( v41 >= 0xFFFFFFFFFFFFFFF8LL ) goto LABEL_176; v42 = v41; if ( v41 >= 0x17 ) { v44 = v41 | 7; v45 = 26; if ( (v42 | 7) != 0x17 ) v45 = v44 + 1; v43 = (char *)operator new(v45); v137 = v43; __dst = v45 + 1; v136 = v42; LABEL_66: memmove(v43, v40, v42); goto LABEL_67; } LOBYTE(__dst) = 2 * v41; v43 = (char *)&__dst + 1; if ( v41 ) goto LABEL_66; LABEL_67: v43[v42] = 0; v46 = a1->m_mainCurrencyScores; v47 = (char *)&__dst + 1; if ( (__dst & 1) != 0 ) v47 = (const char *)v137; v48 = strlen(v47); if ( v48 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v49 = v48; if ( v48 >= 0x17 ) { v128 = v47; v51 = a1->m_mainCurrencyScores; v52 = (v48 | 7) + 1; if ( (v48 | 7) == 0x17 ) v52 = 26; v50 = (char *)operator new(v52); __p = v50; v132 = v52 | 1; v133 = v49; v46 = v51; v47 = v128; LABEL_76: memmove(v50, v47, v49); goto LABEL_77; } LOBYTE(v132) = 2 * v48; v50 = (char *)&v132 + 1; if ( v48 ) goto LABEL_76; LABEL_77: v50[v49] = 0; cocos2d::CCDictionary::removeObjectForKey_1(v46, &v132); if ( (v132 & 1) != 0 ) { operator delete(__p); if ( (__dst & 1) == 0 ) continue; } else if ( (__dst & 1) == 0 ) { continue; } operator delete(v137); } v53 = cocos2d::CCDictionary::allKeys(a1->m_onlineCurrencyScores); if ( (unsigned int)sub_100720070(v53) ) { v54 = 0; v129 = v53; while ( 1 ) { v55 = cocos2d::CCArray::stringAtIndex(v53, v54); v56 = cocos2d::CCString::intValue(v55); v57 = GameLevelManager::sharedState(); SavedLevel = GameLevelManager::getSavedLevel(v57, v56); if ( !SavedLevel ) break; HIDWORD(v2) = 0; *(float *)&v2 = (float)GameStatsManager::getAwardedCurrencyForLevel(a1, SavedLevel); v138 = v138 + *(float *)&v2; LABEL_85: if ( ++v54 >= (unsigned int)sub_100720070(v53) ) goto LABEL_109; } v59 = (cocos2d::CCString *)sub_1007AB580("%i", v121); v60 = cocos2d::CCString::getCString(v59); v61 = strlen(v60); if ( v61 >= 0xFFFFFFFFFFFFFFF8LL ) goto LABEL_176; v62 = v61; if ( v61 >= 0x17 ) { v64 = v61 | 7; v65 = 26; if ( (v62 | 7) != 0x17 ) v65 = v64 + 1; v63 = (char *)operator new(v65); v137 = v63; __dst = v65 + 1; v136 = v62; } else { LOBYTE(__dst) = 2 * v61; v63 = (char *)&__dst + 1; if ( !v61 ) { LABEL_95: v63[v62] = 0; m_onlineCurrencyScores = a1->m_onlineCurrencyScores; v67 = (char *)&__dst + 1; if ( (__dst & 1) != 0 ) v67 = (const char *)v137; v68 = strlen(v67); if ( v68 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v69 = v68; if ( v68 >= 0x17 ) { v122 = v67; v71 = a1->m_onlineCurrencyScores; v72 = (v68 | 7) + 1; if ( (v68 | 7) == 0x17 ) v72 = 26; v70 = (char *)operator new(v72); __p = v70; v132 = v72 | 1; v133 = v69; m_onlineCurrencyScores = v71; v67 = v122; } else { LOBYTE(v132) = 2 * v68; v70 = (char *)&v132 + 1; if ( !v68 ) goto LABEL_105; } memmove(v70, v67, v69); LABEL_105: v70[v69] = 0; cocos2d::CCDictionary::removeObjectForKey_1(m_onlineCurrencyScores, &v132); v53 = v129; if ( (v132 & 1) != 0 ) operator delete(__p); if ( (__dst & 1) != 0 ) operator delete(v137); goto LABEL_85; } } memmove(v63, v60, v62); goto LABEL_95; } LABEL_109: v73 = cocos2d::CCDictionary::allKeys(a1->m_gauntletCurrencyScores); if ( (unsigned int)sub_100720070(v73) ) { v74 = 0; v130 = v73; while ( 1 ) { v75 = cocos2d::CCArray::stringAtIndex(v73, v74); v76 = cocos2d::CCString::intValue(v75); v77 = GameLevelManager::sharedState(); SavedGauntletLevel = GameLevelManager::getSavedGauntletLevel(v77, v76); if ( !SavedGauntletLevel ) break; HIDWORD(v2) = 0; *(float *)&v2 = (float)GameStatsManager::getAwardedCurrencyForLevel(a1, SavedGauntletLevel); v138 = v138 + *(float *)&v2; LABEL_112: if ( ++v74 >= (unsigned int)sub_100720070(v73) ) goto LABEL_136; } v79 = (cocos2d::CCString *)sub_1007AB580("%i", v121); v80 = cocos2d::CCString::getCString(v79); v81 = strlen(v80); if ( v81 >= 0xFFFFFFFFFFFFFFF8LL ) goto LABEL_176; v82 = v81; if ( v81 >= 0x17 ) { v84 = v81 | 7; v85 = 26; if ( (v82 | 7) != 0x17 ) v85 = v84 + 1; v83 = (char *)operator new(v85); v137 = v83; __dst = v85 + 1; v136 = v82; } else { LOBYTE(__dst) = 2 * v81; v83 = (char *)&__dst + 1; if ( !v81 ) { LABEL_122: v83[v82] = 0; m_gauntletCurrencyScores = a1->m_gauntletCurrencyScores; v87 = (char *)&__dst + 1; if ( (__dst & 1) != 0 ) v87 = (const char *)v137; v88 = strlen(v87); if ( v88 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v89 = v88; if ( v88 >= 0x17 ) { v123 = v87; v91 = a1->m_gauntletCurrencyScores; v92 = (v88 | 7) + 1; if ( (v88 | 7) == 0x17 ) v92 = 26; v90 = (char *)operator new(v92); __p = v90; v132 = v92 | 1; v133 = v89; m_gauntletCurrencyScores = v91; v87 = v123; } else { LOBYTE(v132) = 2 * v88; v90 = (char *)&v132 + 1; if ( !v88 ) goto LABEL_132; } memmove(v90, v87, v89); LABEL_132: v90[v89] = 0; cocos2d::CCDictionary::removeObjectForKey_1(m_gauntletCurrencyScores, &v132); v73 = v130; if ( (v132 & 1) != 0 ) operator delete(__p); if ( (__dst & 1) != 0 ) operator delete(v137); goto LABEL_112; } } memmove(v83, v80, v82); goto LABEL_122; } LABEL_136: v93 = cocos2d::CCDictionary::allKeys(a1->m_timelyCurrencyScores); if ( (unsigned int)sub_100720070(v93) ) { v94 = 0; v131 = v93; while ( 1 ) { v95 = cocos2d::CCArray::stringAtIndex(v93, v94); v96 = cocos2d::CCString::intValue(v95); v97 = GameLevelManager::sharedState(); SavedDailyLevel = GameLevelManager::getSavedDailyLevel(v97, v96); if ( !SavedDailyLevel ) break; HIDWORD(v2) = 0; *(float *)&v2 = (float)GameStatsManager::getAwardedCurrencyForLevel(a1, SavedDailyLevel); v138 = v138 + *(float *)&v2; LABEL_139: if ( ++v94 >= (unsigned int)sub_100720070(v93) ) return (int)v138; } v99 = (cocos2d::CCString *)sub_1007AB580("%i", v121); v100 = cocos2d::CCString::getCString(v99); v101 = strlen(v100); if ( v101 >= 0xFFFFFFFFFFFFFFF8LL ) goto LABEL_176; v102 = v101; if ( v101 >= 0x17 ) { v104 = v101 | 7; v105 = 26; if ( (v102 | 7) != 0x17 ) v105 = v104 + 1; v103 = (char *)operator new(v105); v137 = v103; __dst = v105 + 1; v136 = v102; } else { LOBYTE(__dst) = 2 * v101; v103 = (char *)&__dst + 1; if ( !v101 ) { LABEL_149: v103[v102] = 0; m_timelyCurrencyScores = a1->m_timelyCurrencyScores; v107 = (char *)&__dst + 1; if ( (__dst & 1) != 0 ) v107 = (const char *)v137; v108 = strlen(v107); if ( v108 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v109 = v108; if ( v108 >= 0x17 ) { v124 = v107; v111 = a1->m_timelyCurrencyScores; v112 = (v108 | 7) + 1; if ( (v108 | 7) == 0x17 ) v112 = 26; v110 = (char *)operator new(v112); __p = v110; v132 = v112 | 1; v133 = v109; m_timelyCurrencyScores = v111; v107 = v124; } else { LOBYTE(v132) = 2 * v108; v110 = (char *)&v132 + 1; if ( !v108 ) { LABEL_159: v110[v109] = 0; cocos2d::CCDictionary::removeObjectForKey_1(m_timelyCurrencyScores, &v132); if ( (v132 & 1) != 0 ) operator delete(__p); m_timelyStars = a1->m_timelyStars; v114 = (char *)&__dst + 1; if ( (__dst & 1) != 0 ) v114 = (const char *)v137; v115 = strlen(v114); if ( v115 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v2); v116 = v115; if ( v115 >= 0x17 ) { v125 = v114; v118 = a1->m_timelyStars; v119 = (v115 | 7) + 1; if ( (v115 | 7) == 0x17 ) v119 = 26; v117 = (char *)operator new(v119); __p = v117; v132 = v119 | 1; v133 = v116; m_timelyStars = v118; v114 = v125; } else { LOBYTE(v132) = 2 * v115; v117 = (char *)&v132 + 1; if ( !v115 ) goto LABEL_171; } memmove(v117, v114, v116); LABEL_171: v117[v116] = 0; cocos2d::CCDictionary::removeObjectForKey_1(m_timelyStars, &v132); v93 = v131; if ( (v132 & 1) != 0 ) operator delete(__p); if ( (__dst & 1) != 0 ) operator delete(v137); goto LABEL_139; } } memmove(v110, v107, v109); goto LABEL_159; } } memmove(v103, v100, v102); goto LABEL_149; } return (int)v138; }
GD Web Decomp Icon

GD Web Decomp

Raw Source