{"type": "func", "start": 5783888, "end": 5784102, "name": "AccountLayer::onSync", "pseudocode": "// \n// AccountLayer::onSync from 0x584150 to 0x584226 (214 bytes)\n// \n// 0 xrefs:\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:52:56 +0000\n// \n\nint __fastcall AccountLayer::onSync(AccountLayer *this, cocos2d::CCObject *a2)\n{\n  GameLevelManager *v3; // r0\n  const char *TimeLeft; // r0\n  cocos2d::CCString *v5; // r0\n  const char *CString; // r8\n  size_t v7; // r0\n  int *v8; // r5\n  int v10; // [sp+8h] [bp-10h] BYREF\n  int v11; // [sp+Ch] [bp-Ch]\n  int v12; // [sp+10h] [bp-8h]\n\n  v3 = (GameLevelManager *)GameLevelManager::sharedState(this);\n  TimeLeft = (const char *)GameLevelManager::getTimeLeft(v3, \"sync_account\", 30.0);\n  if ( (unsigned int)(TimeLeft - 1) > 0x1D )\n  {\n    v10 = 0;\n    v11 = 0;\n    v12 = 0;\n    std::string::__init(\n      &v10,\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      0x83u);\n    v8 = FLAlertLayer::create(\n           (int)this + 492,\n           (cocos2d::CCLabelBMFont *)\"Load Data\",\n           (int)&v10,\n           (ButtonSprite *)\"Cancel\",\n           (ButtonSprite *)\"Load\",\n           300.0);\n    std::string::~string((int)&v10);\n    (*(void (__fastcall **)(int *, int))(*v8 + 36))(v8, 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    v10 = 0;\n    v11 = 0;\n    v12 = 0;\n    CString = (const char *)cocos2d::CCString::getCString(v5);\n    v7 = strlen(CString);\n    std::string::__init(&v10, CString, v7);\n    v8 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)\"Too fast\", (int)&v10, (ButtonSprite *)\"OK\", nullptr, 300.0);\n    std::string::~string((int)&v10);\n  }\n  return (*(int (__fastcall **)(int *))(*v8 + 656))(v8);\n}", "assembly": "; \n; AccountLayer::onSync from 0x584150 to 0x584226 (214 bytes)\n; \n; 0 xrefs:\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:52:56 +0000\n; \nPUSH.W          {R4-R8,LR}                                             ; +0x0, 0x584150\nSUB             SP, SP, #0x18                                          ; +0x4, 0x584154\nLDR             R6, =(__stack_chk_guard_ptr - 0x584162)                ; +0x6, 0x584156\nMOV             R5, R0                                                 ; +0x8, 0x584158\nADD             R4, SP, #0x18+var_10                                   ; +0xa, 0x58415a\nLDR             R7, =0x43960000                                        ; +0xc, 0x58415c\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0xe, 0x58415e\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x10, 0x584160\nLDR             R3, [R6]                                               ; +0x12, 0x584162\nSTR             R3, [SP,#0x18+var_4]                                   ; +0x14, 0x584164\nBL              _ZN16GameLevelManager11sharedStateEv; GameLevelManager::sharedState(void) ; +0x16, 0x584166\nLDR             R1, =(aSyncAccount - 0x584172); \"sync_account\"         ; +0x1a, 0x58416a\nLDR             R2, flt_58422C; float                                  ; +0x1c, 0x58416c\nADD             R1, PC; \"sync_account\"                                 ; +0x1e, 0x58416e\nBL              _ZN16GameLevelManager11getTimeLeftEPKcf; GameLevelManager::getTimeLeft(char const*,float) ; +0x20, 0x584170\nSUBS            R3, R0, #1                                             ; +0x24, 0x584174\nMOV             R1, R0; char *                                         ; +0x26, 0x584176\nCMP             R3, #0x1D                                              ; +0x28, 0x584178\nBHI             loc_5841BE                                             ; +0x2a, 0x58417a\nLDR             R0, =(aPleaseWaitISec_1 - 0x584184); \"Please wait %i seconds before attemptin\"... ; +0x2c, 0x58417c\nMOVS            R5, #0                                                 ; +0x2e, 0x58417e\nADD             R0, PC; \"Please wait %i seconds before attemptin\"...   ; +0x30, 0x584180\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x32, 0x584182\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x36, 0x584186\nSTR             R5, [SP,#0x18+var_10]                                  ; +0x3a, 0x58418a\nSTR             R5, [SP,#0x18+var_C]                                   ; +0x3c, 0x58418c\nSTR             R5, [SP,#0x18+var_8]                                   ; +0x3e, 0x58418e\nMOV             R8, R0                                                 ; +0x40, 0x584190\nBLX             strlen                                                 ; +0x42, 0x584192\nMOV             R1, R8                                                 ; +0x46, 0x584196\nMOV             R2, R0                                                 ; +0x48, 0x584198\nMOV             R0, R4                                                 ; +0x4a, 0x58419a\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x4c, 0x58419c\nLDR             R1, =(aTooFast - 0x5841AC); \"Too fast\"                 ; +0x50, 0x5841a0\nLDR             R3, =(aOk - 0x5841B2); \"OK\"                            ; +0x52, 0x5841a2\nMOV             R0, R5; int                                            ; +0x54, 0x5841a4\nSTR             R5, [SP,#0x18+var_18]; int                             ; +0x56, 0x5841a6\nADD             R1, PC; \"Too fast\"                                     ; +0x58, 0x5841a8\nSTR             R7, [SP,#0x18+var_14]; float                           ; +0x5a, 0x5841aa\nMOV             R2, R4; int                                            ; +0x5c, 0x5841ac\nADD             R3, PC; \"OK\"                                           ; +0x5e, 0x5841ae\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0x60, 0x5841b0\nMOV             R5, R0                                                 ; +0x64, 0x5841b4\nMOV             R0, R4                                                 ; +0x66, 0x5841b6\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x68, 0x5841b8\nB               loc_5841FE                                             ; +0x6c, 0x5841bc\nLDR             R1, =(aDoYouWantToCgD - 0x5841CA); \"Do you want to <cg>download</c> your ac\"... ; +0x6e, 0x5841be\nMOV             R0, R4                                                 ; +0x70, 0x5841c0\nMOVS            R2, #0x83                                              ; +0x72, 0x5841c2\nMOVS            R3, #0                                                 ; +0x74, 0x5841c4\nADD             R1, PC; \"Do you want to <cg>download</c> your ac\"...   ; +0x76, 0x5841c6\nSTR             R3, [SP,#0x18+var_10]                                  ; +0x78, 0x5841c8\nSTR             R3, [SP,#0x18+var_C]                                   ; +0x7a, 0x5841ca\nSTR             R3, [SP,#0x18+var_8]                                   ; +0x7c, 0x5841cc\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x7e, 0x5841ce\nLDR             R3, =(aLoad - 0x5841E0); \"Load\"                        ; +0x82, 0x5841d2\nADD.W           R0, R5, #0x1EC; int                                    ; +0x84, 0x5841d4\nLDR             R1, =(aLoadData - 0x5841E6); \"Load Data\"               ; +0x88, 0x5841d8\nMOV             R2, R4; int                                            ; +0x8a, 0x5841da\nADD             R3, PC; \"Load\"                                         ; +0x8c, 0x5841dc\nSTR             R3, [SP,#0x18+var_18]; int                             ; +0x8e, 0x5841de\nLDR             R3, =(aCancel - 0x5841EA); \"Cancel\"                    ; +0x90, 0x5841e0\nADD             R1, PC; \"Load Data\"                                    ; +0x92, 0x5841e2\nSTR             R7, [SP,#0x18+var_14]; float                           ; +0x94, 0x5841e4\nADD             R3, PC; \"Cancel\"                                       ; +0x96, 0x5841e6\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0x98, 0x5841e8\nMOV             R5, R0                                                 ; +0x9c, 0x5841ec\nMOV             R0, R4                                                 ; +0x9e, 0x5841ee\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xa0, 0x5841f0\nLDR             R3, [R5]                                               ; +0xa4, 0x5841f4\nMOV             R0, R5                                                 ; +0xa6, 0x5841f6\nMOVS            R1, #2                                                 ; +0xa8, 0x5841f8\nLDR             R3, [R3,#0x24]                                         ; +0xaa, 0x5841fa\nBLX             R3                                                     ; +0xac, 0x5841fc\nLDR             R3, [R5]                                               ; +0xae, 0x5841fe\nMOV             R0, R5                                                 ; +0xb0, 0x584200\nLDR.W           R3, [R3,#0x290]                                        ; +0xb2, 0x584202\nBLX             R3                                                     ; +0xb6, 0x584206\nLDR             R2, [SP,#0x18+var_4]                                   ; +0xb8, 0x584208\nLDR             R3, [R6]                                               ; +0xba, 0x58420a\nCMP             R2, R3                                                 ; +0xbc, 0x58420c\nBEQ             loc_584220                                             ; +0xbe, 0x58420e\nBLX             __stack_chk_fail                                       ; +0xc0, 0x584210\nB               loc_584216                                             ; +0xc4, 0x584214\nMOV             R0, R4                                                 ; +0xc6, 0x584216\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xc8, 0x584218\nBL              __cxa_end_cleanup                                      ; +0xcc, 0x58421c\nADD             SP, SP, #0x18                                          ; +0xd0, 0x584220\nPOP.W           {R4-R8,PC}                                             ; +0xd2, 0x584222", "xrefs": [], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}