//
// AccountRegisterLayer::init from 0x140078aa0 to 0x1400799c8 (3880 bytes)
//
// 5 xrefs:
// > AccountLayer::onRegister @ 0x14007dfb8
// > AccountLayer::onRegister @ 0x14007dfbf
// > AccountLayer::onRegister @ 0x14007dfa9
// > ??> @ 0x1405395f8
// > ??> @ 0x1406c66cc
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=2
bool AccountRegisterLayer::init(AccountRegisterLayer *a1)
{
bool result; // al
__int64 v3; // rcx
cocos2d::CCDirector *v4; // rax
struct cocos2d::CCRect *v5; // rax
struct cocos2d::extension::CCScale9Sprite *v6; // rdi
__int64 v7; // rdx
cocos2d::extension::CCScale9Sprite_vtbl *v8; // rbx
const cocos2d::CCSize *v9; // rax
struct cocos2d::CCLabelBMFont *v10; // rdi
cocos2d::CCLabelBMFont_vtbl *v11; // rbx
const cocos2d::CCPoint *v12; // rax
__int64 v13; // rcx
cocos2d::CCMenu *v14; // rax
__int64 v15; // rcx
cocos2d::CCArray *v16; // rdi
ButtonSprite *v17; // rax
CCMenuItemSpriteExtra *v18; // rbx
ButtonSprite *v19; // rax
CCMenuItemSpriteExtra *v20; // rbx
const cocos2d::CCPoint *v21; // rax
struct cocos2d::CCPoint v22; // rax
cocos2d::CCSize v23; // rax
cocos2d::CCSize v24; // rbx
cocos2d::CCPoint v25; // rax
__int64 v26; // rax
__int64 v27; // rbx
__int64 v28; // rax
int v29; // eax
int v30; // eax
std::string *p_m_allowedChars; // rcx
void **v32; // rdx
cocos2d::CCSize v33; // rax
cocos2d::CCSize v34; // rbx
cocos2d::CCPoint v35; // rax
__int64 v36; // rax
__int64 v37; // rbx
__int64 v38; // rax
int v39; // eax
int v40; // eax
std::string *v41; // rcx
void **v42; // rdx
CCTextInputNode *m_passwordField; // rcx
cocos2d::CCSize v44; // rax
cocos2d::CCSize v45; // rbx
cocos2d::CCPoint v46; // rax
__int64 v47; // rax
__int64 v48; // rbx
__int64 v49; // rax
int v50; // eax
int v51; // eax
std::string *v52; // rcx
void **v53; // rdx
CCTextInputNode *m_confirmPasswordField; // rcx
cocos2d::CCSize v55; // rax
cocos2d::CCSize v56; // rbx
cocos2d::CCPoint v57; // rax
__int64 v58; // rax
__int64 v59; // rbx
__int64 v60; // rax
int v61; // eax
int v62; // eax
std::string *v63; // rcx
void **v64; // rdx
cocos2d::CCSize v65; // rax
cocos2d::CCSize v66; // rbx
cocos2d::CCPoint v67; // rax
__int64 v68; // rax
__int64 v69; // rbx
__int64 v70; // rax
int v71; // eax
int v72; // eax
std::string *v73; // rcx
void **v74; // rdx
LoadingCircle *v75; // rax
cocos2d::CCSprite *m_sprite; // rbx
cocos2d::CCSprite_vtbl *v77; // rdi
const cocos2d::CCPoint *v78; // rax
__int128 v79; // [rsp+40h] [rbp-C0h] BYREF
__int64 v80; // [rsp+50h] [rbp-B0h]
__int64 v81; // [rsp+58h] [rbp-A8h]
__int128 *v82; // [rsp+60h] [rbp-A0h] BYREF
cocos2d::CCRect v83; // [rsp+68h] [rbp-98h] BYREF
cocos2d::CCPoint v84; // [rsp+78h] [rbp-88h] BYREF
struct cocos2d::CCPoint v85; // [rsp+80h] [rbp-80h] BYREF
struct cocos2d::CCPoint v86; // [rsp+88h] [rbp-78h] BYREF
struct cocos2d::CCPoint v87; // [rsp+90h] [rbp-70h] BYREF
float v88; // [rsp+98h] [rbp-68h]
float v89; // [rsp+9Ch] [rbp-64h]
struct cocos2d::CCPoint v90; // [rsp+A0h] [rbp-60h] BYREF
void *Src[2]; // [rsp+A8h] [rbp-58h] BYREF
size_t Size; // [rsp+B8h] [rbp-48h]
unsigned __int64 v93; // [rsp+C0h] [rbp-40h]
void *v94[2]; // [rsp+C8h] [rbp-38h] BYREF
size_t v95; // [rsp+D8h] [rbp-28h]
unsigned __int64 v96; // [rsp+E0h] [rbp-20h]
void *v97[2]; // [rsp+E8h] [rbp-18h] BYREF
size_t v98; // [rsp+F8h] [rbp-8h]
unsigned __int64 v99; // [rsp+100h] [rbp+0h]
void *v100[2]; // [rsp+108h] [rbp+8h] BYREF
size_t v101; // [rsp+118h] [rbp+18h]
unsigned __int64 v102; // [rsp+120h] [rbp+20h]
void *v103[2]; // [rsp+128h] [rbp+28h] BYREF
size_t v104; // [rsp+138h] [rbp+38h]
unsigned __int64 v105; // [rsp+140h] [rbp+40h]
cocos2d::CCSize v106; // [rsp+1B8h] [rbp+B8h] BYREF
cocos2d::CCPoint v107; // [rsp+1C0h] [rbp+C0h] BYREF
cocos2d::CCPoint v108; // [rsp+1C8h] [rbp+C8h] BYREF
result = FLAlertLayer::init_1(a1, 150);
if ( result )
{
a1->m_noElasticity = 1;
v4 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4);
v5 = (struct cocos2d::CCRect *)cocos2d::CCRect::CCRect(&v83, 0.0, 0.0, 80.0, 80.0);
v6 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v5);
LOBYTE(v7) = -1;
v6->setOpacity(&v6->cocos2d::CCRGBAProtocol, v7);
v8 = v6->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v84, 400.0, 300.0);
v8->setContentSize(v6, v9);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v6, -1);
cocos2d::CCPoint::CCPoint(&v107, v88 * 0.5, v89 * 0.5);
v6->setPosition_0(v6, &v107);
v10 = cocos2d::CCLabelBMFont::create("Register Account", (const char *)&qword_14052A4D8);
v11 = v10->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v84, v107.x, (float)(v107.y + 150.0) - 16.0);
v11->setPosition_0(v10, v12);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v10);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v10->setScale_0)(v10);
v14 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(v13);
a1->m_buttonMenu = v14;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v14, 10);
v16 = (cocos2d::CCArray *)cocos2d::CCArray::create(v15);
v17 = ButtonSprite::create_1("Cancel", 0, 0, 1.0, 0, "goldFont.fnt", "GJ_button_01.png", 0.0);
v18 = CCMenuItemSpriteExtra::create(v17, nullptr, a1, (cocos2d::SEL_MenuHandler *)AccountRegisterLayer::onClose);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v18);
cocos2d::CCArray::addObject(v16, v18);
v19 = ButtonSprite::create_1("Submit", 0, 0, 1.0, 0, "goldFont.fnt", "GJ_button_01.png", 0.0);
v20 = CCMenuItemSpriteExtra::create(v19, nullptr, a1, (cocos2d::SEL_MenuHandler *)AccountRegisterLayer::onSubmit);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v20);
cocos2d::CCArray::addObject(v16, v20);
v21 = a1->m_mainLayer->getPosition_0(a1->m_mainLayer);
cocos2d::CCPoint::CCPoint(&v84, v107.x, (float)((float)(v107.y - 150.0) + 22.0) + v21->y);
v22 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v82);
GameToolbox::alignItemsHorisontally(v16, 15.0, v22, 0);
cocos2d::CCSize::CCSize(&v106, 300.0, 30.0);
cocos2d::CCPoint::CCPoint(&v108, v107.x, v107.y + 90.0);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v82, &v106);
v24 = v23;
cocos2d::CCPoint::CCPoint(&v84, &v108);
AccountRegisterLayer::createTextBackground(a1, v25, v24);
v82 = &v79;
v79 = 0;
v80 = 0;
v81 = 15;
*(_QWORD *)&v79 = sub_14003AA10(0x30u);
v80 = 34;
v81 = 47;
strcpy((char *)v79, "Username: (shown to other players)");
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v84, &v106);
v27 = v26;
cocos2d::CCPoint::CCPoint(&v83.origin, &v108);
a1->m_usernameLabel = (cocos2d::CCLabelBMFont *)AccountRegisterLayer::createTextLabel(a1, v28, &v79, v27);
v83.origin = (cocos2d::CCPoint)&v79;
v80 = 8;
v81 = 15;
v79 = 0x656D616E72657355uLL;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v82, &v106);
LODWORD(v27) = v29;
cocos2d::CCPoint::CCPoint(&v84, &v108);
a1->m_usernameField = (CCTextInputNode *)AccountRegisterLayer::createTextInput(
(_DWORD)a1,
v30,
v27,
(unsigned int)&v79,
1);
*(_OWORD *)Src = 0;
Size = 0;
v93 = 15;
Src[0] = sub_14003AA10(0x40u);
Size = 62;
v93 = 63;
strcpy((char *)Src[0], "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
v83.origin = (cocos2d::CCPoint)Src;
p_m_allowedChars = &a1->m_usernameField->m_allowedChars;
if ( p_m_allowedChars != (std::string *)Src )
{
v32 = Src;
if ( v93 > 0xF )
v32 = (void **)Src[0];
sub_14003CCE0((void **)p_m_allowedChars, v32, Size);
}
sub_14003A830((__int64)Src);
a1->m_usernameField->m_maxLabelLength = 15;
cocos2d::CCPoint::CCPoint(&v83.origin, 0.0, -45.0);
cocos2d::CCPoint::operator+(&v108, &v85);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v83, &v106);
v34 = v33;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v82, &v85);
AccountRegisterLayer::createTextBackground(a1, v35, v34);
v83.origin = (cocos2d::CCPoint)&v79;
*((_QWORD *)&v79 + 1) = 58;
v80 = 9;
v81 = 15;
*(_QWORD *)&v79 = 0x64726F7773736150LL;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v82, &v106);
v37 = v36;
cocos2d::CCPoint::CCPoint(&v84, &v85);
a1->m_passwordLabel = (cocos2d::CCLabelBMFont *)AccountRegisterLayer::createTextLabel(a1, v38, &v79, v37);
v83.origin = (cocos2d::CCPoint)&v79;
v80 = 8;
v81 = 15;
v79 = 0x64726F7773736150uLL;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v82, &v106);
LODWORD(v37) = v39;
cocos2d::CCPoint::CCPoint(&v84, &v85);
a1->m_passwordField = (CCTextInputNode *)AccountRegisterLayer::createTextInput(
(_DWORD)a1,
v40,
v37,
(unsigned int)&v79,
2);
*(_OWORD *)v94 = 0;
v95 = 0;
v96 = 15;
v94[0] = sub_14003AA10(0x60u);
v95 = 84;
v96 = 95;
strcpy((char *)v94[0], " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~!*'();:@+$,/?#[]&");
v83.origin = (cocos2d::CCPoint)v94;
v41 = &a1->m_passwordField->m_allowedChars;
if ( v41 != (std::string *)v94 )
{
v42 = v94;
if ( v96 > 0xF )
v42 = (void **)v94[0];
sub_14003CCE0((void **)v41, v42, v95);
}
sub_14003A830((__int64)v94);
a1->m_passwordField->m_maxLabelLength = 20;
a1->m_passwordField->m_usePasswordChar = 1;
m_passwordField = a1->m_passwordField;
m_passwordField->m_maxLabelScale = 1.0;
CCTextInputNode::refreshLabel(m_passwordField);
cocos2d::CCPoint::CCPoint(&v83.origin, 0.0, -45.0);
cocos2d::CCPoint::operator+(&v85, &v86);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v83, &v106);
v45 = v44;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v82, &v86);
AccountRegisterLayer::createTextBackground(a1, v46, v45);
v83.origin = (cocos2d::CCPoint)&v79;
v79 = 0;
v80 = 0;
v81 = 15;
*(_QWORD *)&v79 = sub_14003AA10(0x20u);
v80 = 17;
v81 = 31;
strcpy((char *)v79, "Confirm Password:");
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v82, &v106);
v48 = v47;
cocos2d::CCPoint::CCPoint(&v84, &v86);
a1->m_confirmPasswordLabel = (cocos2d::CCLabelBMFont *)AccountRegisterLayer::createTextLabel(a1, v49, &v79, v48);
v83.origin = (cocos2d::CCPoint)&v79;
v79 = 0;
v80 = 0;
v81 = 15;
*(_QWORD *)&v79 = sub_14003AA10(0x20u);
v80 = 16;
v81 = 31;
strcpy((char *)v79, "Confirm Password");
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v82, &v106);
LODWORD(v48) = v50;
cocos2d::CCPoint::CCPoint(&v84, &v86);
a1->m_confirmPasswordField = (CCTextInputNode *)AccountRegisterLayer::createTextInput(
(_DWORD)a1,
v51,
v48,
(unsigned int)&v79,
3);
*(_OWORD *)v97 = 0;
v98 = 0;
v99 = 15;
v97[0] = sub_14003AA10(0x60u);
v98 = 84;
v99 = 95;
strcpy((char *)v97[0], " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~!*'();:@+$,/?#[]&");
v83.origin = (cocos2d::CCPoint)v97;
v52 = &a1->m_confirmPasswordField->m_allowedChars;
if ( v52 != (std::string *)v97 )
{
v53 = v97;
if ( v99 > 0xF )
v53 = (void **)v97[0];
sub_14003CCE0((void **)v52, v53, v98);
}
sub_14003A830((__int64)v97);
a1->m_confirmPasswordField->m_maxLabelLength = 20;
a1->m_confirmPasswordField->m_usePasswordChar = 1;
m_confirmPasswordField = a1->m_confirmPasswordField;
m_confirmPasswordField->m_maxLabelScale = 1.0;
CCTextInputNode::refreshLabel(m_confirmPasswordField);
cocos2d::CCPoint::CCPoint(&v83.origin, 0.0, -45.0);
cocos2d::CCPoint::operator+(&v86, &v87);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v83, &v106);
v56 = v55;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v82, &v87);
AccountRegisterLayer::createTextBackground(a1, v57, v56);
v83.origin = (cocos2d::CCPoint)&v79;
v79 = 0;
v80 = 6;
v81 = 15;
strcpy((char *)&v79, "Email:");
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v82, &v106);
v59 = v58;
cocos2d::CCPoint::CCPoint(&v84, &v87);
a1->m_emailLabel = (cocos2d::CCLabelBMFont *)AccountRegisterLayer::createTextLabel(a1, v60, &v79, v59);
v83.origin = (cocos2d::CCPoint)&v79;
v79 = 0;
v80 = 5;
v81 = 15;
strcpy((char *)&v79, "Email");
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v82, &v106);
LODWORD(v59) = v61;
cocos2d::CCPoint::CCPoint(&v84, &v87);
a1->m_emailField = (CCTextInputNode *)AccountRegisterLayer::createTextInput(
(_DWORD)a1,
v62,
v59,
(unsigned int)&v79,
4);
*(_OWORD *)v100 = 0;
v101 = 0;
v102 = 15;
v100[0] = sub_14003AA10(0x50u);
v101 = 67;
v102 = 79;
strcpy((char *)v100[0], " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_@.");
v83.origin = (cocos2d::CCPoint)v100;
v63 = &a1->m_emailField->m_allowedChars;
if ( v63 != (std::string *)v100 )
{
v64 = v100;
if ( v102 > 0xF )
v64 = (void **)v100[0];
sub_14003CCE0((void **)v63, v64, v101);
}
sub_14003A830((__int64)v100);
a1->m_emailField->m_maxLabelLength = 50;
cocos2d::CCPoint::CCPoint(&v83.origin, 0.0, -45.0);
cocos2d::CCPoint::operator+(&v87, &v90);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v83, &v106);
v66 = v65;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v82, &v90);
AccountRegisterLayer::createTextBackground(a1, v67, v66);
v83.origin = (cocos2d::CCPoint)&v79;
v80 = 13;
v81 = 15;
strcpy((char *)&v79, "Verify Email:");
HIWORD(v79) = 0;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v82, &v106);
v69 = v68;
cocos2d::CCPoint::CCPoint(&v84, &v90);
a1->m_verifyEmailLabel = (cocos2d::CCLabelBMFont *)AccountRegisterLayer::createTextLabel(a1, v70, &v79, v69);
v83.origin = (cocos2d::CCPoint)&v79;
v80 = 12;
v81 = 15;
strcpy((char *)&v79, "Verify Email");
BYTE13(v79) = 0;
HIWORD(v79) = 0;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v82, &v106);
LODWORD(v69) = v71;
cocos2d::CCPoint::CCPoint(&v84, &v90);
a1->m_verifyEmailField = (CCTextInputNode *)AccountRegisterLayer::createTextInput(
(_DWORD)a1,
v72,
v69,
(unsigned int)&v79,
4);
*(_OWORD *)v103 = 0;
v104 = 0;
v105 = 15;
v103[0] = sub_14003AA10(0x50u);
v104 = 67;
v105 = 79;
strcpy((char *)v103[0], " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_@.");
v83.origin = (cocos2d::CCPoint)v103;
v73 = &a1->m_verifyEmailField->m_allowedChars;
if ( v73 != (std::string *)v103 )
{
v74 = v103;
if ( v105 > 0xF )
v74 = (void **)v103[0];
sub_14003CCE0((void **)v73, v74, v104);
}
sub_14003A830((__int64)v103);
a1->m_verifyEmailField->m_maxLabelLength = 50;
v75 = LoadingCircle::create();
a1->m_loadingCircle = v75;
v75->m_parentLayer = a1->m_mainLayer;
a1->m_loadingCircle->m_fade = 1;
cocos2d::CCObject::retain(a1->m_loadingCircle);
LoadingCircle::show(a1->m_loadingCircle);
a1->m_loadingCircle->setVisible(a1->m_loadingCircle, 0);
m_sprite = a1->m_loadingCircle->m_sprite;
v77 = m_sprite->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v83.origin, v88 * 0.5, v89 * 0.5);
v77->setPosition_0(m_sprite, v78);
return 1;
}
return result;
}