// // PlayLayer::resetLevel from 0x711020 to 0x711d28 (3336 bytes) // // 2 xrefs: // > @ 0x48700 // > @ 0x1428a88 // // 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:13 +0000 // __int64 __fastcall PlayLayer::resetLevel(PlayLayer *this) { char *v1; // x24 __int64 v3; // x0 __int64 v4; // x0 unsigned __int64 v5; // x0 char v6; // w0 __int64 v7; // x0 __int64 v8; // x0 __int64 v9; // x21 float v10; // s0 void (__fastcall *v11)(__int64, struct timeval *); // x19 UILayer *v12; // x0 double v13; // d0 __int64 v14; // x2 unsigned int v15; // w21 __int64 v16; // x19 int v17; // w2 double v18; // d0 int v19; // w0 double v20; // d0 int v21; // w1 int v22; // w0 int v23; // w0 float v24; // s12 __int64 v25; // x2 CheckpointObject *LastCheckpoint; // x21 char *v27; // x1 size_t v28; // x2 int v29; // w0 __int64 v30; // x1 CheckpointObject *v31; // x23 __int64 v32; // x22 const cocos2d::CCPoint *v33; // x0 long double v34; // q0 __int64 v35; // x22 const cocos2d::CCPoint *v36; // x0 __n128 v37; // q0 __int64 v38; // x1 void (__fastcall *v39)(PlayLayer *, __int64, _QWORD, struct timeval *, _QWORD, _QWORD, double); // x6 __int64 v40; // x1 GameManager *v41; // x0 int IntGameVariable; // w0 int v43; // w2 GJGameLevel *v44; // x19 int v45; // w0 char v46; // w0 __int64 *updated; // x0 GameStatsManager *v48; // x0 _DWORD *v49; // x22 int v50; // w19 float v51; // s0 unsigned int v52; // w23 __int64 started; // x0 int v54; // w27 char v55; // w0 char v56; // w0 clock_t v57; // x0 __int64 v58; // x2 unsigned int *v59; // x1 cocos2d::CCNode **v60; // x19 cocos2d::CCNode **v61; // x26 cocos2d::CCNode *v62; // x0 unsigned __int64 v63; // x0 FMOD::ChannelControl **v65; // x0 float v66; // s12 char isJumpButtonPressed; // w0 __int64 v68; // x27 __int64 v69; // x0 GameObject *v70; // x22 const cocos2d::CCPoint *v71; // x0 GameObject *v72; // x22 const cocos2d::CCPoint *v73; // x0 StartPosObject *v74; // x1 __int64 *v75; // x0 __int64 v76; // x1 __int64 v77; // x0 cocos2d::CCSequence *v78; // x19 cocos2d::CCFiniteTimeAction *v79; // x0 cocos2d::CCAction *v80; // x0 int v81; // [xsp+88h] [xbp+88h] __int64 v82; // [xsp+98h] [xbp+98h] BYREF __int64 v83; // [xsp+A0h] [xbp+A0h] BYREF __int64 v84[2]; // [xsp+A8h] [xbp+A8h] BYREF void *v85; // [xsp+B8h] [xbp+B8h] struct timeval tv; // [xsp+C0h] [xbp+C0h] BYREF __int64 v87; // [xsp+D0h] [xbp+D0h] v1 = (char *)this + 12288; if ( *((_BYTE *)this + 14524) ) { if ( !*((_QWORD *)this + 243) && !*((_QWORD *)this + 244) ) PlayLayer::dtRebuildLiveMarkers(this); } else { v3 = *((_QWORD *)this + 243); if ( v3 ) { (*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 520LL))(v3); *((_QWORD *)this + 243) = 0; } v4 = *((_QWORD *)this + 244); if ( v4 ) { (*(void (__fastcall **)(__int64))(*(_QWORD *)v4 + 520LL))(v4); *((_QWORD *)this + 244) = 0; } } if ( v1[329] || (v5 = *((unsigned __int8 *)this + 12238), !*((_BYTE *)this + 12238)) && (v5 = (unsigned __int8)v1[256], !v1[256]) ) { if ( v1[1897] ) { v6 = *((_BYTE *)this + 1978); if ( !v6 ) { v1[1897] = 0; PlayLayer::toggleIgnoreDamage(this, 0); LABEL_12: v1[1898] = *((float *)this + 3278) != 1.0; PlayLayer::updateTestModeLabel(this); v5 = (unsigned __int8)v1[329]; if ( v1[329] ) goto LABEL_13; goto LABEL_103; } } else { v6 = *((_BYTE *)this + 1978); } v1[1897] = v6; goto LABEL_12; } LABEL_103: v65 = (FMOD::ChannelControl **)FMODAudioEngine::sharedEngine((FMODAudioEngine *)v5); FMODAudioEngine::stopAllEffects(v65); if ( !v1[256] || v1[257] ) { if ( *((_BYTE *)this + 12238) ) { v69 = FMODAudioEngine::sharedEngine((FMODAudioEngine *)*((unsigned __int8 *)this + 12238)); FMODAudioEngine::pauseAllMusic(v69, 0); } else { GJBaseGameLayer::pauseAudio(this); } } LABEL_13: GJBaseGameLayer::preResumeGame(this); dwTickStartp = clock(); GJBaseGameLayer::resetLevelVariables(this); GJBaseGameLayer::clearHitboxTrail(this); if ( (v1[1554] || v1[1556]) && !(unsigned __int8)PlayLayer::shouldDebugDraw(this) ) PlayLayer::toggleDebugDraw((cocos2d::CCDrawNode **)this); *((_DWORD *)this + 236) = 0; *((_DWORD *)this + 238) = 0; *((_DWORD *)this + 3205) = 0; v1[137] = 1; *((_BYTE *)this + 1982) = 0; *((_QWORD *)this + 1859) = 0; v1[2580] = 0; *((_DWORD *)this + 3204) = 0; *((_DWORD *)this + 3196) = 0; if ( !v1[160] || (v7 = *((_QWORD *)this + 1601)) == 0 ) { gettimeofday(&tv, nullptr); v7 = tv.tv_usec * tv.tv_sec; } *((_QWORD *)this + 1599) = v7; GameToolbox::fast_srand(v7); *((_DWORD *)this + 3182) = 0; v1[1734] = 0; *((_DWORD *)this + 3504) = 0; UILayer::toggleMenuVisibility(*((UILayer **)this + 1661), 1u); v1[2350] = 0; v1[2349] = 0; v1[1048] = 0; v8 = *((_QWORD *)this + 1576); if ( v8 ) { v1[1944] = 0; *(_BYTE *)(v8 + 1360) = 0; *(_BYTE *)(*((_QWORD *)this + 1576) + 1361LL) = 0; (*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 1576) + 128LL))(*((_QWORD *)this + 1576), 1.0); v9 = *((_QWORD *)this + 1576); v10 = *((float *)this + 3559); *((float *)this + 3150) = v10; v11 = *(void (__fastcall **)(__int64, struct timeval *))(*(_QWORD *)v9 + 1368LL); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&tv, v10, 225.0); v11(v9, &tv); GJBaseGameLayer::reorderObjectSection(this, *((GameObject **)this + 1576)); (*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 1576) + 1312LL))(*((_QWORD *)this + 1576), 1); } v1[2356] = 0; *((_DWORD *)this + 3662) = 0; *((_DWORD *)this + 3663) = 0; v1[2368] = 0; v1[2340] = 0; std::string::assign((__int64 *)v1 + 58, &byte_11B8890); *((_DWORD *)this + 3595) = 0; v12 = *((UILayer **)this + 1661); *((_DWORD *)this + 3686) = 0; UILayer::enableMenu(v12); GJBaseGameLayer::resetActiveEnterEffects(this); v13 = *((double *)this + 1838); if ( v13 > *((double *)this + 1839) ) *((double *)this + 1839) = v13; v14 = *(_QWORD *)this; *((_DWORD *)this + 3052) = 0; v15 = 0; *((_QWORD *)this + 1838) = 0; *((_QWORD *)this + 1809) = 0; *((_QWORD *)this + 1841) = 0; *((_QWORD *)this + 1842) = 0; (*(void (__fastcall **)(PlayLayer *, _QWORD))(v14 + 1288))(this, 0); if ( (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 410)) ) { while ( 1 ) { v16 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 410), v15); (*(void (__fastcall **)(__int64 *__return_ptr))(*(_QWORD *)v16 + 1360LL))(&v82); (*(void (__fastcall **)(__int64))(*(_QWORD *)v16 + 1288LL))(v16); v17 = *(_DWORD *)(v16 + 628); if ( v17 < 0 ) goto LABEL_38; v18 = *(double *)(v16 + 944); if ( v18 <= 0.0 ) break; if ( v18 >= 10000000.0 ) { v19 = (int)(float)(*((float *)this + 3408) * 10000000.0); goto LABEL_29; } v19 = (int)(v18 * *((float *)this + 3408)); v20 = *(double *)(v16 + 952); if ( v20 <= 0.0 ) { LABEL_112: v21 = 0; LABEL_32: if ( v19 != v17 ) goto LABEL_33; goto LABEL_109; } LABEL_30: if ( v20 >= 10000000.0 ) { v21 = (int)(float)(*((float *)this + 3409) * 10000000.0); goto LABEL_32; } v21 = (int)(v20 * *((float *)this + 3409)); if ( v19 != v17 ) goto LABEL_33; LABEL_109: if ( v21 != *(_DWORD *)(v16 + 632) ) { LABEL_33: GJBaseGameLayer::reorderObjectSection(this, (GameObject *)v16); v22 = *(_DWORD *)(v16 + 628); if ( v22 > *((_DWORD *)this + 3056) || v22 < *((_DWORD *)this + 3055) || (v23 = *(_DWORD *)(v16 + 632), v23 > *((_DWORD *)this + 3058)) || v23 < *((_DWORD *)this + 3057) ) { (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v16 + 1312LL))(v16, 1); } } LABEL_38: v24 = *(float *)&v82; (*(void (__fastcall **)(__int64 *__return_ptr, __int64))(*(_QWORD *)v16 + 1360LL))(&v83, v16); if ( v24 == *(float *)&v83 && (v66 = *((float *)&v82 + 1), (*(void (__fastcall **)(struct timeval *__return_ptr, __int64))(*(_QWORD *)v16 + 1360LL))(&tv, v16), v66 == *((float *)&tv.tv_sec + 1)) ) { ++v15; } else { v25 = *(_QWORD *)v16; *(_BYTE *)(v16 + 840) = 1; ++v15; (*(void (__fastcall **)(__int64, __int64))(v25 + 1776))(v16, 1); (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v16 + 1792LL))(v16, 1); } if ( v15 >= (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 410)) ) goto LABEL_41; } v19 = 0; LABEL_29: v20 = *(double *)(v16 + 952); if ( v20 <= 0.0 ) goto LABEL_112; goto LABEL_30; } LABEL_41: AudioEffectsLayer::resetAudioVars(*((AudioEffectsLayer **)this + 1586)); PlayLayer::loadDefaultColors(this); LastCheckpoint = PlayLayer::loadLastCheckpoint((cocos2d::CCArray **)this); if ( !v1[160] ) { GJEffectManager::getPersistentStateString(v84, *((GJEffectManager **)this + 269)); if ( v1 + 752 != (char *)v84 ) { if ( (v84[0] & 1) != 0 ) { v27 = (char *)v85; v28 = v84[1]; } else { v28 = LOBYTE(v84[0]) >> 1; v27 = (char *)v84 + 1; } std::string::assign((__int64 *)v1 + 94, v27, v28); } if ( (v84[0] & 1) != 0 ) operator delete(v85); } GJEffectManager::resetUsedItemState(*((GJEffectManager **)this + 269)); if ( LastCheckpoint ) { v29 = (unsigned __int8)v1[160]; v1[377] = 0; if ( !v29 ) GJBaseGameLayer::resetRecord(this, *((_DWORD *)this + 239), 0); v30 = *((_QWORD *)this + 1554); if ( v30 ) v31 = (CheckpointObject *)cocos2d::CCDictionary::objectForKey( *((cocos2d::CCDictionary **)this + 1780), *(unsigned int *)(v30 + 916)); else v31 = nullptr; } else { *((_DWORD *)this + 3332) = 0; *((_DWORD *)this + 3333) = 0; v31 = nullptr; *((_QWORD *)this + 1665) = 0; GJBaseGameLayer::resetRecord(this, 0, 0); v76 = *((_QWORD *)this + 1554); *((_QWORD *)this + 1600) = *((_QWORD *)this + 1599); if ( v76 && (v31 = (CheckpointObject *)cocos2d::CCDictionary::objectForKey( *((cocos2d::CCDictionary **)this + 1780), *(unsigned int *)(v76 + 916)), (v77 = *((_QWORD *)this + 1554)) != 0) ) { if ( v31 ) PlayLayer::loadFromCheckpoint(this, v31); else GJBaseGameLayer::setupLevelStart(this, *(LevelSettingsObject **)(v77 + 1840)); } else { GJBaseGameLayer::setupLevelStart(this, *((LevelSettingsObject **)this + 409)); } } v32 = *((_QWORD *)this + 407); v33 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v32 + 192LL))(v32); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&tv, v33); *(__n128 *)&v34 = cocos2d::CCPoint::operator=(v32 + 2608, &tv); if ( *((_BYTE *)this + 1010) ) { v35 = *((_QWORD *)this + 408); v36 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64, long double))(*(_QWORD *)v35 + 192LL))(v35, v34); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&tv, v36); v37 = cocos2d::CCPoint::operator=(v35 + 2608, &tv); } else { (*(void (__fastcall **)(_QWORD, void *, long double))(**((_QWORD **)this + 408) + 184LL))( *((_QWORD *)this + 408), &unk_155C4E8, v34); v68 = *((_QWORD *)this + 408); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&tv, (const cocos2d::CCPoint *)&unk_155C4E8); v37 = cocos2d::CCPoint::operator=(v68 + 2608, &tv); } if ( !LastCheckpoint ) { v70 = *((GameObject **)this + 407); v71 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(GameObject *, long double))(*(_QWORD *)v70 + 192LL))( v70, *(long double *)&v37); GameObject::setLastPosition(v70, v71); v72 = *((GameObject **)this + 408); v73 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(GameObject *))(*(_QWORD *)v72 + 192LL))(v72); GameObject::setLastPosition(v72, v73); v74 = *((StartPosObject **)this + 1554); if ( !v31 ) { if ( v74 ) GJBaseGameLayer::loadStartPosObject(this, v74); } } GJBaseGameLayer::updatePlayerCollisionBlocks(this); if ( !v1[330] ) { PlayerObject::playSpawnEffect(*((PlayerObject **)this + 407)); if ( *((_BYTE *)this + 1010) ) PlayerObject::playSpawnEffect(*((PlayerObject **)this + 408)); } GJBaseGameLayer::stopCameraShake(this); if ( *((_QWORD *)this + 1554) ) { if ( !LastCheckpoint ) goto LABEL_65; } else if ( !LastCheckpoint ) { *((_BYTE *)this + 1983) = 1; GJBaseGameLayer::checkSpawnObjects(this); goto LABEL_65; } v38 = *((unsigned int *)LastCheckpoint + 786); if ( (int)v38 > 0 ) { v39 = *(void (__fastcall **)(PlayLayer *, __int64, _QWORD, struct timeval *, _QWORD, _QWORD, double))(*(_QWORD *)this + 1256LL); tv.tv_sec = 0; tv.tv_usec = 0; v87 = 0; v39(this, v38, 0, &tv, *((unsigned int *)LastCheckpoint + 785), 0, 0.0); if ( tv.tv_sec ) { if ( tv.tv_sec != tv.tv_usec ) tv.tv_usec += 4 * ~((unsigned __int64)(tv.tv_usec - 4 - tv.tv_sec) >> 2); operator delete((void *)tv.tv_sec); } } GJBaseGameLayer::gameEventTriggered(this, 64, 0, 0); LABEL_65: GJBaseGameLayer::updateProximityVolumeEffects(this); GJBaseGameLayer::updateLevelColors(this); GJBaseGameLayer::updateCamera(this, 0.0); (*(void (__fastcall **)(PlayLayer *, float))(*(_QWORD *)this + 1192LL))(this, 0.0); GJBaseGameLayer::updateGradientLayers(this); GJBaseGameLayer::updateShaderLayer(this, 0.0); v40 = *((_QWORD *)this + 242); if ( !v1[1904] ) { if ( !v40 ) goto LABEL_73; if ( (unsigned __int8)PlayLayer::tracksPercent(this) ) { v1[1904] = (unsigned __int8)&dword_0 + 1; v41 = (GameManager *)GameManager::sharedState((GameManager *)((char *)&dword_0 + 1)); IntGameVariable = GameManager::getIntGameVariable(v41, "0198"); if ( IntGameVariable <= 0 ) v43 = 1800; else v43 = 60 * IntGameVariable; v81 = v43; v44 = *((GJGameLevel **)this + 242); v45 = time(nullptr); GJGameLevel::rollSession(v44, v45, v81); *((_DWORD *)this + 3617) = GJGameLevel::getSessionBest(*((GJGameLevel **)this + 242)); v40 = *((_QWORD *)this + 242); } else { v40 = *((_QWORD *)this + 242); } } if ( v40 ) *((_DWORD *)this + 3547) = PlayLayer::getCurrentPercentInt(this); LABEL_73: if ( (unsigned __int8)PlayerObject::buttonDown(*((_QWORD *)this + 407), 1) || (unsigned __int8)PlayerObject::buttonDown(*((_QWORD *)this + 407), 2) || (unsigned __int8)PlayerObject::buttonDown(*((_QWORD *)this + 407), 3) || (unsigned __int8)PlayerObject::buttonDown(*((_QWORD *)this + 408), 1) || (unsigned __int8)PlayerObject::buttonDown(*((_QWORD *)this + 408), 2) ) { v46 = 1; } else { v46 = PlayerObject::buttonDown(*((_QWORD *)this + 408), 3); } *((_BYTE *)this + 1968) = v46; updated = (__int64 *)PlayLayer::updateAttempts(this); if ( !LastCheckpoint ) { v75 = (__int64 *)(v1 + 776); *((_DWORD *)this + 3272) = *((_DWORD *)this + 3053); if ( (v1[752] & 1) != 0 ) updated = std::string::assign(v75, *((const void **)v1 + 96), *((_QWORD *)v1 + 95)); else updated = std::string::assign(v75, v1 + 753, (unsigned __int8)v1[752] >> 1); } v48 = (GameStatsManager *)GameStatsManager::sharedState((GameStatsManager *)updated); GameStatsManager::incrementStat(v48, &byte_120A098); v49 = *((_DWORD **)this + 242); v50 = v49[199] - v49[200] + 1; v49[201] = v50; v51 = (float)((float)rand() * 4.6566e-10) * 1000.0; v49[200] = (int)v51; v49[199] = v50 + (int)v51; if ( v1[256] ) ++*(_DWORD *)(*((_QWORD *)this + 242) + 1532LL); PlayLayer::updateProgressbar(this); GJBaseGameLayer::refreshCounterLabels(this); v52 = (unsigned __int8)v1[376]; started = *((unsigned __int8 *)this + 12238); if ( *((_BYTE *)this + 12238) ) { v1[376] = 0; v54 = LastCheckpoint == nullptr; } else { v54 = LastCheckpoint == nullptr; started = v54 & v52; if ( (v54 & v52) != 0 ) { v54 &= v52; if ( !*((_QWORD *)this + 1554) ) started = PlayLayer::startMusic((__int64)this); } } if ( *(_BYTE *)(GameManager::sharedState((GameManager *)started) + 923) && !v1[256] && !v1[328] ) { PlayLayer::tryStartRecord(this); GJBaseGameLayer::removeReleasedButtons(this); if ( *(_BYTE *)(*((_QWORD *)this + 409) + 340LL) ) goto LABEL_84; LABEL_122: isJumpButtonPressed = UILayer::isJumpButtonPressed(*((UILayer **)this + 1661)); GJBaseGameLayer::queueButton(this, 1, isJumpButtonPressed, 0, 0.0); goto LABEL_85; } GJBaseGameLayer::removeReleasedButtons(this); if ( !*(_BYTE *)(*((_QWORD *)this + 409) + 340LL) ) goto LABEL_122; LABEL_84: v55 = UILayer::isJumpButtonPressed(*((UILayer **)this + 1661), 1); GJBaseGameLayer::queueButton(this, 1, v55, 0, 0.0); v56 = UILayer::isJumpButtonPressed(*((UILayer **)this + 1661), 0); GJBaseGameLayer::queueButton(this, 1, v56, 1, 0.0); LABEL_85: if ( !v1[256] && !v1[1897] ) v1[1736] = 0; v1[329] = 0; v1[317] = 0; GJBaseGameLayer::syncBGTextures(this); v57 = clock(); v58 = *((_QWORD *)this + 498); dwTickEndp = v57; dwDurationp = v57 - dwTickStartp; if ( v58 ) { v59 = *(unsigned int **)(v58 + 56); if ( *v59 ) { v60 = *((cocos2d::CCNode ***)v59 + 2); v61 = &v60[*v59 - 1]; while ( v61 >= v60 ) { v62 = *v60; if ( !*v60 ) break; ++v60; cocos2d::CCNode::qsortAllChildrenWithIndex(v62); } } } GJBaseGameLayer::sortSectionVector(this); v63 = *((unsigned __int8 *)this + 12238); if ( *((_BYTE *)this + 12238) ) { if ( v52 || (v63 = (unsigned __int8)v1[1884], v1[1884]) ) { v1[1884] = 0; if ( v54 ) { v78 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create((cocos2d::CCDelayTime *)v63, 0.2); v79 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(this, PlayLayer::startGameDelayed, 0); v80 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v78, v79, 0); cocos2d::CCNode::runAction(this, v80); *((_BYTE *)this + 1983) = 0; v1[1518] = 1; return _stack_chk_guard; } v1[376] = 1; *((_BYTE *)this + 1983) = 0; v1[1518] = 1; goto LABEL_97; } } *((_BYTE *)this + 1983) = 0; v1[1518] = 1; if ( LastCheckpoint ) { LABEL_97: cocos2d::CCPoint::operator=((char *)this + 1204, (char *)LastCheckpoint + 1100); cocos2d::CCPoint::operator=((char *)this + 1148, (char *)LastCheckpoint + 1044); cocos2d::CCPoint::operator=((char *)this + 464, (char *)LastCheckpoint + 360); } return _stack_chk_guard; }
GD Web Decomp Icon

GD Web Decomp

Raw Source