{"type": "func", "start": 4612856, "end": 4613050, "name": "AccountLayer::onSync", "pseudocode": "// \n// AccountLayer::onSync from 0x4662f8 to 0x4663ba (194 bytes)\n// \n// 0 xrefs:\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::onSync(AccountLayer *a1, cocos2d::CCObject *a2)\n{\n  GameLevelManager *v3; // r0\n  const char *TimeLeft; // r0\n  cocos2d::CCString *v5; // r0\n  char *CString; // r0\n  FLAlertLayer *v7; // r5\n  _BYTE v8[4]; // [sp+10h] [bp+4h] BYREF\n\n  v3 = GameLevelManager::sharedState();\n  TimeLeft = (const char *)GameLevelManager::getTimeLeft(v3, \"sync_account\", 30.0);\n  if ( (unsigned int)(TimeLeft - 1) > 0x1D )\n  {\n    sub_776584(\n      (int)v8,\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    v7 = FLAlertLayer::create(\n           (int)&a1->FLAlertLayerProtocol,\n           (int)\"Load Data\",\n           (int)v8,\n           (int)\"Cancel\",\n           (int)\"Load\",\n           300.0);\n    sub_774008(v8);\n    v7->setTag(v7, 2);\n  }\n  else\n  {\n    v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(\n                                (cocos2d::CCString *)\"Please wait %i seconds before attempting to sync your account again.\",\n                                TimeLeft);\n    CString = (char *)cocos2d::CCString::getCString(v5);\n    sub_776584((int)v8, CString);\n    v7 = FLAlertLayer::create(0, (int)\"Too fast\", (int)v8, (int)\"OK\", 0, 300.0);\n    sub_774008(v8);\n  }\n  v7->show(v7);\n}", "assembly": "; \n; AccountLayer::onSync from 0x4662f8 to 0x4663ba (194 bytes)\n; \n; 0 xrefs:\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.W          {R4-R8,LR}                                             ; +0x0, 0x4662f8\nSUB             SP, SP, #0x18                                          ; +0x4, 0x4662fc\nLDR             R6, =(__stack_chk_guard_ptr - 0x46630A)                ; +0x6, 0x4662fe\nMOV             R8, R0                                                 ; +0x8, 0x466300\nADD             R4, SP, #0x18+var_8                                    ; +0xa, 0x466302\nADD             R7, SP, #0xC                                           ; +0xc, 0x466304\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0xe, 0x466306\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x10, 0x466308\nLDR             R5, =0x43960000                                        ; +0x12, 0x46630a\nLDR             R3, [R6]                                               ; +0x14, 0x46630c\nSTR             R3, [SP,#0x18+var_4]                                   ; +0x16, 0x46630e\nBL              _ZN16GameLevelManager11sharedStateEv; GameLevelManager::sharedState(void) ; +0x18, 0x466310\nLDR             R1, =(aSyncAccount - 0x46631C); \"sync_account\"         ; +0x1c, 0x466314\nLDR             R2, flt_4663C0; float                                  ; +0x1e, 0x466316\nADD             R1, PC; \"sync_account\"                                 ; +0x20, 0x466318\nBL              _ZN16GameLevelManager11getTimeLeftEPKcf; GameLevelManager::getTimeLeft(char const*,float) ; +0x22, 0x46631a\nSUBS            R3, R0, #1                                             ; +0x26, 0x46631e\nMOV             R1, R0; char *                                         ; +0x28, 0x466320\nCMP             R3, #0x1D                                              ; +0x2a, 0x466322\nBHI             loc_46635A                                             ; +0x2c, 0x466324\nLDR             R0, =(aPleaseWaitISec_0 - 0x46632C); \"Please wait %i seconds before attemptin\"... ; +0x2e, 0x466326\nADD             R0, PC; \"Please wait %i seconds before attemptin\"...   ; +0x30, 0x466328\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x32, 0x46632a\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x36, 0x46632e\nMOV             R2, R7                                                 ; +0x3a, 0x466332\nMOV             R1, R0; char *                                         ; +0x3c, 0x466334\nMOV             R0, R4; int                                            ; +0x3e, 0x466336\nBL              sub_776584                                             ; +0x40, 0x466338\nLDR             R1, =(aTooFast - 0x466348); \"Too fast\"                 ; +0x44, 0x46633c\nLDR             R3, =(aOk - 0x46634E); \"OK\"                            ; +0x46, 0x46633e\nMOVS            R0, #0; int                                            ; +0x48, 0x466340\nSTR             R5, [SP,#0x18+var_14]; float                           ; +0x4a, 0x466342\nADD             R1, PC; \"Too fast\"                                     ; +0x4c, 0x466344\nSTR             R0, [SP,#0x18+var_18]; int                             ; +0x4e, 0x466346\nMOV             R2, R4; int                                            ; +0x50, 0x466348\nADD             R3, PC; \"OK\"                                           ; +0x52, 0x46634a\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcSsS3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0x54, 0x46634c\nMOV             R5, R0                                                 ; +0x58, 0x466350\nMOV             R0, R4                                                 ; +0x5a, 0x466352\nBL              sub_774008                                             ; +0x5c, 0x466354\nB               loc_466392                                             ; +0x60, 0x466358\nLDR             R1, =(aDoYouWantToCgD - 0x466364); \"Do you want to <cg>download</c> your ac\"... ; +0x62, 0x46635a\nMOV             R2, R7                                                 ; +0x64, 0x46635c\nMOV             R0, R4; int                                            ; +0x66, 0x46635e\nADD             R1, PC; \"Do you want to <cg>download</c> your ac\"...   ; +0x68, 0x466360\nBL              sub_776584                                             ; +0x6a, 0x466362\nLDR             R3, =(aLoad - 0x466372); \"Load\"                        ; +0x6e, 0x466366\nLDR             R1, =(aLoadData - 0x466378); \"Load Data\"               ; +0x70, 0x466368\nADD.W           R0, R8, #0x1EC; int                                    ; +0x72, 0x46636a\nADD             R3, PC; \"Load\"                                         ; +0x76, 0x46636e\nSTR             R3, [SP,#0x18+var_18]; int                             ; +0x78, 0x466370\nLDR             R3, =(aCancel - 0x46637E); \"Cancel\"                    ; +0x7a, 0x466372\nADD             R1, PC; \"Load Data\"                                    ; +0x7c, 0x466374\nSTR             R5, [SP,#0x18+var_14]; float                           ; +0x7e, 0x466376\nMOV             R2, R4; int                                            ; +0x80, 0x466378\nADD             R3, PC; \"Cancel\"                                       ; +0x82, 0x46637a\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcSsS3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0x84, 0x46637c\nMOV             R5, R0                                                 ; +0x88, 0x466380\nMOV             R0, R4                                                 ; +0x8a, 0x466382\nBL              sub_774008                                             ; +0x8c, 0x466384\nLDR             R3, [R5]                                               ; +0x90, 0x466388\nMOV             R0, R5                                                 ; +0x92, 0x46638a\nMOVS            R1, #2                                                 ; +0x94, 0x46638c\nLDR             R3, [R3,#0x24]                                         ; +0x96, 0x46638e\nBLX             R3                                                     ; +0x98, 0x466390\nLDR             R3, [R5]                                               ; +0x9a, 0x466392\nMOV             R0, R5                                                 ; +0x9c, 0x466394\nLDR.W           R3, [R3,#0x284]                                        ; +0x9e, 0x466396\nBLX             R3                                                     ; +0xa2, 0x46639a\nLDR             R2, [SP,#0x18+var_4]                                   ; +0xa4, 0x46639c\nLDR             R3, [R6]                                               ; +0xa6, 0x46639e\nCMP             R2, R3                                                 ; +0xa8, 0x4663a0\nBEQ             loc_4663B4                                             ; +0xaa, 0x4663a2\nBLX             __stack_chk_fail                                       ; +0xac, 0x4663a4\nB               loc_4663AA                                             ; +0xb0, 0x4663a8\nMOV             R0, R4                                                 ; +0xb2, 0x4663aa\nBL              sub_774008                                             ; +0xb4, 0x4663ac\nBL              __cxa_end_cleanup                                      ; +0xb8, 0x4663b0\nADD             SP, SP, #0x18                                          ; +0xbc, 0x4663b4\nPOP.W           {R4-R8,PC}                                             ; +0xbe, 0x4663b6", "xrefs": [], "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"}