// // LevelAreaLayer::init from 0x1403dd680 to 0x1403de576 (3830 bytes) // // 6 xrefs: // > LevelAreaLayer::scene @ 0x1403dd63e // > LevelAreaLayer::scene @ 0x1403dd645 // > LevelAreaLayer::scene @ 0x1403dd62f // > @ 0x140787ff8 // > @ 0x140924d28 // > @ 0x140924d34 // // 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:31:40 +0000 // // Hidden C++ exception states: #wind=7 bool __fastcall LevelAreaLayer::init(__int64 a1) { bool result; // al __int64 v3; // rcx __int64 v4; // rcx cocos2d::CCObject *v5; // rax cocos2d::CCTextureCache *v6; // rax __int64 v7; // rdx __int64 v8; // rcx cocos2d::CCSpriteFrameCache *v9; // rax __int64 v10; // rdx __int64 v11; // rdx __int64 v12; // rcx __int64 v13; // rax int v14; // eax cocos2d::CCObject *v15; // rsi struct cocos2d::CCMenu *v16; // rdi __int64 v17; // rbx __int64 v18; // rcx cocos2d::CCDirector *v19; // rax float v20; // xmm6_4 __int64 v21; // rcx cocos2d::CCDirector *v22; // rax float v23; // xmm0_4 __int64 v24; // rax __int64 v25; // rcx __int64 v26; // rcx cocos2d::CCString *v27; // rax const char *CString; // rax struct cocos2d::CCSprite *v29; // rdi cocos2d::CCTexture2D *v30; // rax __int64 v31; // rbx __int64 v32; // rax __int64 v33; // rbx __int64 v34; // rax cocos2d::CCNode *v35; // rdi __int64 v36; // rbx __int64 v37; // rax struct cocos2d::CCActionInterval *v38; // rax struct cocos2d::CCFiniteTimeAction *v39; // rbx struct cocos2d::CCActionInterval *v40; // rax struct cocos2d::CCEaseInOut *v41; // rax struct cocos2d::CCActionInterval *v42; // rax struct cocos2d::CCAction *v43; // rax struct cocos2d::CCSprite *v44; // rax __int64 v45; // rdi __int64 v46; // rbx __int64 v47; // rax struct cocos2d::CCSprite *v48; // r15 void **v49; // rsi struct cocos2d::CCMenu *v50; // rdi __int64 v51; // rax __int64 v52; // rbx __int64 v53; // rax void (__fastcall **v54)(void **, _QWORD); // rbx __int64 v55; // rax int v56; // r15d struct cocos2d::CCSprite *v57; // rdi char *v58; // rsi float v59; // xmm1_4 __int64 v60; // rbx __int64 v61; // rax __int64 v62; // rdx struct cocos2d::CCSprite *v63; // rdi char *v64; // rsi __int64 v65; // rbx __int64 v66; // rax __int64 v67; // rdx __int64 v68; // rax __int64 v69; // rbx __int64 v70; // rax const struct cocos2d::CCPoint *v71; // rax struct cocos2d::CCActionInterval *v72; // rax struct cocos2d::CCFiniteTimeAction *v73; // rbx const struct cocos2d::CCPoint *v74; // rax struct cocos2d::CCActionInterval *v75; // rax struct cocos2d::CCEaseInOut *v76; // rax struct cocos2d::CCActionInterval *v77; // rax struct cocos2d::CCAction *v78; // rax __int64 v79; // rax int v80; // edx int v81; // r8d int v82; // r9d __int64 v83; // rax int v84; // edx int v85; // r8d int v86; // r9d __int64 v87; // rax int v88; // edx int v89; // r8d int v90; // r9d __int64 v91; // rax int v92; // edx int v93; // r8d int v94; // r9d __int64 v95; // rax int v96; // edx int v97; // r8d int v98; // r9d __int64 v99; // rax int v100; // edx int v101; // r8d int v102; // r9d struct cocos2d::CCParticleSystemQuad *v103; // rdi void *v104; // rcx __int64 v105; // rbx __int64 v106; // rax __int64 v107; // rax __int64 v108; // rbx float v109; // xmm6_4 float *v110; // rax __int64 v111; // rbx int v112; // eax int v113; // r9d __int64 v114; // rcx __int64 v115; // rbx struct cocos2d::CCFiniteTimeAction *v116; // rax struct cocos2d::CCAction *v117; // rax __int64 v118; // [rsp+48h] [rbp-C0h] BYREF __int64 v119; // [rsp+50h] [rbp-B8h] BYREF _QWORD *v120; // [rsp+58h] [rbp-B0h] BYREF float v121; // [rsp+60h] [rbp-A8h] BYREF float v122; // [rsp+64h] [rbp-A4h] __int64 v123; // [rsp+68h] [rbp-A0h] BYREF void *Src; // [rsp+70h] [rbp-98h] BYREF _QWORD Src_8[4]; // [rsp+78h] [rbp-90h] BYREF void *Block[2]; // [rsp+98h] [rbp-70h] BYREF __int64 v127; // [rsp+A8h] [rbp-60h] unsigned __int64 v128; // [rsp+B0h] [rbp-58h] _DWORD v129[4]; // [rsp+B8h] [rbp-50h] BYREF unsigned int v130[66]; // [rsp+C8h] [rbp-40h] BYREF char v131[40]; // [rsp+1D0h] [rbp+C8h] BYREF result = cocos2d::CCLayer::init((cocos2d::CCLayer *)a1); if ( result ) { v119 = (__int64)Block; v127 = 11; v128 = 15; Block[0] = (void *)0x2E31307265776F74LL; Block[1] = (void *)3371117; if ( !qword_14090BFD0 ) { Src = operator new(0x6E8u); qword_14090BFD0 = GameManager::GameManager((__int64)Src); (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0); } GameManager::fadeInMusic(v3, (__int64)Block); v5 = (cocos2d::CCObject *)cocos2d::CCArray::create(v4); *(_QWORD *)(a1 + 424) = v5; cocos2d::CCObject::retain(v5); v6 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(); cocos2d::CCTextureCache::addImage(v6, "TowerSheet.png", 0); v9 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v8, v7); cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v9, "TowerSheet.plist"); LOBYTE(v10) = 1; (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 992LL))(a1, v10); LOBYTE(v11) = 1; (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1008LL))(a1, v11); v13 = cocos2d::CCDirector::sharedDirector(v12); cocos2d::CCDirector::getWinSize(v13, &v121); v14 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_03_001.png"); v15 = CCMenuItemSpriteExtra::create(v14, 0, a1, (__int64)LevelAreaLayer::onBack); *((_DWORD *)v15 + 93) = 1070386381; v16 = cocos2d::CCMenu::create(v15, 0); (*(void (__fastcall **)(__int64, struct cocos2d::CCMenu *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v16, 1); v17 = *(_QWORD *)v16; v19 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v18); v20 = cocos2d::CCDirector::getScreenTop(v19) - 23.0; v22 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v21); v23 = cocos2d::CCDirector::getScreenLeft(v22) + 24.0; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v119, v23, v20); (*(void (__fastcall **)(struct cocos2d::CCMenu *, __int64))(v17 + 184))(v16, v24); if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v25) + 209) ) GameToolbox::addBackButton(a1, (__int64)v15); v26 = qword_14090BFD0; if ( !qword_14090BFD0 ) { v119 = (__int64)operator new(0x6E8u); qword_14090BFD0 = GameManager::GameManager(v119); (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0); v26 = qword_14090BFD0; } GameManager::loadBackground(v26, 23); v27 = cocos2d::CCString::createWithFormat("game_bg_%02d_001.png", 23); CString = cocos2d::CCString::getCString(v27); v29 = cocos2d::CCSprite::create(CString); v129[0] = 9729; v129[1] = 9729; v129[2] = 10497; v129[3] = 10497; v30 = (cocos2d::CCTexture2D *)(*(__int64 (__fastcall **)(__int64))(*((_QWORD *)v29 + 43) + 16LL))((__int64)v29 + 344); cocos2d::CCTexture2D::setTexParameters(v30, (struct cocos2d::_ccTexParams *)v129); (*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))( a1, v29, 4294967293LL); v31 = *(_QWORD *)v29; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v119, 0.0, 0.0); (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v31 + 288))(v29, v32); (*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v29 + 160LL))(v29); v33 = *(_QWORD *)v29; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v119, 0.0, -50.0); (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v33 + 184))(v29, v34); LOWORD(v118) = 15360; BYTE2(v118) = -76; (**((void (__fastcall ***)(__int64, __int64 *))v29 + 40))((__int64)v29 + 320, &v118); LODWORD(Src) = 16776960; LODWORD(v118) = -1761607936; v35 = cocos2d::CCLayerGradient::create( (const struct cocos2d::_ccColor4B *)&v118, (const struct cocos2d::_ccColor4B *)&Src); v119 = 0x100000302LL; v36 = *(_QWORD *)v35; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 0.0, 1.0); (*(void (__fastcall **)(cocos2d::CCNode *, __int64))(v36 + 288))(v35, v37); (**((void (__fastcall ***)(__int64, __int64))v35 + 54))((__int64)v35 + 432, v119); *((_BYTE *)v35 + 561) = 1; (*(void (__fastcall **)(cocos2d::CCNode *))(*(_QWORD *)v35 + 136LL))(v35); (*(void (__fastcall **)(cocos2d::CCNode *))(*(_QWORD *)v35 + 1048LL))(v35); (*(void (__fastcall **)(__int64, cocos2d::CCNode *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v35, 2); v38 = cocos2d::CCFadeTo::create(3.0, 0xFFu); v39 = cocos2d::CCEaseInOut::create(v38, 2.0); v40 = cocos2d::CCFadeTo::create(3.0, 0x96u); v41 = cocos2d::CCEaseInOut::create(v40, 2.0); v42 = cocos2d::CCSequence::create(v39, v41, 0); v43 = cocos2d::CCRepeatForever::create(v42); cocos2d::CCNode::runAction(v35, v43); v44 = cocos2d::CCSprite::createWithSpriteFrameName("theTower_01_001.png"); *(_QWORD *)(a1 + 416) = v44; (*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v44, 1); (*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 416) + 160LL))(*(_QWORD *)(a1 + 416)); v45 = **(_QWORD **)(a1 + 416); v46 = *(_QWORD *)(a1 + 416); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, v121 * 0.5, v122 * 0.5); (*(void (__fastcall **)(__int64, __int64))(v45 + 184))(v46, v47); v48 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png"); (*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v48 + 120LL))(v48); (*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v48 + 136LL))(v48); v49 = (void **)CCMenuItemSpriteExtra::create((int)v48, 0, a1, (__int64)LevelAreaLayer::onClickDoor); Src_8[1] = 26471; Src_8[2] = 10; Src_8[3] = 15; Src_8[0] = 0x6F2E3230726F6F64LL; v120 = Src_8; if ( v49 + 52 != Src_8 ) sub_1400405A0(v49 + 52, Src_8, 0xAu); sub_14003D310((__int64)Src_8); v50 = cocos2d::CCMenu::create((struct cocos2d::CCMenuItem *)v49, 0); (*(void (__fastcall **)(__int64, struct cocos2d::CCMenu *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v50, 10); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 0.0, -75.0); v52 = v51; v53 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 416) + 200LL))(*(_QWORD *)(a1 + 416)); cocos2d::CCPoint::operator+(v53, &v119, v52); v54 = (void (__fastcall **)(void **, _QWORD))*v49; cocos2d::CCNode::convertToNodeSpace(v50, &Src, &v119); v54[23](v49, v55); (*(void (__fastcall **)(__int64, _QWORD))(*((_QWORD *)v48 + 40) + 40LL))((__int64)v48 + 320, 0); v56 = 0; LOWORD(v118) = 0; do { v57 = cocos2d::CCSprite::createWithSpriteFrameName("godray01_001.png"); v58 = (char *)v57 + 320; (**((void (__fastcall ***)(__int64, int *))v57 + 40))((__int64)v57 + 320, &dword_140703B80); (*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))( a1, v57, 0xFFFFFFFFLL); (*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v57 + 120LL))(v57); (*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v57 + 136LL))(v57); (*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v57 + 352LL))(v57); if ( v56 ) v59 = v121; else v59 = 0.0; v60 = *(_QWORD *)v57; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, v59, v122 * 0.5); (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v60 + 184))(v57, v61); LOBYTE(v62) = 125; (*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v58 + 40LL))(v58, v62); LOWORD(v118) = 0; BYTE2(v118) = 50; (**(void (__fastcall ***)(char *, __int64 *))v58)(v58, &v118); ++v56; } while ( v56 < 2 ); v63 = cocos2d::CCSprite::createWithSpriteFrameName("godray01_001.png"); v64 = (char *)v63 + 320; (**((void (__fastcall ***)(__int64, int *))v63 + 40))((__int64)v63 + 320, &dword_140703B80); (*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))( a1, v63, 0xFFFFFFFFLL); (*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v63 + 120LL))(v63); (*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v63 + 136LL))(v63); v65 = *(_QWORD *)v63; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, v121 * 0.5, 0.0); (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v65 + 184))(v63, v66); LOBYTE(v67) = 125; (*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v64 + 40LL))(v64, v67); LOWORD(v118) = 0; BYTE2(v118) = 50; (**(void (__fastcall ***)(char *, __int64 *))v64)(v64, &v118); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 0.0, -2.0); v69 = v68; v70 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 416) + 200LL))(*(_QWORD *)(a1 + 416)); cocos2d::CCPoint::operator+(v70, &v119, v69); (*(void (__fastcall **)(_QWORD, __int64 *))(**(_QWORD **)(a1 + 416) + 184LL))(*(_QWORD *)(a1 + 416), &v119); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 0.0, 4.0); v72 = cocos2d::CCMoveBy::create(2.0, v71); v73 = cocos2d::CCEaseInOut::create(v72, 2.0); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 0.0, -4.0); v75 = cocos2d::CCMoveBy::create(2.0, v74); v76 = cocos2d::CCEaseInOut::create(v75, 2.0); v77 = cocos2d::CCSequence::create(v73, v76, 0); v78 = cocos2d::CCRepeatForever::create(v77); cocos2d::CCNode::runAction(*(cocos2d::CCNode **)(a1 + 416), v78); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v123, v121 * 0.5, (float)(v122 * 0.5) + 13.0); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 0.0, 0.0); cocos2d::CCPoint::operator+(&v123, &v119, v79); LevelAreaLayer::addGodRay(a1, v80, v81, v82, 1084227584, 1082130432, (__int64)&v119); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 0.0, 10.0); cocos2d::CCPoint::operator+(&v123, &v119, v83); LevelAreaLayer::addGodRay(a1, v84, v85, v86, 1077936128, 1075838976, (__int64)&v119); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 0.0, 20.0); cocos2d::CCPoint::operator+(&v123, &v119, v87); LevelAreaLayer::addGodRay(a1, v88, v89, v90, 1082130432, 1077936128, (__int64)&v119); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 0.0, -20.0); cocos2d::CCPoint::operator+(&v123, &v119, v91); LevelAreaLayer::addGodRay(a1, v92, v93, v94, 1086324736, 1075838976, (__int64)&v119); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 0.0, -10.0); cocos2d::CCPoint::operator+(&v123, &v119, v95); LevelAreaLayer::addGodRay(a1, v96, v97, v98, 1084227584, 1080033280, (__int64)&v119); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 0.0, 10.0); cocos2d::CCPoint::operator+(&v123, &v119, v99); LevelAreaLayer::addGodRay(a1, v100, v101, v102, 1083179008, 1075838976, (__int64)&v119); *(_OWORD *)Block = 0; v127 = 0; v128 = 0; Block[0] = sub_14003D460(0xA0u); v127 = 159; v128 = 159; strcpy( (char *)Block[0], "60a-1a8a2a6a90a90a0a2a45a70a0a0a0a0a0a0a1a0a0a0a1a0a0.886275a0a0a0a0a0.7a1a0a0a0a1a0a0.552941a0a0a0a0a0.7a2a0a2a0a" "0a0a0a0a0a0a0a2a1a0a0a0a0a0a0a0a0a0a0a0a0a0a0"); if ( v127 ) { sub_14006BF90((__int64)v130); GameToolbox::particleStringToStruct((__int64 *)Block, (__int64)v130); v103 = GameToolbox::particleFromStruct(v130, nullptr, 0); sub_14003D310((__int64)v131); } else { v103 = nullptr; } if ( v128 > 0xF ) { v104 = Block[0]; if ( v128 + 1 >= 0x1000 ) { v104 = *((void **)Block[0] - 1); if ( (unsigned __int64)((char *)Block[0] - (char *)v104 - 8) > 0x1F ) invoke_watson(nullptr, nullptr, nullptr, 0, 0); } j_j_free(v104); } v127 = 0; v128 = 15; LOBYTE(Block[0]) = 0; (*(void (__fastcall **)(__int64, struct cocos2d::CCParticleSystemQuad *, _QWORD))(*(_QWORD *)a1 + 456LL))( a1, v103, 0); (*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v103 + 352LL))(v103); v105 = *(_QWORD *)v103; cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, 100.0, 40.0); (*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, __int64))(v105 + 952))(v103, v106); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, -100.0, 60.0); cocos2d::CCPoint::operator+(&v123, &v119, v107); (*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *, __int64 *))(*(_QWORD *)v103 + 184LL))(v103, &v119); v108 = 20; do { (*(void (__fastcall **)(struct cocos2d::CCParticleSystemQuad *))(*(_QWORD *)v103 + 32LL))(v103); --v108; } while ( v108 ); v109 = (float)(*(float *)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 416) + 320LL))(*(_QWORD *)(a1 + 416)) + 4) * 0.5) - 69.5; v110 = (float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 416) + 320LL))(*(_QWORD *)(a1 + 416)); v111 = *(_QWORD *)(a1 + 416); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v120, (float)(*v110 * 0.5) + 35.0, v109); LevelAreaLayer::addTorch(v111, v112, 1, v113, 6, 0, 0, 0); v114 = qword_14090BFD0; if ( !qword_14090BFD0 ) { v119 = (__int64)operator new(0x6E8u); qword_14090BFD0 = GameManager::GameManager(v119); (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0); v114 = qword_14090BFD0; } if ( !GameManager::getUGV(v114, &word_14075A858) ) { *(_BYTE *)(a1 + 432) = 1; v115 = cocos2d::CCCallFunc::create(a1, LevelAreaLayer::showDialog); v116 = cocos2d::CCDelayTime::create(1.2); v117 = cocos2d::CCSequence::create(v116, v115, 0); cocos2d::CCNode::runAction((cocos2d::CCNode *)a1, v117); } return 1; } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source