//
// SecretLayer3::revealStep4 from 0x1004a03c0 to 0x1004a0a5c (1692 bytes)
//
// 2 xrefs:
// > SecretLayer3::revealStep3 @ 0x1004a038d
// > SecretLayer3::dialogClosed @ 0x1004a1363
//
// 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 12:30:52 +0000
//
void __fastcall SecretLayer3::revealStep4(__int64 a1)
{
__int64 v1; // r14
char *v2; // rax
char *v3; // rax
__int64 v4; // rax
__int64 v5; // rax
__int64 v6; // rax
const char *CString; // r15
size_t v8; // rax
size_t v9; // r12
char *v10; // r13
char *v11; // r15
size_t v12; // rbx
size_t v13; // rax
std::string::size_type v14; // r12
char *data; // r13
size_t v16; // rbx
char *v17; // rax
char *v18; // rax
char *v19; // rax
char *v20; // rax
char *v21; // r14
char v22; // [rsp+0h] [rbp-190h]
__int64 v23; // [rsp+8h] [rbp-188h]
std::string v24; // [rsp+10h] [rbp-180h] BYREF
std::string v25; // [rsp+28h] [rbp-168h] BYREF
std::string v26; // [rsp+40h] [rbp-150h] BYREF
std::string v27; // [rsp+58h] [rbp-138h] BYREF
std::string v28; // [rsp+70h] [rbp-120h] BYREF
std::string v29; // [rsp+88h] [rbp-108h] BYREF
std::string v30; // [rsp+A0h] [rbp-F0h] BYREF
std::string v31; // [rsp+B8h] [rbp-D8h] BYREF
std::string v32; // [rsp+D0h] [rbp-C0h] BYREF
std::string v33; // [rsp+E8h] [rbp-A8h] BYREF
std::string v34; // [rsp+100h] [rbp-90h] BYREF
std::string v35; // [rsp+118h] [rbp-78h] BYREF
__int128 v36; // [rsp+130h] [rbp-60h] BYREF
void *v37; // [rsp+140h] [rbp-50h]
_QWORD __dst[2]; // [rsp+150h] [rbp-40h] BYREF
char *__s; // [rsp+160h] [rbp-30h]
v1 = sub_1007FE900(a1);
v24.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)6;
*(_DWORD *)((char *)&v24.__r_.__value_.__l.0 + 1) = 3026478;
v30.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x50u);
v30.__r_.__value_.__r.__words[0] = 81;
v30.__r_.__value_.__l.__size_ = 79;
strcpy(
v30.__r_.__value_.__l.__data_,
"RubRub told me he was cooking some chicken. Then he locked me in.");
v2 = DialogObject::create(&v24, &v30, 16, 0, 0xFFFFFF, 0.80000001);
sub_1007FEBF0(v1, v2);
if ( (*(_BYTE *)&v30.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v30.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v24.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v24.__r_.__value_.__l.__data_);
v25.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)6;
*(_DWORD *)((char *)&v25.__r_.__value_.__l.0 + 1) = 3026478;
v31.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v31.__r_.__value_.__r.__words[0] = 65;
v31.__r_.__value_.__l.__size_ = 58;
strcpy(v31.__r_.__value_.__l.__data_, "Now that you have freed me, I can continue my master plan.");
v3 = DialogObject::create(&v25, &v31, 16, 0, 0xFFFFFF, 1.0);
sub_1007FEBF0(v1, v3);
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) == 0 )
{
if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_7;
LABEL_10:
operator delete(v25.__r_.__value_.__l.__data_);
v4 = GameManager::sharedState();
if ( (*(_BYTE *)(v4 + 632) & 1) == 0 )
goto LABEL_8;
goto LABEL_11;
}
operator delete(v31.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v25.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_10;
LABEL_7:
v4 = GameManager::sharedState();
if ( (*(_BYTE *)(v4 + 632) & 1) == 0 )
{
LABEL_8:
v5 = v4 + 632;
v37 = *(void **)(v5 + 16);
v36 = *(_OWORD *)v5;
v23 = a1;
goto LABEL_12;
}
LABEL_11:
sub_10001AD30(&v36, *(const void **)(v4 + 648), *(_QWORD *)(v4 + 640));
v23 = a1;
LABEL_12:
v6 = sub_10088E820(
"DESTROY the world of Geometry Dash! And I couldn't have done it without you %s.",
v22);
CString = (const char *)cocos2d::CCString::getCString(v6);
v8 = strlen(CString);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v9 = v8;
if ( v8 >= 0x17 )
{
v12 = 26;
if ( (v8 | 7) != 0x17 )
v12 = (v8 | 7) + 1;
v10 = (char *)operator new(v12);
__s = v10;
__dst[0] = v12 | 1;
__dst[1] = v9;
}
else
{
LOBYTE(__dst[0]) = 2 * v8;
v10 = (char *)__dst + 1;
if ( !v8 )
{
BYTE1(__dst[0]) = 0;
if ( (v36 & 1) == 0 )
goto LABEL_17;
goto LABEL_16;
}
}
memmove(v10, CString, v9);
v10[v9] = 0;
if ( (v36 & 1) != 0 )
LABEL_16:
operator delete(v37);
LABEL_17:
v26.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)6;
*(_DWORD *)((char *)&v26.__r_.__value_.__l.0 + 1) = 3026478;
if ( (__dst[0] & 1) != 0 )
v11 = __s;
else
v11 = (char *)__dst + 1;
v13 = strlen(v11);
if ( v13 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v14 = v13;
if ( v13 >= 0x17 )
{
v16 = 26;
if ( (v13 | 7) != 0x17 )
v16 = (v13 | 7) + 1;
data = (char *)operator new(v16);
v35.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
v35.__r_.__value_.__r.__words[0] = v16 | 1;
v35.__r_.__value_.__l.__size_ = v14;
goto LABEL_32;
}
v35.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v13);
data = v35.__r_.__value_.__s.__data_;
if ( v13 )
LABEL_32:
memmove(data, v11, v14);
data[v14] = 0;
v17 = DialogObject::create(&v26, &v35, 16, 0, 0xFFFFFF, 0.80000001);
sub_1007FEBF0(v1, v17);
if ( (*(_BYTE *)&v35.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v35.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v26.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v26.__r_.__value_.__l.__data_);
v27.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)6;
*(_DWORD *)((char *)&v27.__r_.__value_.__l.0 + 1) = 3026478;
v32.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x60u);
v32.__r_.__value_.__r.__words[0] = 97;
v32.__r_.__value_.__l.__size_ = 90;
strcpy(
v32.__r_.__value_.__l.__data_,
"But I almost forgot, I left you a small gift. As a token of my appreciation.");
v18 = DialogObject::create(&v27, &v32, 16, 0, 0xFFFFFF, 0.80000001);
sub_1007FEBF0(v1, v18);
if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v32.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v27.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v27.__r_.__value_.__l.__data_);
v28.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)6;
*(_DWORD *)((char *)&v28.__r_.__value_.__l.0 + 1) = 3026478;
v33.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x38u);
v33.__r_.__value_.__r.__words[0] = 57;
v33.__r_.__value_.__l.__size_ = 54;
strcpy(v33.__r_.__value_.__l.__data_, "You should prepare yourself for when I return.");
v19 = DialogObject::create(&v28, &v33, 16, 0, 0xFFFFFF, 1.0);
sub_1007FEBF0(v1, v19);
if ( (*(_BYTE *)&v33.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v33.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v28.__r_.__value_.__l.__data_);
v29.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)6;
*(_DWORD *)((char *)&v29.__r_.__value_.__l.0 + 1) = 3026478;
v34.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x30u);
v34.__r_.__value_.__r.__words[0] = 49;
v34.__r_.__value_.__l.__size_ = 45;
strcpy(v34.__r_.__value_.__l.__data_, "You will need it...");
v20 = DialogObject::create(&v29, &v34, 16, 0, 0xFFFFFF, 1.0);
sub_1007FEBF0(v1, v20);
if ( (*(_BYTE *)&v34.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v34.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v29.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v29.__r_.__value_.__l.__data_);
v21 = DialogLayer::createWithObjects(v1, 4u);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)v23 + 464LL))(v23, v21, 100);
*((_QWORD *)v21 + 78) = v23 + 408;
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v21 + 72LL))(v21, 4);
DialogLayer::updateChatPlacement((__int64)v21, 1);
DialogLayer::animateIn((__int64)v21, 1);
if ( (__dst[0] & 1) != 0 )
operator delete(__s);
}