{"type": "func", "start": 8694384, "end": 8695096, "name": "AccountLayer::onBackup", "pseudocode": "// \n// AccountLayer::onBackup from 0x84aa70 to 0x84ad38 (712 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x3b7a8\n// > AccountLayer::customSetup @ 0x84b97c\n// > <???> @ 0x1229df0\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 AccountLayer::onBackup(AccountLayer *a1, cocos2d::CCObject *a2)\n{\n  int v2; // w20\n  GameStatsManager *v3; // x0\n  cocos2d::CCString *v4; // x0\n  char *CString; // x0\n  FLAlertLayer *v6; // x0\n  __int64 v7; // x2\n  FLAlertLayer *v8; // x20\n  void *v9; // x0\n  GameLevelManager *v10; // x0\n  unsigned int TimeLeft; // w0\n  void *v12; // x0\n  cocos2d::CCString *v13; // x0\n  char *v14; // x0\n  FLAlertLayer *v15; // x0\n  unsigned int *v16; // x2\n  int v17; // w1\n  unsigned int *v18; // x2\n  unsigned int *v19; // x2\n  int v20; // w1\n  __int64 v21; // [xsp+40h] [xbp+40h] BYREF\n\n  v2 = (int)a1;\n  v3 = GameStatsManager::sharedState();\n  if ( GameStatsManager::getStat(v3, \"6\") <= 9 )\n  {\n    v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(\n                                (cocos2d::CCString *)\"You need to <cl>collect</c> atleast <cy>%i stars</c> to enable <cg>saving</c>.\",\n                                &byte_9[1]);\n    CString = (char *)cocos2d::CCString::getCString(v4);\n    sub_D153B8((int)&v21, CString);\n    v6 = FLAlertLayer::create(0, (__int64)\"Collect more\", (__int64)&v21);\n    v7 = v21;\n    v8 = v6;\n    v9 = (void *)(v21 - 24);\n    if ( (__int64 *)(v21 - 24) == &qword_124B6B0 )\n      goto LABEL_3;\n    if ( &pthread_create )\n    {\n      v18 = (unsigned int *)(v21 - 8);\n      do\n        v17 = __ldaxr(v18);\n      while ( __stlxr(v17 - 1, v18) );\n      goto LABEL_15;\n    }\n    goto LABEL_17;\n  }\n  v10 = GameLevelManager::sharedState();\n  TimeLeft = GameLevelManager::getTimeLeft(v10, \"bak_account\", 30.0);\n  if ( TimeLeft - 1 <= 0x1D )\n  {\n    v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(\n                                 (cocos2d::CCString *)\"Please wait %i seconds before attempting to back up your account again.\",\n                                 (const char *)TimeLeft);\n    v14 = (char *)cocos2d::CCString::getCString(v13);\n    sub_D153B8((int)&v21, v14);\n    v15 = FLAlertLayer::create(0, (__int64)\"Too Fast\", (__int64)&v21);\n    v7 = v21;\n    v8 = v15;\n    v9 = (void *)(v21 - 24);\n    if ( (__int64 *)(v21 - 24) == &qword_124B6B0 )\n      goto LABEL_3;\n    if ( &pthread_create )\n    {\n      v16 = (unsigned int *)(v21 - 8);\n      do\n        v17 = __ldaxr(v16);\n      while ( __stlxr(v17 - 1, v16) );\nLABEL_15:\n      if ( v17 <= 0 )\n        operator delete(v9);\n      goto LABEL_3;\n    }\nLABEL_17:\n    v17 = *(_DWORD *)(v7 - 8);\n    *(_DWORD *)(v7 - 8) = v17 - 1;\n    goto LABEL_15;\n  }\n  sub_D153B8(\n    (int)&v21,\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  v8 = FLAlertLayer::create(v2 + 632, (__int64)\"Save Data\", (__int64)&v21);\n  v12 = (void *)(v21 - 24);\n  if ( (__int64 *)(v21 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v19 = (unsigned int *)(v21 - 8);\n      do\n        v20 = __ldaxr(v19);\n      while ( __stlxr(v20 - 1, v19) );\n    }\n    else\n    {\n      v20 = *(_DWORD *)(v21 - 8);\n      *(_DWORD *)(v21 - 8) = v20 - 1;\n    }\n    if ( v20 <= 0 )\n      operator delete(v12);\n  }\n  ButtonSprite::updateBGImage(v8->m_button1, \"GJ_button_06.png\");\n  v8->setTag(v8, 1);\nLABEL_3:\n  v8->show(v8);\n}", "assembly": "; \n; AccountLayer::onBackup from 0x84aa70 to 0x84ad38 (712 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x3b7a8\n; > AccountLayer::customSetup @ 0x84b97c\n; > <???> @ 0x1229df0\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\nSTP             X29, X30, [SP,#var_50]!                                ; +0x0, 0x84aa70\nMOV             X29, SP                                                ; +0x4, 0x84aa74\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x84aa78\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x84aa7c\nMOV             X20, X0                                                ; +0x10, 0x84aa80\nSTR             X21, [SP,#0x50+var_30]                                 ; +0x14, 0x84aa84\nLDR             X0, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x18, 0x84aa88\nLDR             X0, [X0]; this                                         ; +0x1c, 0x84aa8c\nSTR             X0, [X29,#0x50+var_8]                                  ; +0x20, 0x84aa90\nBL              _ZN16GameStatsManager11sharedStateEv; GameStatsManager::sharedState(void) ; +0x24, 0x84aa94\nADRL            X1, (aReachPathOfLav_4+0x18); char *                   ; +0x28, 0x84aa98\nBL              _ZN16GameStatsManager7getStatEPKc; GameStatsManager::getStat(char const*) ; +0x30, 0x84aaa0\nCMP             W0, #9                                                 ; +0x34, 0x84aaa4\nB.GT            loc_84AB48                                             ; +0x38, 0x84aaa8\nADRP            X0, #aYouNeedToClCol@PAGE; \"You need to <cl>collect</c> atleast <cy\"... ; +0x3c, 0x84aaac\nMOV             W1, #(byte_9+1); char *                                ; +0x40, 0x84aab0\nADD             X0, X0, #aYouNeedToClCol@PAGEOFF; \"You need to <cl>collect</c> atleast <cy\"... ; +0x44, 0x84aab4\nADD             X20, X29, #0x50+var_10                                 ; +0x48, 0x84aab8\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x4c, 0x84aabc\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x50, 0x84aac0\nMOV             X1, X0; char *                                         ; +0x54, 0x84aac4\nADD             X2, X29, #0x50+var_20                                  ; +0x58, 0x84aac8\nMOV             X0, X20; int                                           ; +0x5c, 0x84aacc\nBL              sub_D153B8                                             ; +0x60, 0x84aad0\nLDR             S0, =0x43960000                                        ; +0x64, 0x84aad4\nADRP            X1, #aCollectMore@PAGE; \"Collect more\"                 ; +0x68, 0x84aad8\nADRP            X3, #aOk@PAGE; \"OK\"                                    ; +0x6c, 0x84aadc\nMOV             X0, #0                                                 ; +0x70, 0x84aae0\nADD             X1, X1, #aCollectMore@PAGEOFF; \"Collect more\"          ; +0x74, 0x84aae4\nMOV             X2, X20                                                ; +0x78, 0x84aae8\nADD             X3, X3, #aOk@PAGEOFF; \"OK\"                             ; +0x7c, 0x84aaec\nMOV             X4, #0                                                 ; +0x80, 0x84aaf0\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcSsS3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0x84, 0x84aaf4\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x88, 0x84aaf8\nLDR             X2, [X29,#0x50+var_10]                                 ; +0x8c, 0x84aafc\nMOV             X20, X0                                                ; +0x90, 0x84ab00\nSUB             X0, X2, #0x18; p                                       ; +0x94, 0x84ab04\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x98, 0x84ab08\nCMP             X0, X1                                                 ; +0x9c, 0x84ab0c\nB.NE            loc_84AC78                                             ; +0xa0, 0x84ab10\nLDR             X1, [X20]                                              ; +0xa4, 0x84ab14\nMOV             X0, X20                                                ; +0xa8, 0x84ab18\nLDR             X1, [X1,#0x508]                                        ; +0xac, 0x84ab1c\nBLR             X1                                                     ; +0xb0, 0x84ab20\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xb4, 0x84ab24\nLDR             X1, [X29,#0x50+var_8]                                  ; +0xb8, 0x84ab28\nLDR             X0, [X19]                                              ; +0xbc, 0x84ab2c\nCMP             X1, X0                                                 ; +0xc0, 0x84ab30\nB.NE            loc_84AD00                                             ; +0xc4, 0x84ab34\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0xc8, 0x84ab38\nLDR             X21, [SP,#0x50+var_30]                                 ; +0xcc, 0x84ab3c\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0xd0, 0x84ab40\nRET                                                                    ; +0xd4, 0x84ab44\nBL              _ZN16GameLevelManager11sharedStateEv; GameLevelManager::sharedState(void) ; +0xd8, 0x84ab48\nADRL            X1, aBakAccount; \"bak_account\"                         ; +0xdc, 0x84ab4c\nFMOV            S0, #30.0; float                                       ; +0xe4, 0x84ab54\nBL              _ZN16GameLevelManager11getTimeLeftEPKcf; GameLevelManager::getTimeLeft(char const*,float) ; +0xe8, 0x84ab58\nSUB             W1, W0, #1                                             ; +0xec, 0x84ab5c\nCMP             W1, #0x1D                                              ; +0xf0, 0x84ab60\nB.LS            loc_84ABEC                                             ; +0xf4, 0x84ab64\nADD             X21, X29, #0x50+var_10                                 ; +0xf8, 0x84ab68\nADRP            X1, #aDoYouWantToCgS@PAGE; \"Do you want to <cg>save</c> your accoun\"... ; +0xfc, 0x84ab6c\nMOV             X0, X21; int                                           ; +0x100, 0x84ab70\nADD             X1, X1, #aDoYouWantToCgS@PAGEOFF; \"Do you want to <cg>save</c> your accoun\"... ; +0x104, 0x84ab74\nADD             X2, X29, #0x50+var_20                                  ; +0x108, 0x84ab78\nBL              sub_D153B8                                             ; +0x10c, 0x84ab7c\nLDR             S0, =0x43960000                                        ; +0x110, 0x84ab80\nADRP            X1, #aSaveData@PAGE; \"Save Data\"                       ; +0x114, 0x84ab84\nADRP            X3, #aCancel@PAGE; \"Cancel\"                            ; +0x118, 0x84ab88\nADRP            X4, #aSave@PAGE; \"Save\"                                ; +0x11c, 0x84ab8c\nADD             X0, X20, #0x278                                        ; +0x120, 0x84ab90\nADD             X1, X1, #aSaveData@PAGEOFF; \"Save Data\"                ; +0x124, 0x84ab94\nMOV             X2, X21                                                ; +0x128, 0x84ab98\nADD             X3, X3, #aCancel@PAGEOFF; \"Cancel\"                     ; +0x12c, 0x84ab9c\nADD             X4, X4, #aSave@PAGEOFF; \"Save\"                         ; +0x130, 0x84aba0\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcSsS3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0x134, 0x84aba4\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x138, 0x84aba8\nLDR             X2, [X29,#0x50+var_10]                                 ; +0x13c, 0x84abac\nMOV             X20, X0                                                ; +0x140, 0x84abb0\nSUB             X0, X2, #0x18; p                                       ; +0x144, 0x84abb4\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x148, 0x84abb8\nCMP             X0, X1                                                 ; +0x14c, 0x84abbc\nB.NE            loc_84ACBC                                             ; +0x150, 0x84abc0\nLDR             X0, [X20,#0x250]; this                                 ; +0x154, 0x84abc4\nADRL            X1, aGjButton06Png; \"GJ_button_06.png\"                 ; +0x158, 0x84abc8\nBL              _ZN12ButtonSprite13updateBGImageEPKc; ButtonSprite::updateBGImage(char const*) ; +0x160, 0x84abd0\nLDR             X2, [X20]                                              ; +0x164, 0x84abd4\nMOV             X0, X20                                                ; +0x168, 0x84abd8\nMOV             W1, #1                                                 ; +0x16c, 0x84abdc\nLDR             X2, [X2,#0x48]                                         ; +0x170, 0x84abe0\nBLR             X2                                                     ; +0x174, 0x84abe4\nB               loc_84AB14                                             ; +0x178, 0x84abe8\nMOV             W1, W0; char *                                         ; +0x17c, 0x84abec\nADRL            X0, aPleaseWaitISec_1; \"Please wait %i seconds before attemptin\"... ; +0x180, 0x84abf0\nADD             X20, X29, #0x50+var_10                                 ; +0x188, 0x84abf8\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x18c, 0x84abfc\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x190, 0x84ac00\nMOV             X1, X0; char *                                         ; +0x194, 0x84ac04\nADD             X2, X29, #0x50+var_20                                  ; +0x198, 0x84ac08\nMOV             X0, X20; int                                           ; +0x19c, 0x84ac0c\nBL              sub_D153B8                                             ; +0x1a0, 0x84ac10\nLDR             S0, =0x43960000                                        ; +0x1a4, 0x84ac14\nADRP            X1, #aTooFast_0@PAGE; \"Too Fast\"                       ; +0x1a8, 0x84ac18\nADRP            X3, #aOk@PAGE; \"OK\"                                    ; +0x1ac, 0x84ac1c\nMOV             X0, #0                                                 ; +0x1b0, 0x84ac20\nADD             X1, X1, #aTooFast_0@PAGEOFF; \"Too Fast\"                ; +0x1b4, 0x84ac24\nMOV             X2, X20                                                ; +0x1b8, 0x84ac28\nADD             X3, X3, #aOk@PAGEOFF; \"OK\"                             ; +0x1bc, 0x84ac2c\nMOV             X4, #0                                                 ; +0x1c0, 0x84ac30\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcSsS3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0x1c4, 0x84ac34\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x1c8, 0x84ac38\nLDR             X2, [X29,#0x50+var_10]                                 ; +0x1cc, 0x84ac3c\nMOV             X20, X0                                                ; +0x1d0, 0x84ac40\nSUB             X0, X2, #0x18                                          ; +0x1d4, 0x84ac44\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x1d8, 0x84ac48\nCMP             X0, X1                                                 ; +0x1dc, 0x84ac4c\nB.EQ            loc_84AB14                                             ; +0x1e0, 0x84ac50\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x1e4, 0x84ac54\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x1e8, 0x84ac58\nCBZ             X1, loc_84ACAC                                         ; +0x1ec, 0x84ac5c\nSUB             X2, X2, #8                                             ; +0x1f0, 0x84ac60\nLDAXR           W1, [X2]                                               ; +0x1f4, 0x84ac64\nSUB             W3, W1, #1                                             ; +0x1f8, 0x84ac68\nSTLXR           W4, W3, [X2]                                           ; +0x1fc, 0x84ac6c\nCBZ             W4, loc_84AC98                                         ; +0x200, 0x84ac70\nB               loc_84AC64                                             ; +0x204, 0x84ac74\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x208, 0x84ac78\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x20c, 0x84ac7c\nCBZ             X1, loc_84ACAC                                         ; +0x210, 0x84ac80\nSUB             X2, X2, #8                                             ; +0x214, 0x84ac84\nLDAXR           W1, [X2]                                               ; +0x218, 0x84ac88\nSUB             W3, W1, #1                                             ; +0x21c, 0x84ac8c\nSTLXR           W4, W3, [X2]                                           ; +0x220, 0x84ac90\nCBNZ            W4, loc_84AC88                                         ; +0x224, 0x84ac94\nCMP             W1, WZR                                                ; +0x228, 0x84ac98\nB.GT            loc_84AB14                                             ; +0x22c, 0x84ac9c\nADD             X1, X29, #0x50+var_18                                  ; +0x230, 0x84aca0\nBL              j__ZdlPv; operator delete(void *)                      ; +0x234, 0x84aca4\nB               loc_84AB14                                             ; +0x238, 0x84aca8\nLDUR            W1, [X2,#-8]                                           ; +0x23c, 0x84acac\nSUB             W3, W1, #1                                             ; +0x240, 0x84acb0\nSTUR            W3, [X2,#-8]                                           ; +0x244, 0x84acb4\nB               loc_84AC98                                             ; +0x248, 0x84acb8\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x24c, 0x84acbc\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x250, 0x84acc0\nCBZ             X1, loc_84ACF0                                         ; +0x254, 0x84acc4\nSUB             X2, X2, #8                                             ; +0x258, 0x84acc8\nLDAXR           W1, [X2]                                               ; +0x25c, 0x84accc\nSUB             W3, W1, #1                                             ; +0x260, 0x84acd0\nSTLXR           W4, W3, [X2]                                           ; +0x264, 0x84acd4\nCBNZ            W4, loc_84ACCC                                         ; +0x268, 0x84acd8\nCMP             W1, WZR                                                ; +0x26c, 0x84acdc\nB.GT            loc_84ABC4                                             ; +0x270, 0x84ace0\nADD             X1, X29, #0x50+var_18                                  ; +0x274, 0x84ace4\nBL              j__ZdlPv; operator delete(void *)                      ; +0x278, 0x84ace8\nB               loc_84ABC4                                             ; +0x27c, 0x84acec\nLDUR            W1, [X2,#-8]                                           ; +0x280, 0x84acf0\nSUB             W3, W1, #1                                             ; +0x284, 0x84acf4\nSTUR            W3, [X2,#-8]                                           ; +0x288, 0x84acf8\nB               loc_84ACDC                                             ; +0x28c, 0x84acfc\nBL              .__stack_chk_fail                                      ; +0x290, 0x84ad00\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x294, 0x84ad04\nMOV             X19, X0                                                ; +0x298, 0x84ad08\nLDR             X0, [X29,#0x50+var_10]                                 ; +0x29c, 0x84ad0c\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x2a0, 0x84ad10\nSUB             X0, X0, #0x18                                          ; +0x2a4, 0x84ad14\nCMP             X0, X1                                                 ; +0x2a8, 0x84ad18\nB.EQ            loc_84AD28                                             ; +0x2ac, 0x84ad1c\nADD             X1, X29, #0x50+var_18                                  ; +0x2b0, 0x84ad20\nBL              sub_4DC260                                             ; +0x2b4, 0x84ad24\nMOV             X0, X19                                                ; +0x2b8, 0x84ad28\nBL              _Unwind_Resume                                         ; +0x2bc, 0x84ad2c\nB               loc_84AD04                                             ; +0x2c0, 0x84ad30\nB               loc_84AD04                                             ; +0x2c4, 0x84ad34", "xrefs": ["<???> @ 0x3b7a8", "AccountLayer::customSetup @ 0x84b97c", "<???> @ 0x1229df0"], "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"}