// // PlayLayer::init from 0x712068 to 0x7128c4 (2140 bytes) // // 2 xrefs: // > PlayLayer::create @ 0x713820 // > @ 0xe3aa0 // // This function is hookable on this platform (idp: arm, 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:52:14 +0000 // __int64 __fastcall PlayLayer::init(cocos2d::CCParticleSystem **this, GJGameLevel *a2, unsigned __int8 a3) { int v5; // w26 unsigned __int8 isPlatformer; // w20 unsigned int v7; // w24 cocos2d::CCDictionary *v9; // x0 cocos2d::CCObject *v10; // x0 cocos2d::CCDirector *v11; // x0 __int64 v12; // x0 GameManager *v13; // x0 GameManager *v14; // x0 GameManager *GameVariable; // x0 GameManager *v16; // x0 PlatformToolbox *v17; // x0 GameManager *v18; // x0 GameManager *v19; // x0 __int64 v20; // x25 GameManager *v21; // x0 GameManager *v22; // x0 __int64 v23; // x0 int v24; // w0 AppDelegate *v25; // x0 cocos2d::CCArray *v26; // x0 cocos2d::CCObject *v27; // x0 int v28; // w20 GravityEffectSprite *v29; // x0 cocos2d::CCArray *v30; // x21 cocos2d::CCObject *v31; // x0 cocos2d::CCObject *v32; // x0 GameManager *v33; // x0 GameManager *v34; // x0 GameManager *v35; // x0 cocos2d::CCDictionary *v36; // x0 cocos2d::CCObject *v37; // x0 cocos2d::CCDirector *v38; // x0 cocos2d::CCDirector *v39; // x0 cocos2d::CCArray *WinSize; // x0 cocos2d::CCObject *v41; // x0 cocos2d::CCArray *v42; // x0 cocos2d::CCObject *v43; // x0 cocos2d::CCArray *v44; // x0 cocos2d::CCObject *v45; // x0 cocos2d::CCArray *v46; // x0 cocos2d::CCObject *v47; // x0 int v48; // w0 int v49; // w2 __int64 v50; // x0 cocos2d::CCDirector **v51; // x21 void (__fastcall *v52)(cocos2d::CCDirector **, GameManager **); // x27 cocos2d::CCDirector *v53; // x0 cocos2d::CCDirector *ScreenScaleFactorW; // x0 float v55; // s0 float v56; // s9 cocos2d::CCDirector *v57; // x0 float v58; // s0 cocos2d::CCDrawNode *v59; // x0 cocos2d::CCDrawNode *v60; // x0 __int64 v61; // x0 char v62; // w1 __int64 v63; // x2 __int64 v64; // x0 __int64 v65; // x1 const char *v66; // x1 size_t v67; // x0 __int64 v68; // x2 int v69; // w0 size_t v70; // x0 int v71; // w0 __int64 v72; // x20 void (__fastcall *v73)(__int64, GameManager **); // x23 __int64 v74; // x27 GameManager *v75; // x0 char v76; // w1 GameManager *v77; // x0 unsigned __int64 v78; // x0 const char *v79; // x2 GameManager *v80; // x0 char v81; // w0 __int64 v82; // x0 __int64 v83; // x20 void (__fastcall *v84)(__int64, GameManager **); // x21 cocos2d::CCDirector **v85; // x20 void (__fastcall *v86)(cocos2d::CCDirector **, GameManager **); // x21 cocos2d::CCDirector *v87; // x0 float v88; // s0 char *v89; // [xsp+78h] [xbp+78h] __int64 v90; // [xsp+80h] [xbp+80h] BYREF int v91; // [xsp+88h] [xbp+88h] int v92; // [xsp+8Ch] [xbp+8Ch] GameManager *v93[2]; // [xsp+90h] [xbp+90h] BYREF __int64 v94; // [xsp+A0h] [xbp+A0h] BYREF size_t v95; // [xsp+A8h] [xbp+A8h] void *v96; // [xsp+B0h] [xbp+B0h] __int64 v97; // [xsp+B8h] [xbp+B8h] BYREF __int64 v98; // [xsp+C0h] [xbp+C0h] void *v99; // [xsp+C8h] [xbp+C8h] __int64 v100; // [xsp+D0h] [xbp+D0h] BYREF size_t v101; // [xsp+D8h] [xbp+D8h] void *v102; // [xsp+E0h] [xbp+E0h] v5 = a3; isPlatformer = GJBaseGameLayer::init((GJBaseGameLayer *)this); v7 = isPlatformer; if ( !isPlatformer ) return v7; *(this + 242) = a2; v9 = (cocos2d::CCDictionary *)cocos2d::CCObject::retain(a2); v10 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v9); *(this + 1780) = v10; v11 = (cocos2d::CCDirector *)cocos2d::CCObject::retain(v10); v12 = cocos2d::CCDirector::sharedDirector(v11); v13 = (GameManager *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 192LL))(v12); *((_BYTE *)v13 + 132) = 1; v14 = (GameManager *)GameManager::sharedState(v13); GameVariable = (GameManager *)(unsigned __int8)GameManager::getGameVariable(v14, "0128"); if ( (_BYTE)GameVariable ) { PlatformToolbox::toggleLockCursor((PlatformToolbox *)((char *)&dword_0 + 1)); } else { v16 = (GameManager *)GameManager::sharedState(GameVariable); v17 = (PlatformToolbox *)(unsigned __int8)GameManager::getGameVariable(v16, "0024"); if ( !(_BYTE)v17 ) PlatformToolbox::hideCursor(v17); } v18 = (GameManager *)(*((__int64 (__fastcall **)(cocos2d::CCParticleSystem **))*this + 199))(this); *(_BYTE *)(GameManager::sharedState(v18) + 1064) = 1; *((_BYTE *)this + 14024) = 0; *((_DWORD *)this + 3716) = 1; *((_BYTE *)this + 14184) = 0; PlayLayer::updateGameSettings((PlayLayer *)this); v19 = (GameManager *)*((unsigned __int8 *)a2 + 769); *((_BYTE *)this + 1976) = (_BYTE)v19; v20 = GameManager::sharedState(v19); v21 = (GameManager *)*((unsigned __int8 *)this + 1976); if ( !*((_BYTE *)this + 1976) || (v21 = (GameManager *)*((unsigned __int8 *)this + 1977), !*((_BYTE *)this + 1977)) ) v21 = (GameManager *)*(unsigned __int8 *)(GameManager::sharedState(v21) + 925); *(_BYTE *)(v20 + 926) = (_BYTE)v21; v22 = (GameManager *)GameManager::sharedState(v21); *((_BYTE *)v22 + 1025) = 1; v23 = *(unsigned __int8 *)(GameManager::sharedState(v22) + 601); if ( (_DWORD)v23 ) { v74 = GameManager::sharedState((GameManager *)v23); clock_gettime(0, (struct timespec *)v93); v75 = v93[0]; *(double *)(v74 + 464) = (double)(__int64)v93[0] + (double)(__int64)v93[1] / 1000000000.0 - 180.0 + 180.0; v23 = GameManager::sharedState(v75); *(_BYTE *)(v23 + 601) = 0; } if ( *(_BYTE *)(GameManager::sharedState((GameManager *)v23) + 923) ) { PlayLayer::stopRecording((PlayLayer *)this); *((_BYTE *)this + 12616) = 0; v24 = *((_DWORD *)a2 + 285); if ( v24 != 1 ) goto LABEL_13; LABEL_45: isPlatformer = 0; goto LABEL_16; } *((_BYTE *)this + 12616) = 0; v24 = *((_DWORD *)a2 + 285); if ( v24 == 1 ) goto LABEL_45; LABEL_13: if ( v24 != 2 && *((_DWORD *)a2 + 233) - *((_DWORD *)a2 + 234) != 1 ) isPlatformer = GJGameLevel::isPlatformer(a2); LABEL_16: *((_BYTE *)this + 12744) = isPlatformer; *((_DWORD *)this + 3053) = 0; GJBaseGameLayer::resetActiveEnterEffects((GJBaseGameLayer *)this); *((_DWORD *)this + 3656) = 0; *(this + 115) = nullptr; *((_DWORD *)this + 3580) = 0; *(this + 117) = nullptr; *(this + 116) = nullptr; *((_BYTE *)this + 12605) = 1; *((_BYTE *)this + 13336) = 0; *((_BYTE *)this + 1010) = 0; *((_DWORD *)this + 3594) = (unsigned int)&byte_4; v25 = (AppDelegate *)*(unsigned __int8 *)(AppDelegate::get((AppDelegate *)&byte_4) + 35); if ( (_DWORD)v25 || (v26 = (cocos2d::CCArray *)*(unsigned __int8 *)(AppDelegate::get(v25) + 36), (_DWORD)v26) ) { v26 = (cocos2d::CCArray *)((char *)&dword_0 + 2); *((_DWORD *)this + 3594) = (unsigned int)&dword_0 + 2; } v27 = (cocos2d::CCObject *)cocos2d::CCArray::create(v26); *(this + 1799) = v27; v28 = 0; cocos2d::CCObject::retain(v27); v29 = (GravityEffectSprite *)*((unsigned int *)this + 3594); if ( (int)v29 > 0 ) { do { v30 = *(this + 1799); v31 = (cocos2d::CCObject *)GravityEffectSprite::create(v29); ++v28; cocos2d::CCArray::addObject(v30, v31); v29 = (GravityEffectSprite *)*((unsigned int *)this + 3594); } while ( (int)v29 > v28 ); } v32 = (cocos2d::CCObject *)cocos2d::CCArray::create(v29); *(this + 1788) = v32; v33 = (GameManager *)cocos2d::CCObject::retain(v32); v34 = (GameManager *)GameManager::sharedState(v33); *((_BYTE *)v34 + 706) = 0; v35 = (GameManager *)GameManager::sharedState(v34); *((_QWORD *)v35 + 68) = this; v36 = (cocos2d::CCDictionary *)GameManager::sharedState(v35); *((_BYTE *)v36 + 705) = 0; v37 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v36); *(this + 1848) = v37; v38 = (cocos2d::CCDirector *)cocos2d::CCObject::retain(v37); v39 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v38); WinSize = (cocos2d::CCArray *)cocos2d::CCDirector::getWinSize(&v90, v39); v41 = (cocos2d::CCObject *)cocos2d::CCArray::create(WinSize); *(this + 1781) = v41; v42 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v41); v43 = (cocos2d::CCObject *)cocos2d::CCArray::create(v42); *(this + 1782) = v43; v44 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v43); v45 = (cocos2d::CCObject *)cocos2d::CCArray::create(v44); *(this + 1787) = v45; v46 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v45); v47 = (cocos2d::CCObject *)cocos2d::CCArray::create(v46); *(this + 1785) = v47; cocos2d::CCObject::retain(v47); GJBaseGameLayer::setupLayers((GJBaseGameLayer *)this); v48 = rand(); v49 = (int)(float)(roundf((float)((float)v48 * 4.6566e-10) + (float)((float)v48 * 4.6566e-10)) + 1.0); *((_DWORD *)this + 3579) = v49; v50 = cocos2d::CCParticleSystemQuad::create((cocos2d::CCParticleSystemQuad *)"glitterEffect.plist", nullptr, v49); *(this + 1580) = (cocos2d::CCParticleSystem *)v50; (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v50 + 1568LL))(v50, 1); (*(void (__fastcall **)(_QWORD, _QWORD, _QWORD))(*(_QWORD *)*(this + 490) + 464LL))(*(this + 490), *(this + 1580), 0); v51 = (cocos2d::CCDirector **)*(this + 1580); v52 = *((void (__fastcall **)(cocos2d::CCDirector **, GameManager **))*v51 + 120); v53 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v51); ScreenScaleFactorW = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenScaleFactorW(v53); v56 = v55; v57 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenScaleFactorW); cocos2d::CCDirector::getScreenScaleFactorH(v57); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v93, (float)(v56 * 480.0) / 1.8, (float)(v58 * 320.0) * 0.5); v52(v51, v93); v59 = (cocos2d::CCDrawNode *)cocos2d::CCParticleSystem::stopSystem(*(this + 1580)); *(this + 1727) = (cocos2d::CCParticleSystem *)cocos2d::CCDrawNode::create(v59); v91 = 770; v92 = 771; cocos2d::CCDrawNode::setBlendFunc(); (*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 1727) + 72LL))(*(this + 1727), 4294957297LL); v60 = (cocos2d::CCDrawNode *)(*(__int64 (__fastcall **)(_QWORD, _QWORD, __int64))(*(_QWORD *)*(this + 492) + 464LL))( *(this + 492), *(this + 1727), 1401); *(this + 1728) = (cocos2d::CCParticleSystem *)cocos2d::CCDrawNode::create(v60); cocos2d::CCDrawNode::setBlendFunc(); (*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*(this + 1727) + 456LL))(*(this + 1727), *(this + 1728)); PlayLayer::updateDebugDrawSettings((PlayLayer *)this); GJBaseGameLayer::createPlayer((GJBaseGameLayer *)this); v61 = (__int64)*(this + 242); if ( *(_DWORD *)(v61 + 1140) == 2 ) { v77 = (GameManager *)GameManager::sharedState((GameManager *)v61); v78 = (unsigned __int8)GameManager::getGameVariable(v77, "0174"); if ( !(_BYTE)v78 ) { v82 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Ignore Damage", "bigFont.fnt", v79); *(this + 1775) = (cocos2d::CCParticleSystem *)v82; (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v82 + 1024LL))(v82, 50); (*(void (__fastcall **)(_QWORD, float))(*(_QWORD *)*(this + 1775) + 160LL))(*(this + 1775), 0.4); (*((void (__fastcall **)(cocos2d::CCParticleSystem **, _QWORD, __int64))*this + 58))(this, *(this + 1775), 1000); v83 = (__int64)*(this + 1775); v84 = *(void (__fastcall **)(__int64, GameManager **))(*(_QWORD *)v83 + 296LL); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v93, 0.0, 1.0); v84(v83, v93); v85 = (cocos2d::CCDirector **)*(this + 1775); v86 = *((void (__fastcall **)(cocos2d::CCDirector **, GameManager **))*v85 + 23); v87 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v85); cocos2d::CCDirector::getScreenTop(v87); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v93, 5.0, (float)(v88 - 5.0) + 1.0); v86(v85, v93); v78 = (*(__int64 (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*(this + 1775) + 344LL))(*(this + 1775), 0); } v80 = (GameManager *)GameManager::sharedState((GameManager *)v78); v81 = GameManager::getGameVariable(v80, "0173"); PlayLayer::toggleIgnoreDamage((PlayLayer *)this, v81); v61 = (__int64)*(this + 242); } *((_BYTE *)this + 14064) = 1; v97 = 0; v62 = *(_BYTE *)(v61 + 392); v63 = v61 + 392; v98 = 0; v99 = nullptr; if ( (v62 & 1) != 0 ) { std::string::__init(&v97, *(void **)(v61 + 408), *(_QWORD *)(v61 + 400)); } else { v64 = *(_QWORD *)v63; v65 = *(_QWORD *)(v63 + 8); v99 = *(void **)(v63 + 16); v97 = v64; v98 = v65; } v66 = (char *)&v97 + 1; if ( (v97 & 1) != 0 ) v66 = (const char *)v99; v89 = (char *)v66; v100 = 0; v101 = 0; v102 = nullptr; v67 = strlen(v66); std::string::__init(&v100, v89, v67); cocos2d::ZipUtils::decompressString(&v94, &v100, 0, 11); if ( (v100 & 1) != 0 ) operator delete(v102); if ( (v97 & 1) != 0 ) { operator delete(v99); v68 = (__int64)*(this + 242); v69 = *(_DWORD *)(v68 + 1140); if ( v69 != 1 ) goto LABEL_29; LABEL_48: v100 = 0; v101 = 0; v102 = nullptr; if ( (v94 & 1) != 0 ) { std::string::__init(&v100, v96, v95); v68 = (__int64)*(this + 242); } else { v100 = v94; v101 = v95; v102 = v96; } LOBYTE(v71) = LevelTools::verifyLevelIntegrity( &v100, (unsigned int)(*(_DWORD *)(v68 + 328) - *(_DWORD *)(v68 + 332))); v76 = v100; *((_BYTE *)this + 14064) = v71; v71 = (unsigned __int8)v71; if ( (v76 & 1) != 0 ) { operator delete(v102); v71 = *((unsigned __int8 *)this + 14064); } goto LABEL_33; } v68 = (__int64)*(this + 242); v69 = *(_DWORD *)(v68 + 1140); if ( v69 == 1 ) goto LABEL_48; LABEL_29: if ( v69 == 2 && *(_DWORD *)(v68 + 948) - *(_DWORD *)(v68 + 952) <= 0 ) { v71 = *((unsigned __int8 *)this + 14064); } else { if ( (v94 & 1) != 0 ) v70 = v95; else v70 = (unsigned __int8)v94 >> 1; v71 = v70 != 0; *((_BYTE *)this + 14064) = v71; } LABEL_33: if ( !v71 ) { v72 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Load Failed!", "bigFont.fnt", (const char *)v68); (*((void (__fastcall **)(cocos2d::CCParticleSystem **, __int64, __int64))*this + 58))(this, v72, 100); v73 = *(void (__fastcall **)(__int64, GameManager **))(*(_QWORD *)v72 + 184LL); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v93, *(float *)&v90 * 0.5, *((float *)&v90 + 1) * 0.5); v73(v72, v93); } PlayLayer::prepareCreateObjectsFromSetup((__int64)this, (unsigned __int8 *)&v94); if ( !v5 ) { while ( *((float *)this + 3137) < 1.0 ) PlayLayer::processCreateObjectsFromSetup((PlayLayer *)this); } if ( (v94 & 1) != 0 ) operator delete(v96); return v7; }
GD Web Decomp Icon

GD Web Decomp

Raw Source