//
// SecretRewardsLayer::showDialog01 from 0x14056d930 to 0x14056f22c (6396 bytes)
//
// 2 xrefs:
// > SecretRewardsLayer::onShop @ 0x14056c2f2
// > ??> @ 0x14092c708
//
// 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:34:20 +0000
//
// Hidden C++ exception states: #wind=4
__int64 __fastcall SecretRewardsLayer::showDialog01(_DWORD *a1)
{
cocos2d::CCArray *v2; // rsi
__int64 v3; // rcx
__int64 v4; // rcx
char v5; // r15
void **v6; // rax
void **v7; // rax
void **v8; // rax
void **v9; // rax
void **v10; // rax
void **v11; // rax
int v12; // r8d
void **v13; // rax
void **v14; // rax
void **v15; // rax
void **v16; // rax
void **v17; // rax
void **v18; // rax
void **v19; // rax
void **v20; // rax
void **v21; // rax
cocos2d::CCString *v22; // rax
const char *CString; // rax
size_t v24; // rbx
size_t v25; // r8
void **v26; // rax
cocos2d::CCString *v27; // rax
const char *v28; // rax
void **v29; // rax
void **v30; // rax
void **v31; // rax
void **v32; // rax
__int64 v33; // rcx
cocos2d::CCString *v34; // rax
const char *v35; // rax
size_t v36; // rbx
void **v37; // rax
void **v38; // rax
void **v39; // rax
cocos2d::CCNode *DialogLayer; // rsi
__int64 v41; // rcx
__int64 v42; // rax
__int64 v43; // rdi
__int64 v44; // rbx
__int64 v45; // rax
char v47[8]; // [rsp+30h] [rbp-50h] BYREF
__int64 v48; // [rsp+38h] [rbp-48h]
__int64 v49; // [rsp+40h] [rbp-40h]
__int64 v50; // [rsp+48h] [rbp-38h]
__int128 v51; // [rsp+50h] [rbp-30h] BYREF
__int64 v52; // [rsp+60h] [rbp-20h]
__int64 v53; // [rsp+68h] [rbp-18h]
__int128 *v54; // [rsp+B8h] [rbp+38h] BYREF
__int16 v55; // [rsp+C0h] [rbp+40h] BYREF
char v56; // [rsp+C2h] [rbp+42h]
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v3 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v54 = (__int128 *)operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v54);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v3 = qword_14090BFE0;
}
if ( (int)GameStatsManager::getStat(v3, "13") < 500 )
goto LABEL_32;
v4 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v54 = (__int128 *)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v54);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v4 = qword_14090BFD0;
}
if ( GameManager::getUGV(v4, "10") )
{
v5 = 1;
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x40u);
v52 = 53;
v53 = 63;
strcpy((char *)v51, "Oh, the diamonds.\nYou found them.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v6 = DialogObject::create((__int64)v47, (__int64)&v51, 10, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v6);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x40u);
v52 = 55;
v53 = 63;
strcpy((char *)v51, "Alright come in, quickly before someone sees you.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v7 = DialogObject::create((__int64)v47, (__int64)&v51, 13, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v7);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x30u);
v52 = 37;
v53 = 47;
strcpy((char *)v51, "You never know who might be watching.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v8 = DialogObject::create((__int64)v47, (__int64)&v51, 8, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v8);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x20u);
v52 = 21;
v53 = 31;
strcpy((char *)v51, "...");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v9 = DialogObject::create((__int64)v47, (__int64)&v51, 9, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v9);
}
else
{
LABEL_32:
v5 = 0;
switch ( a1[142] )
{
case 0:
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x20u);
v52 = 28;
v53 = 31;
strcpy((char *)v51, "Uhm, there is no rope.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v10 = DialogObject::create((__int64)v47, (__int64)&v51, 8, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v10);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x40u);
v52 = 54;
v53 = 63;
strcpy((char *)v51, "Just... Pretend this never happened.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v11 = DialogObject::create((__int64)v47, (__int64)&v51, 9, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v11);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x20u);
v52 = 21;
v53 = 31;
strcpy((char *)v51, "...");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v12 = 8;
goto LABEL_24;
case 1:
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x30u);
v52 = 38;
v53 = 47;
strcpy((char *)v51, "I'm gonna need you to stop doing that.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v13 = DialogObject::create((__int64)v47, (__int64)&v51, 13, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v13);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x40u);
v52 = 48;
v53 = 63;
strcpy((char *)v51, "If RubRub sees this I am in BIG trouble.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v14 = DialogObject::create((__int64)v47, (__int64)&v51, 8, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v14);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x30u);
v52 = 36;
v53 = 47;
strcpy((char *)v51, "I hate that guy...");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v12 = 12;
goto LABEL_24;
case 2:
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x40u);
v52 = 59;
v53 = 63;
strcpy((char *)v51, "Finally, I thought you wou...");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v15 = DialogObject::create((__int64)v47, (__int64)&v51, 10, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v15);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x30u);
v52 = 40;
v53 = 47;
strcpy((char *)v51, "Wait, You're not the delivery guy.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v16 = DialogObject::create((__int64)v47, (__int64)&v51, 11, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v16);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x50u);
v52 = 64;
v53 = 79;
strcpy((char *)v51, "How am I supposed to run a shop if I don't have any merchandise?");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v17 = DialogObject::create((__int64)v47, (__int64)&v51, 12, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v17);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x20u);
v52 = 24;
v53 = 31;
strcpy((char *)v51, "I mean, what shop?");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v18 = DialogObject::create((__int64)v47, (__int64)&v51, 13, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v18);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x20u);
v52 = 21;
v53 = 31;
strcpy((char *)v51, "...");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v12 = 8;
goto LABEL_24;
case 3:
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x60u);
v52 = 89;
v53 = 95;
strcpy(
(char *)v51,
"Look, I can't let you in.\nNot without the... stuff.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v19 = DialogObject::create((__int64)v47, (__int64)&v51, 8, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v19);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x50u);
v52 = 64;
v53 = 79;
strcpy((char *)v51, "I'm not even supposed to be here.\nI'm just a glitch in the code.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v20 = DialogObject::create((__int64)v47, (__int64)&v51, 13, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v20);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x20u);
v52 = 23;
v53 = 31;
strcpy((char *)v51, "Did you hear something?");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v21 = DialogObject::create((__int64)v47, (__int64)&v51, 8, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v21);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x20u);
v52 = 21;
v53 = 31;
strcpy((char *)v51, "...");
goto LABEL_23;
case 4:
v54 = &v51;
v55 = -1;
v56 = -1;
v22 = cocos2d::CCString::createWithFormat(
"Alright, alright. If you collect\n%i Diamonds I will let you in.",
500);
CString = cocos2d::CCString::getCString(v22);
v51 = 0;
v52 = 0;
v53 = 0;
v24 = -1;
v25 = -1;
do
++v25;
while ( CString[v25] );
sub_14003D230(&v51, CString, v25);
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v26 = DialogObject::create((__int64)v47, (__int64)&v51, 10, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v26);
v54 = &v51;
v55 = -1;
v56 = -1;
v27 = cocos2d::CCString::createWithFormat("Usually the limit is %i, but you look a bit scary.", 1000);
v28 = cocos2d::CCString::getCString(v27);
v51 = 0;
v52 = 0;
v53 = 0;
do
++v24;
while ( v28[v24] );
sub_14003D230(&v51, v28, v24);
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v29 = DialogObject::create((__int64)v47, (__int64)&v51, 13, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v29);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x40u);
v52 = 52;
v53 = 63;
strcpy((char *)v51, "Just, get out of here before someone sees you.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v30 = DialogObject::create((__int64)v47, (__int64)&v51, 11, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v30);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x20u);
v52 = 29;
v53 = 31;
strcpy((char *)v51, "Do you smell burning chicken?");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v31 = DialogObject::create((__int64)v47, (__int64)&v51, 8, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v31);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x20u);
v52 = 21;
v53 = 31;
strcpy((char *)v51, "...");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v32 = DialogObject::create((__int64)v47, (__int64)&v51, 9, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v32);
v33 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v54 = (__int128 *)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v54);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v33 = qword_14090BFD0;
}
GameManager::setUGV(v33, "10", 1u);
break;
case 5:
v54 = &v51;
v55 = -1;
v56 = -1;
v34 = cocos2d::CCString::createWithFormat("Collect %i Diamonds and I will let you in.", 500);
v35 = cocos2d::CCString::getCString(v34);
v51 = 0;
v52 = 0;
v53 = 0;
v36 = -1;
do
++v36;
while ( v35[v36] );
sub_14003D230(&v51, v35, v36);
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v37 = DialogObject::create((__int64)v47, (__int64)&v51, 10, 0.80000001, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v37);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x30u);
v52 = 38;
v53 = 47;
strcpy((char *)v51, "Now go away, RubRub might be watching.");
v48 = 0;
v49 = 7;
v50 = 15;
strcpy(v47, "Scratch");
v38 = DialogObject::create((__int64)v47, (__int64)&v51, 8, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v38);
v54 = &v51;
v55 = -1;
v56 = -1;
v51 = 0;
v52 = 0;
v53 = 0;
*(_QWORD *)&v51 = sub_14003D460(0x20u);
v52 = 21;
v53 = 31;
strcpy((char *)v51, "...");
LABEL_23:
strcpy(v47, "Scratch");
v50 = 15;
v49 = 7;
v48 = 0;
v12 = 9;
LABEL_24:
v39 = DialogObject::create((__int64)v47, (__int64)&v51, v12, 1.0, 0, (__int64)&v55);
cocos2d::CCArray::addObject(v2, (struct cocos2d::CCObject *)v39);
break;
default:
break;
}
if ( (int)++a1[142] > 5 )
a1[142] = 0;
}
DialogLayer = DialogLayer::createDialogLayer(0, (__int64)v2, 2u);
(*(void (__fastcall **)(_DWORD *, cocos2d::CCNode *, __int64))(*(_QWORD *)a1 + 456LL))(a1, DialogLayer, 100);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64))(*(_QWORD *)DialogLayer + 64LL))(DialogLayer, 1);
if ( v5 )
*((_QWORD *)DialogLayer + 78) = a1 + 102;
v42 = cocos2d::CCDirector::sharedDirector(v41);
cocos2d::CCDirector::getWinSize(v42, &v54);
v43 = **((_QWORD **)DialogLayer + 70);
v44 = *((_QWORD *)DialogLayer + 70);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v55, *(float *)&v54 * 0.5, *((float *)&v54 + 1) * 0.5);
(*(void (__fastcall **)(__int64, __int64))(v43 + 184))(v44, v45);
return DialogLayer::animateInRandomSide(DialogLayer);
}