{"type": "func", "start": 4295804112, "end": 4295804869, "name": "AccountLayer::onBackup", "pseudocode": "// \n// AccountLayer::onBackup from 0x1000cc4d0 to 0x1000cc7c5 (757 bytes)\n// \n// 1 xrefs:\n// > AccountLayer::customSetup @ 0x1000cbfdc\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::onBackup(AccountLayer *a1, cocos2d::CCObject *a2)\n{\n  __int64 v2; // xmm0_8\n  GameStatsManager *v3; // rax\n  cocos2d::CCString *v4; // rax\n  const char *CString; // r14\n  size_t v6; // rax\n  size_t v7; // rbx\n  char *v8; // r15\n  GameLevelManager *v9; // rax\n  cocos2d::CCString *v10; // rax\n  const char *v11; // r14\n  size_t v12; // rax\n  size_t v13; // rbx\n  char *v14; // r15\n  ButtonSprite **v15; // rbx\n  size_t v16; // r12\n  void *v17; // rdi\n  size_t v18; // r12\n  char v19; // [rsp+0h] [rbp-70h]\n  _QWORD v20[2]; // [rsp+8h] [rbp-68h] BYREF\n  void *__p; // [rsp+18h] [rbp-58h]\n  _QWORD __dst[2]; // [rsp+20h] [rbp-50h] BYREF\n  char *v23; // [rsp+30h] [rbp-40h]\n  _QWORD v24[2]; // [rsp+38h] [rbp-38h] BYREF\n  void *v25; // [rsp+48h] [rbp-28h]\n\n  v3 = GameStatsManager::sharedState();\n  if ( GameStatsManager::getStat(v3, \"6\") <= 9 )\n  {\n    v4 = (cocos2d::CCString *)sub_1007AB580(\n                                \"You need to <cl>collect</c> atleast <cy>%i stars</c> to enable <cg>saving</c>.\",\n                                v19);\n    CString = cocos2d::CCString::getCString(v4);\n    v6 = strlen(CString);\n    if ( v6 < 0xFFFFFFFFFFFFFFF8LL )\n    {\n      v7 = v6;\n      if ( v6 >= 0x17 )\n      {\n        v16 = 26;\n        if ( (v6 | 7) != 0x17 )\n          v16 = (v6 | 7) + 1;\n        v8 = (char *)operator new(v16);\n        v23 = v8;\n        __dst[0] = v16 + 1;\n        __dst[1] = v7;\n      }\n      else\n      {\n        LOBYTE(__dst[0]) = 2 * v6;\n        v8 = (char *)__dst + 1;\n        if ( !v6 )\n        {\nLABEL_18:\n          v8[v7] = 0;\n          v15 = (ButtonSprite **)FLAlertLayer::create_1(0, \"Collect more\", __dst, \"OK\", 0, 300.0);\n          if ( (__dst[0] & 1) != 0 )\n          {\n            v17 = v23;\nLABEL_26:\n            operator delete(v17);\n            goto LABEL_27;\n          }\n          goto LABEL_27;\n        }\n      }\n      memmove(v8, CString, v7);\n      goto LABEL_18;\n    }\nLABEL_28:\n    sub_100006BF0(*(double *)&v2);\n  }\n  v9 = GameLevelManager::sharedState();\n  v2 = 1106247680;\n  if ( (unsigned int)(GameLevelManager::getTimeLeft(v9, \"bak_account\", 30.0) - 1) > 0x1D )\n  {\n    __p = operator new(0x78u);\n    v20[0] = 121;\n    v20[1] = 118;\n    strcpy(\n      (char *)__p,\n      \"Do you want to <cg>save</c> your account data on the <cl>cloud</c>?\\n\"\n      \"<cy>This will overwrite previously saved data.</c>\");\n    v15 = (ButtonSprite **)FLAlertLayer::create_1(&a1->FLAlertLayerProtocol, \"Save Data\", v20, \"Cancel\", \"Save\", 300.0);\n    if ( (v20[0] & 1) != 0 )\n      operator delete(__p);\n    ButtonSprite::updateBGImage(v15[74], \"GJ_button_06.png\");\n    (*(void (__fastcall **)(ButtonSprite **, __int64))&(*v15)->m_fVertexZ)(v15, 1);\n    goto LABEL_27;\n  }\n  v10 = (cocos2d::CCString *)sub_1007AB580(\n                               \"Please wait %i seconds before attempting to back up your account again.\",\n                               v19);\n  v11 = cocos2d::CCString::getCString(v10);\n  v12 = strlen(v11);\n  if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )\n    goto LABEL_28;\n  v13 = v12;\n  if ( v12 >= 0x17 )\n  {\n    v18 = 26;\n    if ( (v12 | 7) != 0x17 )\n      v18 = (v12 | 7) + 1;\n    v14 = (char *)operator new(v18);\n    v25 = v14;\n    v24[0] = v18 + 1;\n    v24[1] = v13;\n    goto LABEL_23;\n  }\n  LOBYTE(v24[0]) = 2 * v12;\n  v14 = (char *)v24 + 1;\n  if ( v12 )\nLABEL_23:\n    memmove(v14, v11, v13);\n  v14[v13] = 0;\n  v15 = (ButtonSprite **)FLAlertLayer::create_1(0, \"Too Fast\", v24, \"OK\", 0, 300.0);\n  if ( (v24[0] & 1) != 0 )\n  {\n    v17 = v25;\n    goto LABEL_26;\n  }\nLABEL_27:\n  (*(void (__fastcall **)(ButtonSprite **))&(*v15)[1].m_fTextureTop)(v15);\n}", "assembly": "; \n; AccountLayer::onBackup from 0x1000cc4d0 to 0x1000cc7c5 (757 bytes)\n; \n; 1 xrefs:\n; > AccountLayer::customSetup @ 0x1000cbfdc\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, 0x1000cc4d0\nmov     rbp, rsp                                                       ; +0x1, 0x1000cc4d1\npush    r15                                                            ; +0x4, 0x1000cc4d4\npush    r14                                                            ; +0x6, 0x1000cc4d6\npush    r12                                                            ; +0x8, 0x1000cc4d8\npush    rbx                                                            ; +0xa, 0x1000cc4da\nsub     rsp, 50h                                                       ; +0xb, 0x1000cc4db\nmov     rbx, rdi                                                       ; +0xf, 0x1000cc4df\ncall    GameStatsManager__sharedState                                  ; +0x12, 0x1000cc4e2\nlea     rsi, a6; \"6\"                                                   ; +0x17, 0x1000cc4e7\nmov     rdi, rax                                                       ; +0x1e, 0x1000cc4ee\ncall    GameStatsManager__getStat                                      ; +0x21, 0x1000cc4f1\ncmp     eax, 9                                                         ; +0x26, 0x1000cc4f6\njg      short loc_1000CC550                                            ; +0x29, 0x1000cc4f9\nlea     rdi, aYouNeedToClCol; \"You need to <cl>collect</c> atleast <cy\"... ; +0x2b, 0x1000cc4fb\nmov     esi, 0Ah                                                       ; +0x32, 0x1000cc502\nxor     eax, eax                                                       ; +0x37, 0x1000cc507\ncall    sub_1007AB580                                                  ; +0x39, 0x1000cc509\nmov     rdi, rax                                                       ; +0x3e, 0x1000cc50e\ncall    cocos2d__CCString__getCString                                  ; +0x41, 0x1000cc511\nmov     r14, rax                                                       ; +0x46, 0x1000cc516\nmov     rdi, rax; __s                                                  ; +0x49, 0x1000cc519\ncall    _strlen                                                        ; +0x4c, 0x1000cc51c\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x51, 0x1000cc521\njnb     loc_1000CC7C0                                                  ; +0x55, 0x1000cc525\nmov     rbx, rax                                                       ; +0x5b, 0x1000cc52b\ncmp     rax, 17h                                                       ; +0x5e, 0x1000cc52e\njnb     loc_1000CC6AE                                                  ; +0x62, 0x1000cc532\nlea     eax, [rbx+rbx]                                                 ; +0x68, 0x1000cc538\nmov     byte ptr [rbp+__dst], al                                       ; +0x6b, 0x1000cc53b\nlea     r15, [rbp+__dst+1]                                             ; +0x6e, 0x1000cc53e\ntest    rbx, rbx                                                       ; +0x72, 0x1000cc542\njnz     loc_1000CC6E1                                                  ; +0x75, 0x1000cc545\njmp     loc_1000CC6EF                                                  ; +0x7b, 0x1000cc54b\ncall    GameLevelManager__sharedState                                  ; +0x80, 0x1000cc550\nlea     rsi, aBakAccount; \"bak_account\"                                ; +0x85, 0x1000cc555\nmovss   xmm0, cs:dword_100814FD0                                       ; +0x8c, 0x1000cc55c\nmov     rdi, rax                                                       ; +0x94, 0x1000cc564\ncall    GameLevelManager__getTimeLeft                                  ; +0x97, 0x1000cc567\nlea     ecx, [rax-1]                                                   ; +0x9c, 0x1000cc56c\ncmp     ecx, 1Dh                                                       ; +0x9f, 0x1000cc56f\nja      short loc_1000CC5C6                                            ; +0xa2, 0x1000cc572\nlea     rdi, aPleaseWaitISec; \"Please wait %i seconds before attemptin\"... ; +0xa4, 0x1000cc574\nmov     esi, eax                                                       ; +0xab, 0x1000cc57b\nxor     eax, eax                                                       ; +0xad, 0x1000cc57d\ncall    sub_1007AB580                                                  ; +0xaf, 0x1000cc57f\nmov     rdi, rax                                                       ; +0xb4, 0x1000cc584\ncall    cocos2d__CCString__getCString                                  ; +0xb7, 0x1000cc587\nmov     r14, rax                                                       ; +0xbc, 0x1000cc58c\nmov     rdi, rax; __s                                                  ; +0xbf, 0x1000cc58f\ncall    _strlen                                                        ; +0xc2, 0x1000cc592\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xc7, 0x1000cc597\njnb     loc_1000CC7C0                                                  ; +0xcb, 0x1000cc59b\nmov     rbx, rax                                                       ; +0xd1, 0x1000cc5a1\ncmp     rax, 17h                                                       ; +0xd4, 0x1000cc5a4\njnb     loc_1000CC72B                                                  ; +0xd8, 0x1000cc5a8\nlea     eax, [rbx+rbx]                                                 ; +0xde, 0x1000cc5ae\nmov     byte ptr [rbp+var_38], al                                      ; +0xe1, 0x1000cc5b1\nlea     r15, [rbp+var_38+1]                                            ; +0xe4, 0x1000cc5b4\ntest    rbx, rbx                                                       ; +0xe8, 0x1000cc5b8\njnz     loc_1000CC75E                                                  ; +0xeb, 0x1000cc5bb\njmp     loc_1000CC76C                                                  ; +0xf1, 0x1000cc5c1\nadd     rbx, 278h                                                      ; +0xf6, 0x1000cc5c6\nmov     edi, 78h ; 'x'; __sz                                           ; +0xfd, 0x1000cc5cd\ncall    __Znwm; operator new(ulong)                                    ; +0x102, 0x1000cc5d2\nlea     r14, [rbp+__p]                                                 ; +0x107, 0x1000cc5d7\nmov     [rbp+__p], rax                                                 ; +0x10b, 0x1000cc5db\nmov     [rbp+var_68], 79h ; 'y'                                        ; +0x10f, 0x1000cc5df\nmov     [rbp+var_60], 76h ; 'v'                                        ; +0x117, 0x1000cc5e7\nmov     rcx, 3E632F3C2E617461h                                         ; +0x11f, 0x1000cc5ef\nmov     [rax+6Eh], rcx                                                 ; +0x129, 0x1000cc5f9\nmovups  xmm0, xmmword ptr cs:aDoYouWantToCgS+60h; \"iously saved data.</c>\" ; +0x12d, 0x1000cc5fd\nmovups  xmmword ptr [rax+60h], xmm0                                    ; +0x134, 0x1000cc604\nmovups  xmm0, xmmword ptr cs:aDoYouWantToCgS+50h; \"l overwrite previously saved data.</c>\" ; +0x138, 0x1000cc608\nmovups  xmmword ptr [rax+50h], xmm0                                    ; +0x13f, 0x1000cc60f\nmovups  xmm0, xmmword ptr cs:aDoYouWantToCgS+40h; \"c>?\\n<cy>This will overwrite previously\"... ; +0x143, 0x1000cc613\nmovups  xmmword ptr [rax+40h], xmm0                                    ; +0x14a, 0x1000cc61a\nmovups  xmm0, xmmword ptr cs:aDoYouWantToCgS+30h; \" the <cl>cloud</c>?\\n<cy>This will over\"... ; +0x14e, 0x1000cc61e\nmovups  xmmword ptr [rax+30h], xmm0                                    ; +0x155, 0x1000cc625\nmovups  xmm0, xmmword ptr cs:aDoYouWantToCgS+20h; \" account data on the <cl>cloud</c>?\\n<c\"... ; +0x159, 0x1000cc629\nmovups  xmmword ptr [rax+20h], xmm0                                    ; +0x160, 0x1000cc630\nmovups  xmm0, xmmword ptr cs:aDoYouWantToCgS+10h; \"cg>save</c> your account data on the <c\"... ; +0x164, 0x1000cc634\nmovups  xmmword ptr [rax+10h], xmm0                                    ; +0x16b, 0x1000cc63b\nmovups  xmm0, xmmword ptr cs:aDoYouWantToCgS; \"Do you want to <cg>save</c> your accoun\"... ; +0x16f, 0x1000cc63f\nmovups  xmmword ptr [rax], xmm0                                        ; +0x176, 0x1000cc646\nmov     byte ptr [rax+76h], 0                                          ; +0x179, 0x1000cc649\nlea     rsi, aSaveData; \"Save Data\"                                    ; +0x17d, 0x1000cc64d\nlea     rcx, aCancel; \"Cancel\"                                         ; +0x184, 0x1000cc654\nlea     r8, aSave; \"Save\"                                              ; +0x18b, 0x1000cc65b\nlea     rdx, [rbp+var_68]                                              ; +0x192, 0x1000cc662\nmovss   xmm0, cs:dword_1008152B4                                       ; +0x196, 0x1000cc666\nmov     rdi, rbx                                                       ; +0x19e, 0x1000cc66e\ncall    FLAlertLayer__create_1                                         ; +0x1a1, 0x1000cc671\nmov     rbx, rax                                                       ; +0x1a6, 0x1000cc676\ntest    byte ptr [rbp+var_68], 1                                       ; +0x1a9, 0x1000cc679\njz      short loc_1000CC688                                            ; +0x1ad, 0x1000cc67d\nmov     rdi, [rbp+__p]; __p                                            ; +0x1af, 0x1000cc67f\ncall    __ZdlPv; operator delete(void *)                               ; +0x1b3, 0x1000cc683\nmov     rdi, [rbx+250h]                                                ; +0x1b8, 0x1000cc688\nlea     rsi, aGjButton06Png; \"GJ_button_06.png\"                        ; +0x1bf, 0x1000cc68f\ncall    ButtonSprite__updateBGImage                                    ; +0x1c6, 0x1000cc696\nmov     rax, [rbx]                                                     ; +0x1cb, 0x1000cc69b\nmov     rdi, rbx                                                       ; +0x1ce, 0x1000cc69e\nmov     esi, 1                                                         ; +0x1d1, 0x1000cc6a1\ncall    qword ptr [rax+48h]                                            ; +0x1d6, 0x1000cc6a6\njmp     loc_1000CC7A7                                                  ; +0x1d9, 0x1000cc6a9\nmov     rax, rbx                                                       ; +0x1de, 0x1000cc6ae\nor      rax, 7                                                         ; +0x1e1, 0x1000cc6b1\nlea     rcx, [rax+1]                                                   ; +0x1e5, 0x1000cc6b5\ncmp     rax, 17h                                                       ; +0x1e9, 0x1000cc6b9\nmov     r12d, 1Ah                                                      ; +0x1ed, 0x1000cc6bd\ncmovnz  r12, rcx                                                       ; +0x1f3, 0x1000cc6c3\nmov     rdi, r12; __sz                                                 ; +0x1f7, 0x1000cc6c7\ncall    __Znwm; operator new(ulong)                                    ; +0x1fa, 0x1000cc6ca\nmov     r15, rax                                                       ; +0x1ff, 0x1000cc6cf\nmov     [rbp+var_40], rax                                              ; +0x202, 0x1000cc6d2\ninc     r12                                                            ; +0x206, 0x1000cc6d6\nmov     [rbp+__dst], r12                                               ; +0x209, 0x1000cc6d9\nmov     [rbp+var_48], rbx                                              ; +0x20d, 0x1000cc6dd\nmov     rdi, r15; __dst                                                ; +0x211, 0x1000cc6e1\nmov     rsi, r14; __src                                                ; +0x214, 0x1000cc6e4\nmov     rdx, rbx; __len                                                ; +0x217, 0x1000cc6e7\ncall    _memmove                                                       ; +0x21a, 0x1000cc6ea\nmov     byte ptr [r15+rbx], 0                                          ; +0x21f, 0x1000cc6ef\nlea     rsi, aCollectMore; \"Collect more\"                              ; +0x224, 0x1000cc6f4\nlea     rcx, aOk; \"OK\"                                                 ; +0x22b, 0x1000cc6fb\nlea     rdx, [rbp+__dst]                                               ; +0x232, 0x1000cc702\nmovss   xmm0, cs:dword_1008152B4                                       ; +0x236, 0x1000cc706\nxor     edi, edi                                                       ; +0x23e, 0x1000cc70e\nxor     r8d, r8d                                                       ; +0x240, 0x1000cc710\ncall    FLAlertLayer__create_1                                         ; +0x243, 0x1000cc713\nmov     rbx, rax                                                       ; +0x248, 0x1000cc718\ntest    byte ptr [rbp+__dst], 1                                        ; +0x24b, 0x1000cc71b\njz      loc_1000CC7A7                                                  ; +0x24f, 0x1000cc71f\nmov     rdi, [rbp+var_40]                                              ; +0x255, 0x1000cc725\njmp     short loc_1000CC7A2                                            ; +0x259, 0x1000cc729\nmov     rax, rbx                                                       ; +0x25b, 0x1000cc72b\nor      rax, 7                                                         ; +0x25e, 0x1000cc72e\nlea     rcx, [rax+1]                                                   ; +0x262, 0x1000cc732\ncmp     rax, 17h                                                       ; +0x266, 0x1000cc736\nmov     r12d, 1Ah                                                      ; +0x26a, 0x1000cc73a\ncmovnz  r12, rcx                                                       ; +0x270, 0x1000cc740\nmov     rdi, r12; __sz                                                 ; +0x274, 0x1000cc744\ncall    __Znwm; operator new(ulong)                                    ; +0x277, 0x1000cc747\nmov     r15, rax                                                       ; +0x27c, 0x1000cc74c\nmov     [rbp+var_28], rax                                              ; +0x27f, 0x1000cc74f\ninc     r12                                                            ; +0x283, 0x1000cc753\nmov     [rbp+var_38], r12                                              ; +0x286, 0x1000cc756\nmov     [rbp+var_30], rbx                                              ; +0x28a, 0x1000cc75a\nmov     rdi, r15; __dst                                                ; +0x28e, 0x1000cc75e\nmov     rsi, r14; __src                                                ; +0x291, 0x1000cc761\nmov     rdx, rbx; __len                                                ; +0x294, 0x1000cc764\ncall    _memmove                                                       ; +0x297, 0x1000cc767\nmov     byte ptr [r15+rbx], 0                                          ; +0x29c, 0x1000cc76c\nlea     rsi, aTooFast; \"Too Fast\"                                      ; +0x2a1, 0x1000cc771\nlea     rcx, aOk; \"OK\"                                                 ; +0x2a8, 0x1000cc778\nlea     rdx, [rbp+var_38]                                              ; +0x2af, 0x1000cc77f\nmovss   xmm0, cs:dword_1008152B4                                       ; +0x2b3, 0x1000cc783\nxor     edi, edi                                                       ; +0x2bb, 0x1000cc78b\nxor     r8d, r8d                                                       ; +0x2bd, 0x1000cc78d\ncall    FLAlertLayer__create_1                                         ; +0x2c0, 0x1000cc790\nmov     rbx, rax                                                       ; +0x2c5, 0x1000cc795\ntest    byte ptr [rbp+var_38], 1                                       ; +0x2c8, 0x1000cc798\njz      short loc_1000CC7A7                                            ; +0x2cc, 0x1000cc79c\nmov     rdi, [rbp+var_28]; __p                                         ; +0x2ce, 0x1000cc79e\ncall    __ZdlPv; operator delete(void *)                               ; +0x2d2, 0x1000cc7a2\nmov     rax, [rbx]                                                     ; +0x2d7, 0x1000cc7a7\nmov     rdi, rbx                                                       ; +0x2da, 0x1000cc7aa\ncall    qword ptr [rax+508h]                                           ; +0x2dd, 0x1000cc7ad\nadd     rsp, 50h                                                       ; +0x2e3, 0x1000cc7b3\npop     rbx                                                            ; +0x2e7, 0x1000cc7b7\npop     r12                                                            ; +0x2e8, 0x1000cc7b8\npop     r14                                                            ; +0x2ea, 0x1000cc7ba\npop     r15                                                            ; +0x2ec, 0x1000cc7bc\npop     rbp                                                            ; +0x2ee, 0x1000cc7be\nretn                                                                   ; +0x2ef, 0x1000cc7bf\ncall    sub_100006BF0                                                  ; +0x2f0, 0x1000cc7c0", "xrefs": ["AccountLayer::customSetup @ 0x1000cbfdc"], "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"}