// // PlayLayer::resetLevel from 0x10008c6f0 to 0x10008d555 (3685 bytes) // // 1 xrefs: // > @ 0x100abb140 // // 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 12:20:07 +0000 // __int64 __fastcall PlayLayer::resetLevel(_QWORD *a1, double a2, double a3) { __int64 v4; // rdi __int64 v5; // rdi char v6; // al char v7; // al __int64 v8; // rax __int64 v9; // rax unsigned __int8 v10; // r14 std::string::size_type v11; // rdi _WORD *v12; // rdi float v13; // xmm0_4 __int64 v14; // r14 double v15; // xmm0_8 double v16; // xmm0_8 double v17; // xmm0_8 unsigned int v18; // r14d __int64 v19; // rsi __int64 v20; // r13 int v21; // eax double v22; // xmm2_8 double v23; // xmm0_8 double v24; // xmm2_8 float v25; // xmm1_4 float v26; // xmm0_4 int v27; // eax int v28; // eax __int64 v29; // r14 __int64 v30; // rax _DWORD *v31; // r15 __int64 v32; // rax __int64 v33; // r12 __int64 v34; // rax __int64 v35; // r12 __int64 v36; // rax __int64 v37; // rsi __int64 v38; // r13 _DWORD *v39; // r12 __int64 v40; // r15 __int64 v41; // rax __int64 v42; // r15 __int64 v43; // rax __int64 v44; // rsi __int64 v45; // rdx __int64 v46; // rax double v47; // xmm0_8 int v48; // eax int v49; // r15d unsigned int v50; // r13d __int64 v51; // r12 unsigned int v52; // eax __int64 v53; // rdx __m128 v54; // xmm0 unsigned int *v55; // rax int v56; // ecx float v57; // xmm1_4 float v58; // xmm0_4 char v59; // r15 __int64 v60; // rax _DWORD *v61; // r15 int v62; // r12d double v63; // xmm0_8 _QWORD *v64; // rdi __int64 v65; // rdx unsigned __int8 v66; // r15 double v67; // xmm0_8 __int64 v68; // rax __int64 v69; // rdi unsigned __int8 isJumpButtonPressed; // al unsigned __int8 v71; // al unsigned __int8 isJumpButtonPressed_1; // al __int64 v73; // rax unsigned int *v74; // rax _QWORD *v75; // r12 unsigned __int64 v76; // r13 __int64 result; // rax int v78; // r14d int v79; // eax int v80; // ecx int v81; // r8d int v82; // r9d __int64 v83; // rax float v84; // [rsp+0h] [rbp-60h] BYREF _BYTE v85[4]; // [rsp+8h] [rbp-58h] BYREF float v86; // [rsp+Ch] [rbp-54h] std::string v87; // [rsp+10h] [rbp-50h] BYREF float v88; // [rsp+34h] [rbp-2Ch] v4 = a1[243]; if ( *((_BYTE *)a1 + 14524) ) { if ( !v4 && !a1[244] ) PlayLayer::dtRebuildLiveMarkers(a1); } else { if ( v4 ) { (*(void (__fastcall **)(__int64))(*(_QWORD *)v4 + 520LL))(v4); a1[243] = 0; } v5 = a1[244]; if ( v5 ) { (*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 520LL))(v5); a1[244] = 0; } } v6 = *((_BYTE *)a1 + 12617); if ( v6 || !*((_BYTE *)a1 + 12238) && !*((_BYTE *)a1 + 12544) ) { v7 = *((_BYTE *)a1 + 1978); if ( *((_BYTE *)a1 + 14185) == 1 ) { *((_BYTE *)a1 + 14185) = v7; if ( !v7 ) { *((_BYTE *)a1 + 1978) = 0; *(_BYTE *)(a1[407] + 1973LL) = 0; *(_BYTE *)(a1[408] + 1973LL) = 0; PlayLayer::updateTestModeLabel((__int64)a1); } } else { *((_BYTE *)a1 + 14185) = v7; } *(_QWORD *)&a2 = *((unsigned int *)a1 + 3278); *((_BYTE *)a1 + 14186) = *(float *)&a2 != 1.0; PlayLayer::updateTestModeLabel((__int64)a1); v6 = *((_BYTE *)a1 + 12617); } if ( (v6 & 1) == 0 ) { v8 = FMODAudioEngine::sharedEngine(a2); FMODAudioEngine::stopAllEffects(v8); if ( *((_BYTE *)a1 + 12544) != 1 || *((_BYTE *)a1 + 12545) == 1 ) { if ( *((_BYTE *)a1 + 12238) ) { v9 = FMODAudioEngine::sharedEngine(a2); FMODAudioEngine::pauseAllMusic(v9, 0); } else { GJBaseGameLayer::pauseAudio(a1); } } } GJBaseGameLayer::preResumeGame(a1); qword_100BE7A90 = clock(); GJBaseGameLayer::resetLevelVariables(a1); sub_1000FF3A0(a1); if ( (*((_BYTE *)a1 + 13842) || *((_BYTE *)a1 + 13844) == 1) && !(*(unsigned __int8 (__fastcall **)(_QWORD *))(*a1 + 1312LL))(a1) && !(*(unsigned __int8 (__fastcall **)(_QWORD *))(*a1 + 1320LL))(a1) ) { v10 = 1; if ( !(*(unsigned __int8 (__fastcall **)(_QWORD *))(*a1 + 1312LL))(a1) ) v10 = (*(__int64 (__fastcall **)(_QWORD *))(*a1 + 1320LL))(a1); if ( v10 != (*(unsigned __int8 (__fastcall **)(_QWORD))(*(_QWORD *)a1[1727] + 352LL))(a1[1727]) ) { cocos2d::CCDrawNode::clear(a1[1727]); (*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)a1[1727] + 344LL))(a1[1727], v10); if ( v10 ) (*(void (__fastcall **)(_QWORD *))(*a1 + 1304LL))(a1); } } *((_DWORD *)a1 + 236) = 0; *((_DWORD *)a1 + 238) = 0; *((_BYTE *)a1 + 12425) = 1; *((_BYTE *)a1 + 1982) = 0; a1[1859] = 0; *((_BYTE *)a1 + 14868) = 0; a1[1602] = 0; *((_DWORD *)a1 + 3196) = 0; if ( *((_BYTE *)a1 + 12448) != 1 || (v11 = a1[1601]) == 0 ) { gettimeofday((timeval *)&v87, nullptr); v11 = v87.__r_.__value_.__r.__words[0] * SLODWORD(v87.__r_.__value_.__r.__words[1]); } a1[1599] = v11; GameToolbox::fast_srand(); *((_DWORD *)a1 + 3182) = 0; *((_BYTE *)a1 + 14022) = 0; *((_DWORD *)a1 + 3504) = 0; UILayer::toggleMenuVisibility(a1[1661], 1); *(_WORD *)((char *)a1 + 14637) = 0; *((_BYTE *)a1 + 13336) = 0; v12 = (_WORD *)a1[1576]; if ( v12 ) { *((_BYTE *)a1 + 14232) = 0; v12[680] = 0; (*(void (__fastcall **)(_WORD *, float))(*(_QWORD *)v12 + 128LL))(v12, 1.0); v13 = *((float *)a1 + 3559); *((float *)a1 + 3150) = v13; v14 = a1[1576]; *(_QWORD *)&a3 = 1130430464; sub_100278250(&v87, v13, 225.0); (*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v14 + 1368LL))(v14, &v87); GJBaseGameLayer::reorderObjectSection(a1, a1[1576]); (*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)a1[1576] + 1312LL))(a1[1576], 1); } *((_BYTE *)a1 + 14644) = 0; *((_BYTE *)a1 + 14628) = 0; a1[1831] = 0; *((_BYTE *)a1 + 14656) = 0; std::string::assign((std::string *)(a1 + 1594), ""); *((_DWORD *)a1 + 3686) = 0; *((_DWORD *)a1 + 3595) = 0; v15 = UILayer::enableMenu(a1[1661]); GJBaseGameLayer::resetActiveEnterEffects(a1, v15); v16 = *((double *)a1 + 1838); if ( v16 > *((double *)a1 + 1839) ) *((double *)a1 + 1839) = v16; *((_DWORD *)a1 + 3052) = 0; a1[1838] = 0; a1[1809] = 0; v17 = 0.0; *(_OWORD *)(a1 + 1841) = 0; v18 = 0; v19 = 0; (*(void (__fastcall **)(_QWORD *, _QWORD))(*a1 + 1288LL))(a1, 0); if ( (unsigned int)sub_1007FEF90(a1[410]) ) { do { v20 = sub_1007FEFE0(a1[410], v18); (*(void (__fastcall **)(std::string *, __int64))(*(_QWORD *)v20 + 1360LL))(&v87, v20); (*(void (__fastcall **)(__int64))(*(_QWORD *)v20 + 1288LL))(v20); v21 = *(_DWORD *)(v20 + 628); if ( v21 < 0 ) goto LABEL_63; v22 = *(double *)(v20 + 944); v23 = 0.0; a3 = 0.0; if ( v22 > 0.0 ) { v25 = *((float *)a1 + 3408); if ( v22 >= 10000000.0 ) { a3 = (float)(v25 * 10000000.0); v24 = *(double *)(v20 + 952); if ( v24 > 0.0 ) { LABEL_54: v26 = *((float *)a1 + 3409); if ( v24 >= 10000000.0 ) { v23 = (float)(v26 * 10000000.0); if ( v21 != (int)a3 ) { LABEL_58: GJBaseGameLayer::reorderObjectSection(a1, v20); v27 = *(_DWORD *)(v20 + 628); if ( v27 > *((_DWORD *)a1 + 3056) || v27 < *((_DWORD *)a1 + 3055) || (v28 = *(_DWORD *)(v20 + 632), v28 > *((_DWORD *)a1 + 3058)) || v28 < *((_DWORD *)a1 + 3057) ) { (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v20 + 1312LL))(v20, 1); } goto LABEL_63; } } else { v23 = v24 * v26; if ( v21 != (int)a3 ) goto LABEL_58; } goto LABEL_48; } } else { a3 = v22 * v25; v24 = *(double *)(v20 + 952); if ( v24 > 0.0 ) goto LABEL_54; } } else { v24 = *(double *)(v20 + 952); if ( v24 > 0.0 ) goto LABEL_54; } if ( v21 != (int)a3 ) goto LABEL_58; LABEL_48: if ( *(_DWORD *)(v20 + 632) != (int)v23 ) goto LABEL_58; LABEL_63: v88 = *(float *)&v87.__r_.__value_.__l.0; (*(void (__fastcall **)(float *, __int64))(*(_QWORD *)v20 + 1360LL))(&v84, v20); *(_QWORD *)&v17 = LODWORD(v88); if ( v88 != v84 || (v88 = *((float *)v87.__r_.__value_.__r.__words + 1), v19 = v20, (*(void (__fastcall **)(_BYTE *, __int64))(*(_QWORD *)v20 + 1360LL))(v85, v20), *(_QWORD *)&v17 = LODWORD(v88), v88 != v86) ) { *(_BYTE *)(v20 + 840) = 1; (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v20 + 1776LL))(v20, 1); v19 = 1; (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v20 + 1792LL))(v20, 1); } ++v18; } while ( v18 < (unsigned int)sub_1007FEF90(a1[410]) ); } AudioEffectsLayer::resetAudioVars(a1[1586]); PlayLayer::loadDefaultColors((__int64)a1); if ( (unsigned int)sub_1007FEF90(a1[1781]) ) { v29 = sub_1007FF000(a1[1781]); v19 = v29; PlayLayer::loadFromCheckpoint((__int64)a1, (_DWORD *)v29, v17); if ( *((_BYTE *)a1 + 12448) ) goto LABEL_72; } else { v29 = 0; if ( *((_BYTE *)a1 + 12448) ) goto LABEL_72; } GJEffectManager::getPersistentStateString(&v87, a1[269]); v19 = (__int64)&v87; std::string::operator=((std::string *)(a1 + 1630), &v87); if ( (*(_BYTE *)&v87.__r_.__value_.__s.0 & 1) != 0 ) operator delete(v87.__r_.__value_.__l.__data_); LABEL_72: GJEffectManager::resetUsedItemState(a1[269]); if ( v29 ) { *((_BYTE *)a1 + 12665) = 0; if ( !*((_BYTE *)a1 + 12448) ) { v19 = *((unsigned int *)a1 + 239); GJBaseGameLayer::resetRecord(a1, v19, 0); } v30 = a1[1554]; if ( v30 ) { LABEL_76: v19 = *(unsigned int *)(v30 + 916); v31 = (_DWORD *)cocos2d::CCDictionary::objectForKey_1(a1[1780]); if ( v29 ) goto LABEL_86; goto LABEL_80; } } else { v17 = 0.0; *(_OWORD *)(a1 + 1665) = 0; v19 = 0; GJBaseGameLayer::resetRecord(a1, 0, 0); a1[1600] = a1[1599]; v30 = a1[1554]; if ( v30 ) goto LABEL_76; } v31 = nullptr; if ( v29 ) goto LABEL_86; LABEL_80: v32 = a1[1554]; if ( v32 ) { if ( v31 ) { v19 = (__int64)v31; PlayLayer::loadFromCheckpoint((__int64)a1, v31, v17); goto LABEL_86; } v19 = *(_QWORD *)(v32 + 1840); } else { v19 = a1[409]; } GJBaseGameLayer::setupLevelStart(a1, v19); LABEL_86: v33 = a1[407]; v34 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v33 + 192LL))(v33, v19); sub_1002782D0(&v87, v34); sub_100278300(v33 + 2608, &v87); v35 = a1[408]; if ( *((_BYTE *)a1 + 1010) == 1 ) { v36 = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v35 + 192LL))(a1[408]); sub_1002782D0(&v87, v36); v37 = (__int64)&v87; sub_100278300(v35 + 2608, &v87); if ( v29 ) goto LABEL_93; } else { (*(void (__fastcall **)(_QWORD, void *))(*(_QWORD *)v35 + 184LL))(a1[408], &unk_100BE1088); v38 = a1[408] + 2608LL; sub_1002782D0(&v87, &unk_100BE1088); v37 = (__int64)&v87; sub_100278300(v38, &v87); if ( v29 ) goto LABEL_93; } v39 = v31; v40 = a1[407]; v41 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v40 + 192LL))(v40); GameObject::setLastPosition(v40, v41); v42 = a1[408]; v43 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v42 + 192LL))(v42); GameObject::setLastPosition(v42, v43); v37 = a1[1554]; if ( v37 && !v39 ) GJBaseGameLayer::loadStartPosObject(a1); LABEL_93: GJBaseGameLayer::updatePlayerCollisionBlocks(a1); if ( !*((_BYTE *)a1 + 12618) ) { PlayerObject::playSpawnEffect(a1[407]); if ( *((_BYTE *)a1 + 1010) == 1 ) PlayerObject::playSpawnEffect(a1[408]); } GJBaseGameLayer::stopCameraShake(a1); if ( v29 | a1[1554] ) { if ( v29 ) { v44 = *(unsigned int *)(v29 + 3144); if ( (int)v44 > 0 ) { memset(&v87, 0, sizeof(v87)); v17 = 0.0; (*(void (__fastcall **)(_QWORD *, __int64, _QWORD, std::string *, _QWORD, _QWORD, double))(*a1 + 1256LL))( a1, v44, 0, &v87, *(unsigned int *)(v29 + 3140), 0, 0.0); if ( v87.__r_.__value_.__r.__words[0] ) { v87.__r_.__value_.__l.__size_ = v87.__r_.__value_.__r.__words[0]; operator delete((void *)v87.__r_.__value_.__r.__words[0]); } } v37 = 64; GJBaseGameLayer::gameEventTriggered(a1, 64, 0, 0, v17); } } else { *((_BYTE *)a1 + 1983) = 1; GJBaseGameLayer::checkSpawnObjects(a1); } GJBaseGameLayer::updateProximityVolumeEffects(a1); GJBaseGameLayer::updateLevelColors(a1); GJBaseGameLayer::updateCamera(a1, 0.0); (*(void (__fastcall **)(_QWORD *, double))(*a1 + 1192LL))(a1, 0.0); GJBaseGameLayer::updateGradientLayers(a1); GJBaseGameLayer::updateShaderLayer(a1, 0.0); if ( !*((_BYTE *)a1 + 14192) && a1[242] && (*((_BYTE *)a1 + 12238) != 1 || *((_BYTE *)a1 + 14576) == 1) ) { *((_BYTE *)a1 + 14192) = 1; GameManager::sharedState(a1, v37, v45); *(_QWORD *)&v47 = GameManager::getIntGameVariable(v46, "0198").u64[0]; v49 = v48; v50 = 60 * v48; v51 = a1[242]; v52 = time(nullptr); v53 = 1800; if ( v49 > 0 ) v53 = v50; sub_1005871C0(v51, v52, v53, v47); *((_DWORD *)a1 + 3617) = GJGameLevel::getSessionBest(a1[242]); } if ( a1[242] ) { if ( *((_BYTE *)a1 + 12238) == 1 ) { v54 = 0; v54.f32[0] = (float)*(int *)(a1[269] + 832LL); } else { v55 = (unsigned int *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)a1[407] + 192LL))(a1[407]); v56 = *(_DWORD *)(a1[242] + 1232LL); if ( v56 <= 0 ) { v54 = (__m128)*v55; v57 = *((float *)a1 + 3150); } else { v54 = 0; v54.f32[0] = (float)*((int *)a1 + 238); v57 = (float)(2 * v56); } v58 = v54.f32[0] / v57; *(_QWORD *)&a3 = 1120403456; v54.f32[0] = fminf(fmaxf(v58 * 100.0, 0.0), 100.0); } *((_DWORD *)a1 + 3547) = (int)_mm_round_ss(v54, v54, 9).f32[0]; } v59 = 1; if ( !(unsigned __int8)PlayerObject::buttonDown(a1[407], 1) && !(unsigned __int8)PlayerObject::buttonDown(a1[407], 2) && !(unsigned __int8)PlayerObject::buttonDown(a1[407], 3) && !(unsigned __int8)PlayerObject::buttonDown(a1[408], 1) && !(unsigned __int8)PlayerObject::buttonDown(a1[408], 2) ) { v59 = PlayerObject::buttonDown(a1[408], 3); } *((_BYTE *)a1 + 1968) = v59; PlayLayer::updateAttempts(a1); if ( !v29 ) { *((_DWORD *)a1 + 3272) = *((_DWORD *)a1 + 3053); std::string::operator=((std::string *)(a1 + 1633), (const std::string *)(a1 + 1630)); } v60 = GameStatsManager::sharedState(); GameStatsManager::incrementStat_1(v60, (__int64)"2"); v61 = (_DWORD *)a1[242]; v62 = v61[199] - v61[200]; v61[201] = v62 + 1; HIDWORD(v63) = 0; *(float *)&v63 = (float)((float)rand() * 4.6566129e-10) * 1000.0; v61[200] = (int)*(float *)&v63; v61[199] = v62 + (int)*(float *)&v63 + 1; if ( *((_BYTE *)a1 + 12544) == 1 ) ++*(_DWORD *)(a1[242] + 1532LL); PlayLayer::updateProgressbar((__int64)a1, v63, a3); v64 = a1; GJBaseGameLayer::refreshCounterLabels(a1); v66 = *((_BYTE *)a1 + 12664); if ( *((_BYTE *)a1 + 12238) == 1 ) { *((_BYTE *)a1 + 12664) = 0; } else if ( !((v29 != 0) | v66 ^ 1) && !a1[1554] ) { v64 = a1; PlayLayer::startMusic((__int64)a1, v63); } *(_QWORD *)&v67 = GameManager::sharedState(v64, "2", v65).u64[0]; if ( *(_BYTE *)(v68 + 923) == 1 && !*((_BYTE *)a1 + 12544) && !*((_BYTE *)a1 + 12616) ) { cocos2d::CCNode::stopActionByTag(a1, 31); *((_BYTE *)a1 + 14657) = 0; } GJBaseGameLayer::removeReleasedButtons(a1, v67); v69 = a1[1661]; if ( *(_BYTE *)(a1[409] + 340LL) == 1 ) { isJumpButtonPressed = UILayer::isJumpButtonPressed(v69, 1); GJBaseGameLayer::queueButton(a1, 1, isJumpButtonPressed, 0, 0.0); v71 = UILayer::isJumpButtonPressed(a1[1661], 0); GJBaseGameLayer::queueButton(a1, 1, v71, 1, 0.0); if ( *((_BYTE *)a1 + 12544) ) goto LABEL_143; } else { isJumpButtonPressed_1 = UILayer::isJumpButtonPressed_1(v69); GJBaseGameLayer::queueButton(a1, 1, isJumpButtonPressed_1, 0, 0.0); if ( *((_BYTE *)a1 + 12544) ) goto LABEL_143; } if ( !*((_BYTE *)a1 + 14185) ) *((_BYTE *)a1 + 14024) = 0; LABEL_143: *((_BYTE *)a1 + 12617) = 0; *((_BYTE *)a1 + 12605) = 0; GJBaseGameLayer::syncBGTextures(a1); qword_100BE7A98 = clock(); qword_100BE7AA0 = qword_100BE7A98 - qword_100BE7A90; v73 = a1[498]; if ( v73 ) { v74 = *(unsigned int **)(v73 + 56); if ( *v74 ) { v75 = *((_QWORD **)v74 + 2); v76 = (unsigned __int64)&v75[*v74 - 1]; do { if ( !*v75 ) break; cocos2d::CCNode::qsortAllChildrenWithIndex(); ++v75; } while ( (unsigned __int64)v75 <= v76 ); } } result = GJBaseGameLayer::sortSectionVector(a1); if ( *((_BYTE *)a1 + 12238) == 1 && (v66 || *((_BYTE *)a1 + 14172) == 1) ) { *((_BYTE *)a1 + 14172) = 0; if ( !v29 ) { v78 = cocos2d::CCDelayTime::create(0.2); v79 = cocos2d::CCCallFunc::create(a1, PlayLayer::startGameDelayed, 0); v83 = sub_10039EB60(v78, v79, 0, v80, v81, v82); result = cocos2d::CCNode::runAction(a1, v83); *((_BYTE *)a1 + 1983) = 0; *((_BYTE *)a1 + 13806) = 1; return result; } *((_BYTE *)a1 + 12664) = 1; *((_BYTE *)a1 + 1983) = 0; *((_BYTE *)a1 + 13806) = 1; } else { *((_BYTE *)a1 + 1983) = 0; *((_BYTE *)a1 + 13806) = 1; if ( !v29 ) return result; } sub_100278300((char *)a1 + 1204, v29 + 1100); sub_100278300((char *)a1 + 1148, v29 + 1044); return sub_100278300(a1 + 58, v29 + 360); }
GD Web Decomp Icon

GD Web Decomp

Raw Source