//
// AccountLayer::onSync from 0x140093a70 to 0x140093cf3 (643 bytes)
//
// 2 xrefs:
// > AccountLayer::customSetup @ 0x140093133
// > ??> @ 0x140912ba8
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:26:01 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall AccountLayer::onSync(__int64 a1)
{
__int64 v2; // rcx
int TimeLeft; // eax
cocos2d::CCString *v4; // rax
const char *CString; // rax
size_t v6; // r8
__int64 v7; // rax
cocos2d::CCObject *v8; // rbx
int v9; // ebx
__int64 v10; // rax
__int128 v12; // [rsp+50h] [rbp+7h] BYREF
__int64 v13; // [rsp+60h] [rbp+17h]
__int64 v14; // [rsp+68h] [rbp+1Fh]
_BYTE v15[48]; // [rsp+70h] [rbp+27h] BYREF
void *v16; // [rsp+C0h] [rbp+77h]
v2 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v16 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v16);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v2 = *(_QWORD *)&qword_14090BFB0;
}
TimeLeft = GameLevelManager::getTimeLeft(v2, "sync_account");
if ( (unsigned int)(TimeLeft - 1) > 0x1D )
{
v9 = a1 + 632;
if ( !a1 )
v9 = 0;
v12 = 0;
v13 = 0;
v14 = 0;
*(_QWORD *)&v12 = sub_14003D460(0x90u);
v13 = 131;
v14 = 143;
strcpy(
(char *)v12,
"Do you want to download your account data from the cloud?\n"
"This will merge current data with the saved data.");
v10 = sub_14003F4F0((__int64)v15, (__int64)&v12);
v8 = FLAlertLayer::create(
v9,
(int)"Load Data",
v10,
(__int64)"Cancel",
(__int64)"Load",
1133903872,
0,
0,
1065353216);
sub_14003D310((__int64)&v12);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v8 + 64LL))(v8, 2);
}
else
{
v4 = cocos2d::CCString::createWithFormat(
"Please wait %i seconds before attempting to sync your account again.",
TimeLeft);
CString = cocos2d::CCString::getCString(v4);
v12 = 0;
v13 = 0;
v14 = 0;
v6 = -1;
do
++v6;
while ( CString[v6] );
sub_14003D230(&v12, CString, v6);
v7 = sub_14003F4F0((__int64)v15, (__int64)&v12);
v8 = FLAlertLayer::create(0, (int)"Too fast", v7, (__int64)"OK", 0, 1133903872, 0, 0, 1065353216);
sub_14003D310((__int64)&v12);
}
return (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v8 + 1064LL))(v8);
}