// // SecretRewardsLayer::showDialogMechanic from 0x1403daa60 to 0x1403dbcee (4750 bytes) // // 2 xrefs: // > SecretRewardsLayer::onShop @ 0x1403d67cc // > @ 0x1406d7e08 // // 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=4 void SecretRewardsLayer::showDialogMechanic(SecretRewardsLayer *a1) { float v1; // xmm0_4 cocos2d::CCArray *v3; // rdi GameStatsManager *v4; // rcx int Stat; // r14d GameManager *v6; // rcx char v7; // r15 char *v8; // rax char *v9; // rax char *v10; // rax char *v11; // rax char *v12; // rax int m_mechanicDialogIndex; // ecx int v14; // ecx int v15; // ecx int v16; // ecx char *v17; // rax cocos2d::CCString *v18; // rax const char *v19; // rax size_t v20; // r8 char *v21; // rax char *v22; // rax int v23; // r8d char *v24; // rax cocos2d::CCString *v25; // rax const char *CString; // rax size_t v27; // r8 char *v28; // rax char *v29; // rax GameManager *v30; // rcx char *v31; // rax char *v32; // rax char *v33; // rax char *v34; // rax char *v35; // rax DialogLayer *DialogLayer; // rdi DialogDelegate *v37; // rcx cocos2d::CCDirector *v38; // rax cocos2d::CCLayer_vtbl *v39; // rbx const cocos2d::CCPoint *v40; // rax __int128 v41; // [rsp+30h] [rbp-50h] BYREF __int64 v42; // [rsp+40h] [rbp-40h] __int64 v43; // [rsp+48h] [rbp-38h] __int128 v44; // [rsp+50h] [rbp-30h] BYREF __int64 v45; // [rsp+60h] [rbp-20h] __int64 v46; // [rsp+68h] [rbp-18h] __int128 *v47; // [rsp+B8h] [rbp+38h] __int16 v48; // [rsp+C0h] [rbp+40h] BYREF char v49; // [rsp+C2h] [rbp+42h] v3 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1); v4 = (GameStatsManager *)qword_1406C2EE8; if ( !qword_1406C2EE8 ) { v47 = (__int128 *)operator new(0x3E0u); qword_1406C2EE8 = sub_1401D0AE0((__int64)v47); (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8); v4 = (GameStatsManager *)qword_1406C2EE8; } Stat = GameStatsManager::getStat(v4, "13"); if ( Stat >= 2000 ) { v6 = (GameManager *)qword_1406C2ED8; if ( !qword_1406C2ED8 ) { v47 = (__int128 *)operator new(0x668u); qword_1406C2ED8 = sub_14017AB00((__int64)v47); (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8); v6 = (GameManager *)qword_1406C2ED8; } if ( GameManager::getUGV(v6, "36") ) { v7 = 1; v48 = -1; v49 = -1; v41 = 0; v42 = 0; v43 = 15; *(_QWORD *)&v41 = sub_14003AA10(0x40u); v42 = 56; v43 = 63; strcpy((char *)v41, "Now that's an impressive collection of Diamonds!"); v45 = 12; v46 = 15; strcpy((char *)&v44, "The Mechanic"); BYTE13(v44) = 0; HIWORD(v44) = 0; v8 = DialogObject::create((__int64)&v44, (__int64)&v41, 39, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v8); v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x30u); v45 = 35; v46 = 47; strcpy((char *)v44, "If anyone asks I didn't let you in."); v42 = 12; v43 = 15; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v9 = DialogObject::create((__int64)&v41, (__int64)&v44, 37, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v9); v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x50u); v45 = 67; v46 = 79; strcpy((char *)v44, "Scratch keeps trying to sneak past my security..."); v42 = 12; v43 = 15; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v10 = DialogObject::create((__int64)&v41, (__int64)&v44, 50, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v10); v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x30u); v45 = 41; v46 = 47; strcpy((char *)v44, "I CAN'T SEE!?"); v42 = 12; v43 = 15; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v11 = DialogObject::create((__int64)&v41, (__int64)&v44, 44, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v11); v47 = &v44; v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x40u); v45 = 61; v46 = 63; strcpy((char *)v44, "Ah sorry, my goggles were off.\nCome in."); v42 = 12; v43 = 15; v1 = 1.9431574e-19; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v12 = DialogObject::create((__int64)&v41, (__int64)&v44, 51, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v12); goto LABEL_28; } } v7 = 0; m_mechanicDialogIndex = a1->m_mechanicDialogIndex; if ( !m_mechanicDialogIndex ) { v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x30u); v45 = 44; v46 = 47; strcpy((char *)v44, "I'm in the middle of a job.\nCome back later."); v42 = 12; v43 = 15; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v34 = DialogObject::create((__int64)&v41, (__int64)&v44, 38, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v34); v47 = &v44; v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x40u); v45 = 57; v46 = 63; strcpy((char *)v44, "Can never get any peace and quiet in this game..."); goto LABEL_24; } v14 = m_mechanicDialogIndex - 1; if ( !v14 ) { v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x20u); v45 = 30; v46 = 31; strcpy((char *)v44, "You again!? What now!?"); v42 = 12; v43 = 15; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v32 = DialogObject::create((__int64)&v41, (__int64)&v44, 46, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v32); v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x30u); v45 = 32; v46 = 47; strcpy((char *)v44, "I'm busy go bother someone else."); v42 = 12; v43 = 15; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v33 = DialogObject::create((__int64)&v41, (__int64)&v44, 51, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v33); v47 = &v44; v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x50u); v45 = 78; v46 = 79; strcpy((char *)v44, "You take one job then all of a sudden you're bugfixing the whole game."); LABEL_24: v1 = 1.9431574e-19; BYTE13(v41) = 0; HIWORD(v41) = 0; strcpy((char *)&v41, "The Mechanic"); v43 = 15; v42 = 12; v23 = 37; goto LABEL_25; } v15 = v14 - 1; if ( !v15 ) { v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x50u); v45 = 65; v46 = 79; strcpy((char *)v44, "Hmm so if I push here... maybe..."); v42 = 12; v43 = 15; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v31 = DialogObject::create((__int64)&v41, (__int64)&v44, 45, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v31); v47 = &v44; v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x20u); v45 = 27; v46 = 31; strcpy((char *)v44, "No, still broken..."); v42 = 12; v43 = 15; v1 = 1.9431574e-19; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v23 = 49; LABEL_25: v35 = DialogObject::create((__int64)&v41, (__int64)&v44, v23, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v35); goto LABEL_26; } v16 = v15 - 1; if ( !v16 ) { v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x40u); v45 = 62; v46 = 63; strcpy((char *)v44, "I have enough work as it is, can't go around helping everyone."); v42 = 12; v43 = 15; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v24 = DialogObject::create((__int64)&v41, (__int64)&v44, 51, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v24); v48 = -1; v49 = -1; v25 = cocos2d::CCString::createWithFormat( "Collect %i Diamonds so I know you're legit, then we can talk.", 2000); CString = cocos2d::CCString::getCString(v25); v41 = 0; v42 = 0; v43 = 0; v27 = -1; do ++v27; while ( CString[v27] ); sub_14003A930(&v41, CString, v27); v45 = 12; v46 = 15; strcpy((char *)&v44, "The Mechanic"); BYTE13(v44) = 0; HIWORD(v44) = 0; v28 = DialogObject::create((__int64)&v44, (__int64)&v41, 37, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v28); v47 = &v44; v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x40u); v45 = 53; v46 = 63; strcpy((char *)v44, "Who ordered this thing it doesn't even fit..."); v42 = 12; v43 = 15; v1 = 1.9431574e-19; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v29 = DialogObject::create((__int64)&v41, (__int64)&v44, 49, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v29); v30 = (GameManager *)qword_1406C2ED8; if ( !qword_1406C2ED8 ) { v47 = (__int128 *)operator new(0x668u); qword_1406C2ED8 = sub_14017AB00((__int64)v47); (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8); v30 = (GameManager *)qword_1406C2ED8; } GameManager::setUGV(v30, "36", 1); goto LABEL_26; } if ( v16 == 1 ) { v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x30u); v45 = 42; v46 = 47; strcpy((char *)v44, "Scanning user..."); v42 = 12; v43 = 15; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v17 = DialogObject::create((__int64)&v41, (__int64)&v44, 49, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v17); v48 = -1; v49 = -1; v18 = cocos2d::CCString::createWithFormat( "Scan complete.\nDiamonds: %i, Required: %i", Stat, 2000); v19 = cocos2d::CCString::getCString(v18); v41 = 0; v42 = 0; v43 = 0; v20 = -1; do ++v20; while ( v19[v20] ); sub_14003A930(&v41, v19, v20); v45 = 12; v46 = 15; strcpy((char *)&v44, "The Mechanic"); BYTE13(v44) = 0; HIWORD(v44) = 0; v21 = DialogObject::create((__int64)&v44, (__int64)&v41, 45, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v21); v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x30u); v45 = 40; v46 = 47; strcpy((char *)v44, "Hey who are you trying to fool?!"); v42 = 12; v43 = 15; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v22 = DialogObject::create((__int64)&v41, (__int64)&v44, 46, 1.0, 0, (__int64)&v48); cocos2d::CCArray::addObject(v3, (struct cocos2d::CCObject *)v22); v47 = &v44; v48 = -1; v49 = -1; v44 = 0; v45 = 0; v46 = 15; *(_QWORD *)&v44 = sub_14003AA10(0x60u); v45 = 92; v46 = 95; strcpy((char *)v44, "Come back when you have\ncollected more Diamonds..."); v42 = 12; v43 = 15; v1 = 1.9431574e-19; strcpy((char *)&v41, "The Mechanic"); BYTE13(v41) = 0; HIWORD(v41) = 0; v23 = 50; goto LABEL_25; } LABEL_26: if ( ++a1->m_mechanicDialogIndex > 4 ) a1->m_mechanicDialogIndex = 0; LABEL_28: DialogLayer = DialogLayer::createDialogLayer(nullptr, v3, 4); a1->addChild_0(a1, DialogLayer, 100); DialogLayer->setTag(DialogLayer, 4); if ( v7 ) { v37 = &a1->DialogDelegate; DialogLayer->m_delegate = &a1->DialogDelegate; } v38 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v37); cocos2d::CCDirector::getWinSize(v38); v39 = DialogLayer->m_mainLayer->__vftable; cocos2d::CCPoint::CCPoint(v1, *(float *)&v47 * 0.5); v39->setPosition_0(DialogLayer->m_mainLayer, v40); DialogLayer::animateInRandomSide(DialogLayer); }
GD Web Decomp Icon

GD Web Decomp

Raw Source