//
// EditLevelLayer::onShare from 0x14017b9b0 to 0x14017c06b (1723 bytes)
//
// 3 xrefs:
// > EditLevelLayer::FLAlert_Clicked @ 0x14017c4eb
// > EditLevelLayer::init @ 0x1401791bc
// > ??> @ 0x14091877c
//
// 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:27:35 +0000
//
// Hidden C++ exception states: #wind=8
__int64 __fastcall EditLevelLayer::onShare(__int64 a1)
{
__int64 v2; // rbx
__int64 v3; // rcx
__int64 v4; // rax
__int64 v5; // rcx
void **v7; // rcx
__int64 v8; // rsi
size_t v9; // r8
int v10; // ebx
__int64 v11; // rax
cocos2d::CCObject *v12; // rbx
void **v13; // rcx
__int64 v14; // rsi
size_t v15; // r8
int v16; // ebx
__int64 v17; // rax
__int64 v18; // rcx
__int64 v19; // r8
__int64 v20; // rcx
_BYTE *v21; // rax
_OWORD *v22; // rcx
const char *v23; // rdx
__int64 v24; // r8
__int64 v25; // rax
cocos2d::CCObject *v26; // rbx
__int64 (__fastcall *v27)(__int64); // rdx
cocos2d::CCObject *v28; // rcx
__int64 v29; // rbx
_QWORD *v30; // rdi
void *v31; // [rsp+50h] [rbp-19h]
void *v32; // [rsp+50h] [rbp-19h]
void *v33; // [rsp+50h] [rbp-19h]
void *v34; // [rsp+58h] [rbp-11h]
__int128 Buf2; // [rsp+60h] [rbp-9h] BYREF
__int64 v36; // [rsp+70h] [rbp+7h]
__int64 v37; // [rsp+78h] [rbp+Fh]
void *Buf1[2]; // [rsp+80h] [rbp+17h] BYREF
__int64 v39; // [rsp+90h] [rbp+27h]
unsigned __int64 v40; // [rsp+98h] [rbp+2Fh]
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v34 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v34);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
if ( (unsigned __int8)GameManager::getGameVariable(v2, "0218")
|| (unsigned __int8)GameManager::getGameVariable(v2, "0219") )
{
if ( !qword_14090BFD0 )
{
v33 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v33);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
}
return GameManager::showParentalRestrictedAlert();
}
else
{
v4 = GJAccountManager::sharedState(v3);
if ( *(_DWORD *)(v4 + 360) - *(_DWORD *)(v4 + 364) <= 0 )
{
GJAccountManager::sharedState((unsigned int)(*(_DWORD *)(v4 + 360) - *(_DWORD *)(v4 + 364)));
return GJAccountManager::showAccountNeededAlert(v5, "share levels");
}
Buf2 = 0;
v36 = 0;
v37 = 15;
LOBYTE(Buf2) = 0;
sub_14003F4F0((__int64)Buf1, *(_QWORD *)(a1 + 472) + 408LL);
v7 = Buf1;
if ( v40 > 0xF )
v7 = (void **)Buf1[0];
v8 = v39;
v9 = v39;
if ( v39 )
v9 = 0;
v10 = memcmp(v7, &Buf2, v9);
if ( !v10 )
v10 = v8 != 0;
sub_14003D310((__int64)Buf1);
if ( !v10 )
{
*(_OWORD *)Buf1 = 0;
v39 = 0;
v40 = 0;
Buf1[0] = sub_14003D460(0x30u);
v39 = 32;
v40 = 47;
strcpy((char *)Buf1[0], "You cannot share an empty level.");
v11 = sub_14003F4F0((__int64)&Buf2, (__int64)Buf1);
v12 = FLAlertLayer::create(0, (int)"Empty", v11, (__int64)"OK", 0, 1136525312, 0, 0, 1065353216);
LABEL_23:
sub_14003D310((__int64)Buf1);
return (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v12 + 1064LL))(v12);
}
Buf2 = 0;
v36 = 0;
v37 = 15;
LOBYTE(Buf2) = 0;
sub_14003F4F0((__int64)Buf1, *(_QWORD *)(a1 + 472) + 344LL);
v13 = Buf1;
if ( v40 > 0xF )
v13 = (void **)Buf1[0];
v14 = v39;
v15 = v39;
if ( v39 )
v15 = 0;
v16 = memcmp(v13, &Buf2, v15);
if ( !v16 )
v16 = v14 != 0;
sub_14003D310((__int64)Buf1);
if ( !v16 )
{
*(_OWORD *)Buf1 = 0;
v39 = 0;
v40 = 0;
Buf1[0] = sub_14003D460(0x30u);
v39 = 43;
v40 = 47;
strcpy((char *)Buf1[0], "You must name your level before sharing it.");
v17 = sub_14003F4F0((__int64)&Buf2, (__int64)Buf1);
v12 = FLAlertLayer::create(0, (int)"No Name", v17, (__int64)"OK", 0, 1136525312, 0, 0, 1065353216);
goto LABEL_23;
}
v18 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v31 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v31);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v18 = qword_14090BFD0;
}
if ( !(unsigned __int8)GameManager::getGameVariable(v18, "0157") )
{
v20 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v32 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v32);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v20 = qword_14090BFD0;
}
LOBYTE(v19) = 1;
GameManager::setGameVariable(v20, "0157", v19);
*(_OWORD *)Buf1 = 0;
v39 = 0;
v40 = 0;
v21 = sub_14003D460(0x1E0u);
Buf1[0] = v21;
v39 = 464;
v40 = 479;
v22 = v21;
v23 = "Hateful, abusive, or otherwise inappropriate content, whether it is in the level, name, or description may l"
"ead to deletion. The same applies to levels abusing cheats or exploits. Stealing assets from other l"
"evels is discouraged and may stop a level from being rated depending on the context, severity, credi"
"t, and more. Levels verified with hacks cannot be rated.\n"
"These guidelines and their enforcement are entirely at RobTop's discretion.";
v24 = 3;
do
{
*v22 = *(_OWORD *)v23;
v22[1] = *((_OWORD *)v23 + 1);
v22[2] = *((_OWORD *)v23 + 2);
v22[3] = *((_OWORD *)v23 + 3);
v22[4] = *((_OWORD *)v23 + 4);
v22[5] = *((_OWORD *)v23 + 5);
v22[6] = *((_OWORD *)v23 + 6);
v22 += 8;
*(v22 - 1) = *((_OWORD *)v23 + 7);
v23 += 128;
--v24;
}
while ( v24 );
*v22 = *(_OWORD *)v23;
v22[1] = *((_OWORD *)v23 + 1);
v22[2] = *((_OWORD *)v23 + 2);
v22[3] = *((_OWORD *)v23 + 3);
v22[4] = *((_OWORD *)v23 + 4);
v21[464] = 0;
v25 = sub_14003F4F0((__int64)&Buf2, (__int64)Buf1);
v26 = FLAlertLayer::create(
(int)a1 + 416,
(int)"Upload Guidelines",
v25,
(__int64)"OK",
0,
1136525312,
0,
0,
1065353216);
sub_14003D310((__int64)Buf1);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v26 + 64LL))(v26, 10);
v27 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v26 + 1064LL);
v28 = v26;
return v27((__int64)v28);
}
EditLevelLayer::closeTextInputs(a1);
v29 = *(_QWORD *)(a1 + 472);
v30 = operator new(0x2F8u);
FLAlertLayer::FLAlertLayer((__int64)v30);
*v30 = &ShareLevelLayer::`vftable';
v30[40] = &ShareLevelLayer::`vftable';
v30[41] = &ShareLevelLayer::`vftable';
v30[42] = &ShareLevelLayer::`vftable';
v30[43] = &ShareLevelLayer::`vftable';
v30[44] = &ShareLevelLayer::`vftable';
v30[51] = &ShareLevelLayer::`vftable';
v30[54] = &ShareLevelLayer::`vftable';
v30[68] = &ShareLevelLayer::`vftable';
v30[83] = 0;
*((_DWORD *)v30 + 168) = 0;
v30[85] = 0;
v30[87] = 0;
v30[88] = 0;
v30[89] = 0;
v30[90] = 0;
v30[91] = 0;
v30[92] = 0;
v30[93] = 0;
v30[94] = 0;
if ( (unsigned __int8)ShareLevelLayer::init(v30, v29) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v30);
}
else
{
(*(void (__fastcall **)(_QWORD *, __int64))(*v30 + 8LL))(v30, 1);
v30 = nullptr;
}
v27 = *(__int64 (__fastcall **)(__int64))(*v30 + 1064LL);
v28 = (cocos2d::CCObject *)v30;
if ( v27 != FLAlertLayer::show )
return v27((__int64)v28);
return FLAlertLayer::show((__int64)v30);
}
}