// // GJAccountManager::onSyncAccountCompleted from 0x1000d0710 to 0x1000d144a (3386 bytes) // // 1 xrefs: // > GJAccountManager::handleIt @ 0x1000cf831 // // 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 __fastcall GJAccountManager::onSyncAccountCompleted(GJAccountManager *a1, unsigned __int8 *a2, double a3) { unsigned __int64 v5; // rcx const void *v6; // rdi size_t v7; // rdx GJAccountSyncDelegate *v8; // rdi cocos2d::CCString *v9; // rax const char *CString; // rbx size_t v11; // rax size_t v12; // r13 char *v13; // r14 size_t v14; // r12 void *v15; // rbx unsigned int v16; // eax size_t v17; // rax void *v18; // rdi size_t v19; // rdx char *v20; // rsi bool v21; // zf char v22; // r12 GJAccountDelegate *m_accountDelegate; // rdi GJAccountSyncDelegate *m_syncDelegate; // rdi unsigned __int8 v25; // r14 const char *v26; // r12 cocos2d::CCArray *v27; // r13 GameLevelManager *v28; // rax bool m_dontNotify; // r14 GameStatsManager *v30; // rax cocos2d::CCString *v31; // rax const char *v32; // rbx size_t v33; // rax size_t v34; // r12 char *v35; // r15 size_t v36; // r14 cocos2d::CCString *v37; // rax cocos2d::CCString *v38; // rax const char *v39; // r14 size_t v40; // rax size_t v41; // r12 char *v42; // rbx cocos2d::CCArray *v43; // r13 size_t v44; // r13 cocos2d::CCString *v45; // rax GameManager *v46; // rax LocalLevelManager *v47; // rax cocos2d::CCString *v48; // rax cocos2d::CCString *v49; // rax cocos2d::CCString *v50; // rax const char *v51; // r14 size_t v52; // rax _BYTE *size; // r12 char *v54; // rbx size_t v55; // r13 char *v56; // r14 cocos2d::CCArray *v57; // r13 unsigned __int64 v58; // r12 size_t v59; // rax size_t v60; // r12 char *v61; // rbx GJAccountSyncDelegate *v62; // rbx unsigned int v63; // eax size_t v64; // r13 int v65; // ebx cocos2d::CCString *v66; // rax const char *v67; // r14 size_t v68; // rax size_t v69; // r15 char *v70; // rbx size_t v71; // r13 std::string::size_type v72; // r14 char *v73; // r15 unsigned __int64 v74; // r14 std::string::size_type v75; // rax std::string::size_type v76; // r14 char *v77; // rbx std::string::value_type v78; // r13 std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v79; // r15 size_t v80; // r13 GameLevelManager *v81; // rbx __int64 MapPacks; // r13 unsigned int v83; // r14d std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v84; // al std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v85; // r15 GJMapPack *v86; // rbx GameStatsManager *v87; // rax GameStatsManager *v88; // rax GameManager *v89; // rbx GameStatsManager *v90; // rax GameStatsManager *v91; // rax GameStatsManager *v92; // rax GameManager *v93; // r12 __int64 v94; // rax _OWORD *v95; // r14 cocos2d::CCDictionary *v96; // rax GameStatsManager *v97; // rax GJAccountSyncDelegate *v98; // rdi char v99; // bl char v100; // [rsp+0h] [rbp-140h] std::string v101; // [rsp+8h] [rbp-138h] BYREF std::string __str; // [rsp+20h] [rbp-120h] BYREF _QWORD __dst[2]; // [rsp+38h] [rbp-108h] BYREF void *v104; // [rsp+48h] [rbp-F8h] void *v105[2]; // [rsp+50h] [rbp-F0h] BYREF void *v106; // [rsp+60h] [rbp-E0h] void *v107[2]; // [rsp+68h] [rbp-D8h] BYREF void *v108; // [rsp+78h] [rbp-C8h] GJAccountManager *v109; // [rsp+80h] [rbp-C0h] void *data; // [rsp+88h] [rbp-B8h] int v111; // [rsp+90h] [rbp-B0h] __int16 v112; // [rsp+94h] [rbp-ACh] int v113; // [rsp+98h] [rbp-A8h] __int16 v114; // [rsp+9Ch] [rbp-A4h] char __s[8]; // [rsp+A0h] [rbp-A0h] BYREF unsigned __int64 v116; // [rsp+A8h] [rbp-98h] char *v117; // [rsp+B0h] [rbp-90h] std::string v118; // [rsp+B8h] [rbp-88h] BYREF size_t __s2; // [rsp+D0h] [rbp-70h] BYREF size_t v120; // [rsp+D8h] [rbp-68h] void *__p; // [rsp+E0h] [rbp-60h] int v122; // [rsp+ECh] [rbp-54h] char v123[8]; // [rsp+F0h] [rbp-50h] BYREF unsigned __int64 v124; // [rsp+F8h] [rbp-48h] char *v125; // [rsp+100h] [rbp-40h] int v126; // [rsp+108h] [rbp-38h] bool m_skipIncrementChallenge; // [rsp+10Eh] [rbp-32h] bool v128; // [rsp+10Fh] [rbp-31h] void *__s1; // [rsp+110h] [rbp-30h] GJAccountManager::removeDLFromActive(a1, "sync_account"); LOBYTE(__s2) = 4; *(_WORD *)((char *)&__s2 + 1) = 12589; BYTE3(__s2) = 0; v5 = *a2 >> 1; v6 = *((const void **)a2 + 2); if ( (*a2 & 1) != 0 ) v5 = *((_QWORD *)a2 + 1); else v6 = a2 + 1; v7 = 2; if ( v5 < 2 ) v7 = v5; if ( (v5 != 2) | (memcmp(v6, (char *)&__s2 + 1, v7) != 0) ) { __s1 = a2 + 1; v109 = a1; v9 = (cocos2d::CCString *)sub_1007AB580("%i", v100); CString = cocos2d::CCString::getCString(v9); v11 = strlen(CString); if ( v11 >= 0xFFFFFFFFFFFFFFF8LL ) goto LABEL_171; v12 = v11; if ( v11 >= 0x17 ) { v14 = 26; if ( (v11 | 7) != 0x17 ) v14 = (v11 | 7) + 1; v13 = (char *)operator new(v14); __p = v13; __s2 = v14 + 1; v120 = v12; } else { LOBYTE(__s2) = 2 * v11; v13 = (char *)&__s2 + 1; if ( !v11 ) { LABEL_17: v13[v12] = 0; v15 = __p; v16 = *a2; if ( (v16 & 1) != 0 ) { v17 = *((_QWORD *)a2 + 1); v18 = *((void **)a2 + 2); } else { v17 = v16 >> 1; v18 = __s1; } v19 = (unsigned __int8)__s2 >> 1; if ( (__s2 & 1) != 0 ) v19 = v120; v20 = (char *)__p; if ( (__s2 & 1) == 0 ) v20 = (char *)&__s2 + 1; v21 = v19 == v17; if ( v19 >= v17 ) v19 = v17; v22 = v21 & (memcmp(v18, v20, v19) == 0); if ( (__s2 & 1) != 0 ) operator delete(v15); if ( v22 ) { std::string::assign((std::string *)&v109->m_password, ""); std::string::assign((std::string *)&v109->m_GJP2, ""); m_accountDelegate = v109->m_accountDelegate; if ( m_accountDelegate ) ((void (__fastcall *)(GJAccountDelegate *))m_accountDelegate->accountStatusChanged)(m_accountDelegate); m_syncDelegate = v109->m_syncDelegate; if ( m_syncDelegate ) ((void (__fastcall *)(GJAccountSyncDelegate *, __int64, _QWORD))m_syncDelegate->syncAccountFailed)( m_syncDelegate, 4294967294LL, 0); return; } v25 = *a2; if ( (*a2 & 1) != 0 ) { v26 = (const char *)__s1; if ( *((_QWORD *)a2 + 1) <= 9u && atoi(*((const char **)a2 + 2)) < 0 ) { LABEL_84: v62 = v109->m_syncDelegate; if ( v62 ) { if ( (v25 & 1) != 0 ) v26 = *((const char **)a2 + 2); v63 = atoi(v26); ((void (__fastcall *)(GJAccountSyncDelegate *, __int64, _QWORD))v62->syncAccountFailed)( v62, 4294967293LL, v63); } return; } } else { v26 = (const char *)__s1; if ( v25 < 0x14u && atoi((const char *)__s1) < 0 ) goto LABEL_84; } v27 = (cocos2d::CCArray *)sub_1000D2610(a2, ";"); if ( (unsigned int)sub_100720070(v27) <= 5 ) { v8 = v109->m_syncDelegate; if ( v8 ) goto LABEL_8; return; } v28 = GameLevelManager::sharedState(); GameLevelManager::makeTimeStamp(v28, "sync_account"); m_dontNotify = AchievementManager::sharedState()->m_dontNotify; AchievementManager::sharedState()->m_dontNotify = 1; m_skipIncrementChallenge = GameStatsManager::sharedState()->m_skipIncrementChallenge; GameStatsManager::sharedState()->m_skipIncrementChallenge = 1; v30 = GameStatsManager::sharedState(); GameStatsManager::preSaveGameStats(v30); GameStatsManager::sharedState()->m_usePlayerStatsCCDictionary = 1; v31 = cocos2d::CCArray::stringAtIndex(v27, 0); v32 = cocos2d::CCString::getCString(v31); v33 = strlen(v32); if ( v33 < 0xFFFFFFFFFFFFFFF8LL ) { v34 = v33; v128 = m_dontNotify; if ( v33 >= 0x17 ) { v36 = 26; if ( (v33 | 7) != 0x17 ) v36 = (v33 | 7) + 1; v35 = (char *)operator new(v36); __p = v35; __s2 = v36 + 1; v120 = v34; } else { LOBYTE(__s2) = 2 * v33; v35 = (char *)&__s2 + 1; if ( !v33 ) { LABEL_50: v35[v34] = 0; v37 = cocos2d::CCArray::stringAtIndex(v27, 0); if ( (v37->m_sString.m_data.m_short.sizex2 & 1) != 0 ) { *v37->m_sString.m_data.m_long.longStorage = 0; v37->m_sString.m_data.m_long.size = 0; } else { *(_WORD *)&v37->m_sString.m_data.m_short.sizex2 = 0; } __s1 = v27; v38 = cocos2d::CCArray::stringAtIndex(v27, 1u); v39 = cocos2d::CCString::getCString(v38); v40 = strlen(v39); if ( v40 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(a3); v41 = v40; if ( v40 >= 0x17 ) { v44 = 26; if ( (v40 | 7) != 0x17 ) v44 = (v40 | 7) + 1; v42 = (char *)operator new(v44); v104 = v42; __dst[0] = v44 | 1; __dst[1] = v41; v43 = (cocos2d::CCArray *)__s1; } else { LOBYTE(__dst[0]) = 2 * v40; v42 = (char *)__dst + 1; v43 = (cocos2d::CCArray *)__s1; if ( !v40 ) { LABEL_61: v42[v41] = 0; v45 = cocos2d::CCArray::stringAtIndex(v43, 1u); if ( (v45->m_sString.m_data.m_short.sizex2 & 1) != 0 ) { *v45->m_sString.m_data.m_long.longStorage = 0; v45->m_sString.m_data.m_long.size = 0; } else { *(_WORD *)&v45->m_sString.m_data.m_short.sizex2 = 0; } v46 = GameManager::sharedState(); GManager::loadFromCompressedString(v46, &__s2); v47 = LocalLevelManager::sharedState(); GManager::loadFromCompressedString(v47, __dst); v48 = cocos2d::CCArray::stringAtIndex(v43, 2u); cocos2d::CCString::intValue(v48); v49 = cocos2d::CCArray::stringAtIndex(v43, 3u); cocos2d::CCString::intValue(v49); v50 = cocos2d::CCArray::stringAtIndex(v43, 4u); v51 = cocos2d::CCString::getCString(v50); v52 = strlen(v51); if ( v52 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(a3); size = (_BYTE *)v52; if ( v52 >= 0x17 ) { v55 = 26; if ( (v52 | 7) != 0x17 ) v55 = (v52 | 7) + 1; v54 = (char *)operator new(v55); v117 = v54; *(_QWORD *)__s = v55 | 1; v116 = (unsigned __int64)size; } else { __s[0] = 2 * v52; v54 = &__s[1]; if ( !v52 ) { LABEL_72: size[(_QWORD)v54] = 0; if ( (__s[0] & 1) != 0 ) { v56 = v117; v57 = (cocos2d::CCArray *)__s1; if ( strlen(v117) > 0x28 ) { v58 = v116; if ( v116 > 0x13 ) { LABEL_78: v59 = v58 - 40; v60 = v58 - 20; if ( v60 >= v59 ) v60 = v59; if ( v60 >= 0x17 ) { v64 = 26; if ( (v60 | 7) != 0x17 ) v64 = (v60 | 7) + 1; v61 = (char *)operator new(v64); v125 = v61; *(_QWORD *)v123 = v64 | 1; v124 = v60; v57 = (cocos2d::CCArray *)__s1; } else { v123[0] = 2 * v60; v61 = &v123[1]; if ( !v60 ) goto LABEL_92; } memmove(v61, v56 + 20, v60); LABEL_92: v61[v60] = 0; if ( (__s[0] & 1) != 0 ) { *v117 = 0; v116 = 0; } else { *(_WORD *)__s = 0; } cocos2d::ZipUtils::decompressString(&v118); v65 = (int)v118.__r_.__value_.__l.0; v122 = (unsigned __int8)v118.__r_.__value_.__s.__data_[0]; data = v118.__r_.__value_.__l.__data_; size = (_BYTE *)v118.__r_.__value_.__l.__size_; v111 = *(_DWORD *)&v118.__r_.__value_.__s.__data_[1]; v112 = HIWORD(v118.__r_.__value_.__r.__words[0]); if ( (v123[0] & 1) != 0 ) { *v125 = 0; v124 = 0; if ( (v123[0] & 1) != 0 ) operator delete(v125); } v126 = v65; LABEL_99: v66 = cocos2d::CCArray::stringAtIndex(v57, 5u); v67 = cocos2d::CCString::getCString(v66); v68 = strlen(v67); if ( v68 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(a3); v69 = v68; if ( v68 >= 0x17 ) { v71 = 26; if ( (v68 | 7) != 0x17 ) v71 = (v68 | 7) + 1; v70 = (char *)operator new(v71); v125 = v70; *(_QWORD *)v123 = v71 | 1; v124 = v69; } else { v123[0] = 2 * v68; v70 = &v123[1]; if ( !v68 ) { LABEL_107: v70[v69] = 0; v72 = (unsigned __int8)v123[0]; if ( (v123[0] & 1) != 0 ) { v73 = v125; if ( strlen(v125) > 0x28 ) { v74 = v124; if ( v124 > 0x13 ) { LABEL_113: v75 = v74 - 40; v76 = v74 - 20; if ( v76 >= v75 ) v76 = v75; if ( v76 >= 0x17 ) { v80 = 26; if ( (v76 | 7) != 0x17 ) v80 = (v76 | 7) + 1; v77 = (char *)operator new(v80); v118.__r_.__value_.__r.__words[2] = (std::string::size_type)v77; v118.__r_.__value_.__r.__words[0] = v80 | 1; v118.__r_.__value_.__l.__size_ = v76; } else { v118.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v76); v77 = v118.__r_.__value_.__s.__data_; if ( !v76 ) { LABEL_123: v77[v76] = 0; if ( (v123[0] & 1) != 0 ) { *v125 = 0; v124 = 0; } else { *(_WORD *)v123 = 0; } cocos2d::ZipUtils::decompressString(&v101); v79 = v101.__r_.__value_.__s.0; v78 = v101.__r_.__value_.__s.__data_[0]; __s1 = v101.__r_.__value_.__l.__data_; v72 = v101.__r_.__value_.__l.__size_; v113 = *(_DWORD *)&v101.__r_.__value_.__s.__data_[1]; v114 = HIWORD(v101.__r_.__value_.__r.__words[0]); if ( (*(_BYTE *)&v118.__r_.__value_.__s.0 & 1) != 0 ) { *v118.__r_.__value_.__l.__data_ = 0; v118.__r_.__value_.__l.__size_ = 0; if ( (*(_BYTE *)&v118.__r_.__value_.__s.0 & 1) != 0 ) operator delete(v118.__r_.__value_.__l.__data_); } LABEL_129: v81 = GameLevelManager::sharedState(); if ( (*(_BYTE *)&v79 & 1) != 0 ) { sub_100006B70(v105, __s1, v72, a3); } else { LOBYTE(v105[0]) = v79; BYTE1(v105[0]) = v78; *(_DWORD *)((char *)v105 + 2) = v113; HIWORD(v105[0]) = v114; v105[1] = (void *)v72; v106 = __s1; } MapPacks = GameLevelManager::createAndGetMapPacks(v81, v105); if ( ((__int64)v105[0] & 1) != 0 ) operator delete(v106); v83 = 0; v84 = 0; if ( (*(_BYTE *)&v79 & 1) != 0 ) { *(_BYTE *)__s1 = 0; v84 = v79; } v85 = v84; while ( v83 < (unsigned int)sub_100720070(MapPacks) ) { v86 = (GJMapPack *)sub_1007200C0(MapPacks, v83); if ( GJMapPack::hasCompletedMapPack(v86) ) { v87 = GameStatsManager::sharedState(); GameStatsManager::completedMapPack(v87, v86); } v88 = GameStatsManager::sharedState(); GameStatsManager::setStarsForMapPack(v88, v86->m_packID, v86->m_stars); ++v83; } v89 = GameManager::sharedState(); if ( (v126 & 1) != 0 ) { sub_100006B70(v107, data, (unsigned __int64)size, a3); } else { LOBYTE(v107[0]) = v126; BYTE1(v107[0]) = v122; *(_DWORD *)((char *)v107 + 2) = v111; HIWORD(v107[0]) = v112; v107[1] = size; v108 = data; } GameManager::recountUserStats(v89, v107); if ( ((__int64)v107[0] & 1) != 0 ) operator delete(v108); v90 = GameStatsManager::sharedState(); GameStatsManager::verifyUserCoins(v90); v91 = GameStatsManager::sharedState(); GameStatsManager::tryFixPathBug(v91); v92 = GameStatsManager::sharedState(); GameStatsManager::verifyPathAchievements(v92); v93 = GameManager::sharedState(); v94 = qword_10099EF40; if ( qword_10099EF40 ) { if ( (*(_BYTE *)(qword_10099EF40 + 328) & 1) == 0 ) { LABEL_148: __str = *(std::string *)(v94 + 328); goto LABEL_153; } } else { v95 = operator new(0x1D8u); cocos2d::CCNode::CCNode(v95); *(_QWORD *)v95 = off_1008B9370; a3 = 0.0; v95[20] = 0; v95[21] = 0; *(_OWORD *)((char *)v95 + 348) = 0; v95[23] = 0; v95[24] = 0; v95[25] = 0; v95[26] = 0; v95[27] = 0; v95[28] = 0; *((_QWORD *)v95 + 58) = 0; qword_10099EF40 = (__int64)v95; if ( cocos2d::CCNode::init((cocos2d::CCNode *)v95) ) { v96 = cocos2d::CCDictionary::create(); *((_QWORD *)v95 + 40) = v96; cocos2d::CCObject::retain(v96); } v94 = qword_10099EF40; if ( (*(_BYTE *)(qword_10099EF40 + 328) & 1) == 0 ) goto LABEL_148; } sub_100006B70(&__str, *(const void **)(v94 + 344), *(_QWORD *)(v94 + 336), a3); LABEL_153: std::string::operator=((std::string *)&v93->m_playerName, &__str); if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 ) operator delete(__str.__r_.__value_.__l.__data_); GameStatsManager::sharedState()->m_usePlayerStatsCCDictionary = 0; v97 = GameStatsManager::sharedState(); GameStatsManager::postLoadGameStats(v97); GameStatsManager::sharedState()->m_skipIncrementChallenge = m_skipIncrementChallenge; AchievementManager::sharedState()->m_dontNotify = v128; v98 = v109->m_syncDelegate; if ( v98 ) ((void (__fastcall *)(GJAccountSyncDelegate *))v98->syncAccountFinished)(v98); if ( (v123[0] & 1) != 0 ) { operator delete(v125); if ( (*(_BYTE *)&v85 & 1) == 0 ) { LABEL_159: v99 = v126; if ( (__s[0] & 1) == 0 ) goto LABEL_160; goto LABEL_167; } } else if ( (*(_BYTE *)&v85 & 1) == 0 ) { goto LABEL_159; } operator delete(__s1); v99 = v126; if ( (__s[0] & 1) == 0 ) { LABEL_160: if ( (v99 & 1) == 0 ) goto LABEL_161; goto LABEL_168; } LABEL_167: operator delete(v117); if ( (v99 & 1) == 0 ) { LABEL_161: if ( (__dst[0] & 1) == 0 ) goto LABEL_162; goto LABEL_169; } LABEL_168: operator delete(data); if ( (__dst[0] & 1) == 0 ) { LABEL_162: if ( (__s2 & 1) == 0 ) return; goto LABEL_163; } LABEL_169: operator delete(v104); if ( (__s2 & 1) == 0 ) return; LABEL_163: operator delete(__p); return; } } memmove(v77, v73 + 20, v76); goto LABEL_123; } LABEL_176: sub_1000547C0(); } } else { v73 = &v123[1]; if ( strlen(&v123[1]) > 0x28 ) { if ( v123[0] >= 0x28u ) { v74 = (unsigned __int8)v123[0] >> 1; goto LABEL_113; } goto LABEL_176; } } v78 = 0; v79 = 0; goto LABEL_129; } } memmove(v70, v67, v69); goto LABEL_107; } LABEL_175: sub_1000547C0(); } } else { v56 = &__s[1]; v57 = (cocos2d::CCArray *)__s1; if ( strlen(&__s[1]) > 0x28 ) { if ( __s[0] >= 0x28u ) { v58 = (unsigned __int8)__s[0] >> 1; goto LABEL_78; } goto LABEL_175; } } v122 = 0; v126 = 0; goto LABEL_99; } } memmove(v54, v51, (size_t)size); goto LABEL_72; } } memmove(v42, v39, v41); goto LABEL_61; } } memmove(v35, v32, v34); goto LABEL_50; } LABEL_171: sub_100006BF0(a3); } } memmove(v13, CString, v12); goto LABEL_17; } v8 = a1->m_syncDelegate; if ( v8 ) LABEL_8: ((void (__fastcall *)(GJAccountSyncDelegate *, __int64, _QWORD))v8->syncAccountFailed)(v8, 0xFFFFFFFFLL, 0); }
GD Web Decomp Icon

GD Web Decomp

Raw Source