{"type": "func", "start": 4295804928, "end": 4295805365, "name": "AccountLayer::onSync", "pseudocode": "// \n// AccountLayer::onSync from 0x1000cc800 to 0x1000cc9b5 (437 bytes)\n// \n// 1 xrefs:\n// > AccountLayer::customSetup @ 0x1000cc02d\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid __fastcall AccountLayer::onSync(AccountLayer *a1, cocos2d::CCObject *a2)\n{\n  GameLevelManager *v2; // rax\n  cocos2d::CCString *v3; // rax\n  const char *CString; // r14\n  size_t v5; // rax\n  size_t v6; // rbx\n  char *v7; // r15\n  __int64 v8; // rbx\n  size_t v9; // r12\n  _QWORD v10[2]; // [rsp+0h] [rbp-50h] BYREF\n  void *__p; // [rsp+10h] [rbp-40h]\n  _QWORD __dst[2]; // [rsp+18h] [rbp-38h] BYREF\n  void *v13; // [rsp+28h] [rbp-28h]\n\n  v2 = GameLevelManager::sharedState();\n  if ( (unsigned int)(GameLevelManager::getTimeLeft(v2, \"sync_account\", 30.0) - 1) <= 0x1D )\n  {\n    v3 = (cocos2d::CCString *)sub_1007AB580(\n                                \"Please wait %i seconds before attempting to sync your account again.\",\n                                v10[0]);\n    CString = cocos2d::CCString::getCString(v3);\n    v5 = strlen(CString);\n    if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )\n      sub_100006BF0(COERCE_DOUBLE(1106247680));\n    v6 = v5;\n    if ( v5 >= 0x17 )\n    {\n      v9 = 26;\n      if ( (v5 | 7) != 0x17 )\n        v9 = (v5 | 7) + 1;\n      v7 = (char *)operator new(v9);\n      v13 = v7;\n      __dst[0] = v9 + 1;\n      __dst[1] = v6;\n    }\n    else\n    {\n      LOBYTE(__dst[0]) = 2 * v5;\n      v7 = (char *)__dst + 1;\n      if ( !v5 )\n      {\nLABEL_13:\n        v7[v6] = 0;\n        v8 = FLAlertLayer::create_1(0, \"Too fast\", __dst, \"OK\", 0, 300.0);\n        if ( (__dst[0] & 1) != 0 )\n          operator delete(v13);\n        goto LABEL_15;\n      }\n    }\n    memmove(v7, CString, v6);\n    goto LABEL_13;\n  }\n  __p = operator new(0x88u);\n  v10[0] = 137;\n  v10[1] = 131;\n  strcpy(\n    (char *)__p,\n    \"Do you want to <cg>download</c> your account data from the <cl>cloud</c>?\\n\"\n    \"<cy>This will merge current data with the saved data.</c>\");\n  v8 = FLAlertLayer::create_1(&a1->FLAlertLayerProtocol, \"Load Data\", v10, \"Cancel\", \"Load\", 300.0);\n  if ( (v10[0] & 1) != 0 )\n    operator delete(__p);\n  (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v8 + 72LL))(v8, 2);\nLABEL_15:\n  (*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 1288LL))(v8);\n}", "assembly": "; \n; AccountLayer::onSync from 0x1000cc800 to 0x1000cc9b5 (437 bytes)\n; \n; 1 xrefs:\n; > AccountLayer::customSetup @ 0x1000cc02d\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\npush    rbp                                                            ; +0x0, 0x1000cc800\nmov     rbp, rsp                                                       ; +0x1, 0x1000cc801\npush    r15                                                            ; +0x4, 0x1000cc804\npush    r14                                                            ; +0x6, 0x1000cc806\npush    r12                                                            ; +0x8, 0x1000cc808\npush    rbx                                                            ; +0xa, 0x1000cc80a\nsub     rsp, 30h                                                       ; +0xb, 0x1000cc80b\nmov     rbx, rdi                                                       ; +0xf, 0x1000cc80f\ncall    GameLevelManager__sharedState                                  ; +0x12, 0x1000cc812\nlea     rsi, aSyncAccount; \"sync_account\"                              ; +0x17, 0x1000cc817\nmovss   xmm0, cs:dword_100814FD0                                       ; +0x1e, 0x1000cc81e\nmov     rdi, rax                                                       ; +0x26, 0x1000cc826\ncall    GameLevelManager__getTimeLeft                                  ; +0x29, 0x1000cc829\nlea     ecx, [rax-1]                                                   ; +0x2e, 0x1000cc82e\ncmp     ecx, 1Dh                                                       ; +0x31, 0x1000cc831\nja      short loc_1000CC888                                            ; +0x34, 0x1000cc834\nlea     rdi, aPleaseWaitISec_0; \"Please wait %i seconds before attemptin\"... ; +0x36, 0x1000cc836\nmov     esi, eax                                                       ; +0x3d, 0x1000cc83d\nxor     eax, eax                                                       ; +0x3f, 0x1000cc83f\ncall    sub_1007AB580                                                  ; +0x41, 0x1000cc841\nmov     rdi, rax                                                       ; +0x46, 0x1000cc846\ncall    cocos2d__CCString__getCString                                  ; +0x49, 0x1000cc849\nmov     r14, rax                                                       ; +0x4e, 0x1000cc84e\nmov     rdi, rax; __s                                                  ; +0x51, 0x1000cc851\ncall    _strlen                                                        ; +0x54, 0x1000cc854\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x59, 0x1000cc859\njnb     loc_1000CC9B0                                                  ; +0x5d, 0x1000cc85d\nmov     rbx, rax                                                       ; +0x63, 0x1000cc863\ncmp     rax, 17h                                                       ; +0x66, 0x1000cc866\njnb     loc_1000CC91B                                                  ; +0x6a, 0x1000cc86a\nlea     eax, [rbx+rbx]                                                 ; +0x70, 0x1000cc870\nmov     byte ptr [rbp+__dst], al                                       ; +0x73, 0x1000cc873\nlea     r15, [rbp+__dst+1]                                             ; +0x76, 0x1000cc876\ntest    rbx, rbx                                                       ; +0x7a, 0x1000cc87a\njnz     loc_1000CC94E                                                  ; +0x7d, 0x1000cc87d\njmp     loc_1000CC95C                                                  ; +0x83, 0x1000cc883\nadd     rbx, 278h                                                      ; +0x88, 0x1000cc888\nmov     edi, 88h; __sz                                                 ; +0x8f, 0x1000cc88f\ncall    __Znwm; operator new(ulong)                                    ; +0x94, 0x1000cc894\nmov     r14, rax                                                       ; +0x99, 0x1000cc899\nlea     r15, [rbp+__p]                                                 ; +0x9c, 0x1000cc89c\nmov     [rbp+__p], rax                                                 ; +0xa0, 0x1000cc8a0\nmov     [rbp+var_50], 89h                                              ; +0xa4, 0x1000cc8a4\nmov     [rbp+var_48], 83h                                              ; +0xac, 0x1000cc8ac\nlea     rsi, aDoYouWantToCgD; \"Do you want to <cg>download</c> your ac\"... ; +0xb4, 0x1000cc8b4\nmov     edx, 83h; __n                                                  ; +0xbb, 0x1000cc8bb\nmov     rdi, rax; __dst                                                ; +0xc0, 0x1000cc8c0\ncall    _memcpy                                                        ; +0xc3, 0x1000cc8c3\nmov     byte ptr [r14+83h], 0                                          ; +0xc8, 0x1000cc8c8\nlea     rsi, aLoadData; \"Load Data\"                                    ; +0xd0, 0x1000cc8d0\nlea     rcx, aCancel; \"Cancel\"                                         ; +0xd7, 0x1000cc8d7\nlea     r8, aLoad; \"Load\"                                              ; +0xde, 0x1000cc8de\nlea     rdx, [rbp+var_50]                                              ; +0xe5, 0x1000cc8e5\nmovss   xmm0, cs:dword_1008152B4                                       ; +0xe9, 0x1000cc8e9\nmov     rdi, rbx                                                       ; +0xf1, 0x1000cc8f1\ncall    FLAlertLayer__create_1                                         ; +0xf4, 0x1000cc8f4\nmov     rbx, rax                                                       ; +0xf9, 0x1000cc8f9\ntest    byte ptr [rbp+var_50], 1                                       ; +0xfc, 0x1000cc8fc\njz      short loc_1000CC90B                                            ; +0x100, 0x1000cc900\nmov     rdi, [rbp+__p]; __p                                            ; +0x102, 0x1000cc902\ncall    __ZdlPv; operator delete(void *)                               ; +0x106, 0x1000cc906\nmov     rax, [rbx]                                                     ; +0x10b, 0x1000cc90b\nmov     rdi, rbx                                                       ; +0x10e, 0x1000cc90e\nmov     esi, 2                                                         ; +0x111, 0x1000cc911\ncall    qword ptr [rax+48h]                                            ; +0x116, 0x1000cc916\njmp     short loc_1000CC997                                            ; +0x119, 0x1000cc919\nmov     rax, rbx                                                       ; +0x11b, 0x1000cc91b\nor      rax, 7                                                         ; +0x11e, 0x1000cc91e\nlea     rcx, [rax+1]                                                   ; +0x122, 0x1000cc922\ncmp     rax, 17h                                                       ; +0x126, 0x1000cc926\nmov     r12d, 1Ah                                                      ; +0x12a, 0x1000cc92a\ncmovnz  r12, rcx                                                       ; +0x130, 0x1000cc930\nmov     rdi, r12; __sz                                                 ; +0x134, 0x1000cc934\ncall    __Znwm; operator new(ulong)                                    ; +0x137, 0x1000cc937\nmov     r15, rax                                                       ; +0x13c, 0x1000cc93c\nmov     [rbp+var_28], rax                                              ; +0x13f, 0x1000cc93f\ninc     r12                                                            ; +0x143, 0x1000cc943\nmov     [rbp+__dst], r12                                               ; +0x146, 0x1000cc946\nmov     [rbp+var_30], rbx                                              ; +0x14a, 0x1000cc94a\nmov     rdi, r15; __dst                                                ; +0x14e, 0x1000cc94e\nmov     rsi, r14; __src                                                ; +0x151, 0x1000cc951\nmov     rdx, rbx; __len                                                ; +0x154, 0x1000cc954\ncall    _memmove                                                       ; +0x157, 0x1000cc957\nmov     byte ptr [r15+rbx], 0                                          ; +0x15c, 0x1000cc95c\nlea     rsi, aTooFast_0; \"Too fast\"                                    ; +0x161, 0x1000cc961\nlea     rcx, aOk; \"OK\"                                                 ; +0x168, 0x1000cc968\nlea     rdx, [rbp+__dst]                                               ; +0x16f, 0x1000cc96f\nmovss   xmm0, cs:dword_1008152B4                                       ; +0x173, 0x1000cc973\nxor     edi, edi                                                       ; +0x17b, 0x1000cc97b\nxor     r8d, r8d                                                       ; +0x17d, 0x1000cc97d\ncall    FLAlertLayer__create_1                                         ; +0x180, 0x1000cc980\nmov     rbx, rax                                                       ; +0x185, 0x1000cc985\ntest    byte ptr [rbp+__dst], 1                                        ; +0x188, 0x1000cc988\njz      short loc_1000CC997                                            ; +0x18c, 0x1000cc98c\nmov     rdi, [rbp+var_28]; __p                                         ; +0x18e, 0x1000cc98e\ncall    __ZdlPv; operator delete(void *)                               ; +0x192, 0x1000cc992\nmov     rax, [rbx]                                                     ; +0x197, 0x1000cc997\nmov     rdi, rbx                                                       ; +0x19a, 0x1000cc99a\ncall    qword ptr [rax+508h]                                           ; +0x19d, 0x1000cc99d\nadd     rsp, 30h                                                       ; +0x1a3, 0x1000cc9a3\npop     rbx                                                            ; +0x1a7, 0x1000cc9a7\npop     r12                                                            ; +0x1a8, 0x1000cc9a8\npop     r14                                                            ; +0x1aa, 0x1000cc9aa\npop     r15                                                            ; +0x1ac, 0x1000cc9ac\npop     rbp                                                            ; +0x1ae, 0x1000cc9ae\nretn                                                                   ; +0x1af, 0x1000cc9af\ncall    sub_100006BF0                                                  ; +0x1b0, 0x1000cc9b0", "xrefs": ["AccountLayer::customSetup @ 0x1000cc02d"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}