diff --git a/cheat-library/cheat-library.vcxproj b/cheat-library/cheat-library.vcxproj index 51c3fc4..3a0ada0 100644 --- a/cheat-library/cheat-library.vcxproj +++ b/cheat-library/cheat-library.vcxproj @@ -52,6 +52,7 @@ + @@ -122,6 +123,7 @@ + @@ -166,6 +168,7 @@ + @@ -233,6 +236,7 @@ + @@ -925,8 +929,7 @@ - "$(OutDir)injector.exe" -powershell -nop -c "& {sleep 15}" + "$(OutDir)injector.exe" powershell -nop -c "& {sleep 15}" $(OutDir)_noexist.nope;%(Outputs) $(TargetPath);%(Inputs) diff --git a/cheat-library/cheat-library.vcxproj.filters b/cheat-library/cheat-library.vcxproj.filters index 20245a6..5a33a27 100644 --- a/cheat-library/cheat-library.vcxproj.filters +++ b/cheat-library/cheat-library.vcxproj.filters @@ -237,6 +237,12 @@ Header Files + + Header Files + + + Header Files + @@ -432,6 +438,12 @@ Source Files + + Source Files + + + Source Files + diff --git a/cheat-library/src/appdata/il2cpp-functions.h b/cheat-library/src/appdata/il2cpp-functions.h index 077f93b..848eeee 100644 --- a/cheat-library/src/appdata/il2cpp-functions.h +++ b/cheat-library/src/appdata/il2cpp-functions.h @@ -42,7 +42,8 @@ DO_APP_FUNC(0x016189E0, void, MoleMole_DataItem_HandleNormalProp, (DataItem* __t // God mode DO_APP_FUNC(0x027DB100, void, VCHumanoidMove_NotifyLandVelocity, (VCHumanoidMove* __this, Vector3 velocity, float reachMaxDownVelocityTime, MethodInfo* method)); DO_APP_FUNC(0x036889B0, bool, Miscs_CheckTargetAttackable, (BaseEntity* attackerEntity, BaseEntity* targetEntity, MethodInfo* method)); -// DO_APP_FUNC(0x00D0CA90, void, MoleMole_LCBaseCombat_FireBeingHitEvent, (LCBaseCombat* __this, uint32_t attackeeRuntimeID, AttackResult* attackResult, MethodInfo* method)); +DO_APP_FUNC(0x00D0CA90, void, MoleMole_LCBaseCombat_FireBeingHitEvent, (LCBaseCombat* __this, uint32_t attackeeRuntimeID, AttackResult* attackResult, MethodInfo* method)); +DO_APP_FUNC(0x02383880, bool, MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp, (ActorAbilityPlugin* __this, float delay, Object* arg, MethodInfo* method)); // Cooldown cheats @@ -138,6 +139,7 @@ DO_APP_FUNC(0x0292C7F0, void, MoleMole_FishingModule_onFishChosenNotify, (void* // Visuals DO_APP_FUNC(0x013FC090, void, MoleMole_SCameraModuleInitialize_SetWarningLocateRatio, (SCameraModuleInitialize* __this, double deltaTime, CameraShareData* data, MethodInfo* method)); +DO_APP_FUNC(0x01B8DC20, void, MoleMole_VCBaseSetDitherValue_set_ManagerDitherAlphaValue, (MoleMole_VCBaseSetDitherValue* __this, float value, MethodInfo* method)); // Chest Indicator | RyujinZX#6666 DO_APP_FUNC(0x04C9B450, bool, MoleMole_LCIndicatorPlugin_DoCheck, (LCIndicatorPlugin* __this, MethodInfo* method)); @@ -163,26 +165,31 @@ DO_APP_FUNC(0x0662F720, void, GameObject_set_active, (GameObject* __this, bool v DO_APP_FUNC(0x065546E0, Transform*, Transform_GetChild, (Transform* __this, int32_t index, MethodInfo* method)); DO_APP_FUNC(0x0652EA10, Component_1*, Component_1_GetComponent_1, (Component_1* __this, String* type, MethodInfo* method)); DO_APP_FUNC(0x0662F520, void, GameObject_SetActive, (GameObject* __this, bool value, MethodInfo* method)); - -// Browser DO_APP_FUNC(0x0662F100, GameObject*, GameObject_CreatePrimitive, (PrimitiveType__Enum type, MethodInfo* method)); DO_APP_FUNC(0x0662F700, Transform*, GameObject_get_transform, (GameObject* __this, MethodInfo* method)); DO_APP_FUNC(0x06555EF0, void, Transform_set_localRotation, (Transform* __this, Quaternion value, MethodInfo* method)); DO_APP_FUNC(0x065548E0, void, Transform_set_localScale, (Transform* __this, Vector3 value, MethodInfo* method)); DO_APP_FUNC(0x06555EE0, void, Transform_set_localPosition, (Transform* __this, Vector3 value, MethodInfo* method)); DO_APP_FUNC(0x0662F090, Component_1*, GameObject_AddComponentInternal, (GameObject* __this, String* className, MethodInfo* method)); -DO_APP_FUNC(0x064296D0, void, Browser_Show, (Browser* __this, MethodInfo* method)); -DO_APP_FUNC(0x06427060, void, Browser_Hide, (Browser* __this, MethodInfo* method)); -DO_APP_FUNC(0x00C21580, void, Browser_set_EnableRendering, (Browser* __this, bool value, MethodInfo* method)); -DO_APP_FUNC(0x0642C5D0, void, Browser_set_Url, (Browser* __this, String* value, MethodInfo* method)); -DO_APP_FUNC(0x064273E0, void, Browser_LoadURL, (Browser* __this, String* url, bool force, MethodInfo* method)); -DO_APP_FUNC(0x06427610, void, Browser_OnDestroy, (Browser* __this, MethodInfo* method)); -DO_APP_FUNC(0x0642A200, void, Browser_Update, (Browser* __this, MethodInfo* method)); -DO_APP_FUNC(0x06427100, void, Browser_LateUpdate, (Browser* __this, MethodInfo* method)); -DO_APP_FUNC(0x06429770, void, Browser_Stop, (Browser* __this, MethodInfo* method)); -DO_APP_FUNC(0x06550910, void, Object_1_Destroy_1, (Object_1* obj, MethodInfo* method)); DO_APP_FUNC(0x0662F0A0, Component_1*, GameObject_AddComponent, (GameObject* __this, Type* componentType, MethodInfo* method)); DO_APP_FUNC(0x065508C0, void, Object_1_DestroyImmediate_1, (Object_1* obj, MethodInfo* method)); +DO_APP_FUNC(0x06550C00, Object_1*, Object_1_Instantiate_2, (Object_1* original, MethodInfo* method)); +DO_APP_FUNC(0x041B0BB0, Object*, Object_1_Instantiate_5, (Object* original, MethodInfo* method)); +DO_APP_FUNC(0x041B0BB0, GameObject*, Object_1_Instantiate_11, (GameObject* original, MethodInfo* method)); + + +// Music game event +DO_APP_FUNC(0x00FFE490, void, MusicGamePlayComponent_OnPlayerUpdate, (MusicGamePlayComponent* __this, MethodInfo* method)); +DO_APP_FUNC(0x00FFE600, void, MusicGamePlayComponent_OnStart, (MusicGamePlayComponent* __this, BeatMapData* beatMapData, MusicMetaInfo* musicMetaInfo, MethodInfo* method)); +DO_APP_FUNC(0x00FFE310, void, MusicGamePlayComponent_OnMiss, (MusicGamePlayComponent* __this, MethodInfo* method)); +DO_APP_FUNC(0x00FFEE40, void, MusicGamePlayComponent_set_combo, (MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method)); +DO_APP_FUNC(0x00FFF050, void, MusicGamePlayComponent_set_score, (MusicGamePlayComponent* __this, float value, MethodInfo* method)); +DO_APP_FUNC(0x01B5AEB0, void, MusicGamePlayComponent_set_maxCombo, (MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method)); +DO_APP_FUNC(0x02C749E0, void, MusicGamePlayComponent_set_perfectCnt, (MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method)); +DO_APP_FUNC(0x035C4E50, void, MusicGamePlayComponent_set_greatCnt, (MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method)); +DO_APP_FUNC(0x017A31C0, void, MusicGamePlayComponent_set_missCnt, (MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method)); +DO_APP_FUNC(0x00FFDE90, void, MusicGamePlayComponent_OnHit, (MusicGamePlayComponent* __this, float score, MethodInfo* method)); + // Utility DO_APP_FUNC(0x03551B60, String*, Text_get_text, (Text* __this, MethodInfo* method)); diff --git a/cheat-library/src/appdata/il2cpp-types.h b/cheat-library/src/appdata/il2cpp-types.h index ae47281..90f8431 100644 --- a/cheat-library/src/appdata/il2cpp-types.h +++ b/cheat-library/src/appdata/il2cpp-types.h @@ -11651,6 +11651,83 @@ namespace app { struct Browser__Fields fields; }; + struct __declspec(align(8)) BeatMapData__Fields { + struct List_1_MoleMole_MusicGame_TrackData_* trackDatas; + struct POLBDGNBFKM* config; + }; + + struct BeatMapData { + struct BeatMapData__Class* klass; + MonitorData* monitor; + struct BeatMapData__Fields fields; + }; + + struct __declspec(align(8)) MusicMetaInfo__Fields { + struct BpmInfo* bpmInfo; + struct List_1_System_Single_* simpleBeatHintTimeMsList; + struct List_1_System_Single_* complexBeatHintTimeMsList; + struct CGDACGGKKNJ* musicConfig; + struct PMIELLLMJKA* musicInfoConfig; + struct POLBDGNBFKM* beatMapConfig; + struct JNEKHDKOKGL* musicInstrumentConfig; + }; + + struct MusicMetaInfo { + struct MusicMetaInfo__Class* klass; + MonitorData* monitor; + struct MusicMetaInfo__Fields fields; + }; + + struct MusicGamePlayComponent__Fields { + void* _; + uint32_t _combo; + float _score_k__BackingField; + uint32_t _maxCombo_k__BackingField; + uint32_t _perfectCnt_k__BackingField; + uint32_t _greatCnt_k__BackingField; + uint32_t _missCnt_k__BackingField; + }; + + struct MusicGamePlayComponent { + struct MusicGamePlayComponent__Class* klass; + MonitorData* monitor; + struct MusicGamePlayComponent__Fields fields; + }; + + struct MoleMole_VCBaseSetDitherValue__Fields { + void* _; + bool _usingDitherAlpha; + float _ditherAlphaValue; + float _managerDitherAlphaValue; + float _localDitherAlphaValue; + bool IBKAJMBMGAE; + struct MoleMole_VCBaseModel* _modelComponent; + float _showStartDitherDuration; + bool _needStartDitherAction; + float _detectDitherRangeBetweenCameraAndAvatar; + float _detectDitherRangeNormalBetweenCamera; + float _detectDitherRangeNormalBetweenCameraInTimeLine; + bool GCEGGKLBFPG; + struct List_1_MoleMole_BaseDither_* _dithers; + bool _isDitherChangeStarted; + float _spd; + float _fromValue; + float _toValue; + struct Action* _changeFinishHandler; + bool _triggerUpdateDitherShow; + bool _prevUsingDitherAlpha; + float _prevDitherAlphaValue; + float _prevTextureBias; + bool _prevInMotionVectorMode; + bool _isVisible; + }; + + struct MoleMole_VCBaseSetDitherValue { + struct MoleMole_VCBaseSetDitherValue__Class* klass; + MonitorData* monitor; + struct MoleMole_VCBaseSetDitherValue__Fields fields; + }; + #if !defined(_GHIDRA_) && !defined(_IDA_) } #endif diff --git a/cheat-library/src/user/cheat/cheat.cpp b/cheat-library/src/user/cheat/cheat.cpp index 3c5b76b..f9625dc 100644 --- a/cheat-library/src/user/cheat/cheat.cpp +++ b/cheat-library/src/user/cheat/cheat.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include @@ -46,6 +47,7 @@ #include #include #include +#include #include "GenshinCM.h" @@ -95,6 +97,7 @@ namespace cheat FEAT_INST(AutoFish), FEAT_INST(AutoCook), + FEAT_INST(MusicEvent), FEAT_INST(NoFog), FEAT_INST(FPSUnlock), @@ -103,7 +106,8 @@ namespace cheat FEAT_INST(ProfileChanger), FEAT_INST(PaimonFollow), FEAT_INST(HideUI), - FEAT_INST(Browser) + FEAT_INST(Browser), + FEAT_INST(EnablePeaking) }); #undef FEAT_INST diff --git a/cheat-library/src/user/cheat/player/GodMode.cpp b/cheat-library/src/user/cheat/player/GodMode.cpp index 0a93b2e..484d3db 100644 --- a/cheat-library/src/user/cheat/player/GodMode.cpp +++ b/cheat-library/src/user/cheat/player/GodMode.cpp @@ -8,13 +8,17 @@ namespace cheat::feature { static bool Miscs_CheckTargetAttackable_Hook(app::BaseEntity* attacker, app::BaseEntity* target, MethodInfo* method); static void VCHumanoidMove_NotifyLandVelocity_Hook(app::VCHumanoidMove* __this, app::Vector3 velocity, float reachMaxDownVelocityTime, MethodInfo* method); + static void LCBaseCombat_FireBeingHitEvent_Hook(app::LCBaseCombat* __this, uint32_t attackeeRuntimeID, app::AttackResult* attackResult, MethodInfo* method); + static bool MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook(app::ActorAbilityPlugin* __this, float delay, app::Object* arg, MethodInfo* method); GodMode::GodMode() : Feature(), - NFEX(f_Enabled, "God mode", "m_GodMode", "Player", false, false) + NFEX(f_Enabled, "God mode", "m_GodMode", "Player", false, false), + NF(f_AltGodMode, "Alternative God Mode", "Player", false) { - // HookManager::install(app::MoleMole_LCBaseCombat_FireBeingHitEvent, LCBaseCombat_FireBeingHitEvent_Hook); HookManager::install(app::VCHumanoidMove_NotifyLandVelocity, VCHumanoidMove_NotifyLandVelocity_Hook); HookManager::install(app::Miscs_CheckTargetAttackable, Miscs_CheckTargetAttackable_Hook); + HookManager::install(app::MoleMole_LCBaseCombat_FireBeingHitEvent, LCBaseCombat_FireBeingHitEvent_Hook); + HookManager::install(app::MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp, MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook); } const FeatureGUIInfo& GodMode::GetGUIInfo() const @@ -28,16 +32,21 @@ namespace cheat::feature ConfigWidget("God Mode", f_Enabled, "Enables god mode, i.e. no incoming damage.\n" \ "May not work with some types of damage."); + ImGui::Indent(); + ConfigWidget("Alternative God Mode", f_AltGodMode, + "Alternative god mode that ignores incoming damage\n" \ + "including environmental damage."); + ImGui::Unindent(); } bool GodMode::NeedStatusDraw() const -{ - return f_Enabled; + { + return f_Enabled || f_AltGodMode; } void GodMode::DrawStatus() { - ImGui::Text("God Mode"); + ImGui::Text("God Mode%s", f_AltGodMode ? "+Alt " : " "); } GodMode& GodMode::GetInstance() @@ -64,7 +73,7 @@ namespace cheat::feature static void VCHumanoidMove_NotifyLandVelocity_Hook(app::VCHumanoidMove* __this, app::Vector3 velocity, float reachMaxDownVelocityTime, MethodInfo* method) { auto& gm = GodMode::GetInstance(); - if (gm.f_Enabled && -velocity.y > 13) + if ((gm.f_Enabled || gm.f_AltGodMode) && -velocity.y > 13) { float randAdd = (float)(std::rand() % 1000) / 1000; velocity.y = -8 - randAdd; @@ -75,13 +84,24 @@ namespace cheat::feature } // Analog function for disable attack damage (Thanks to Taiga74164) - //void LCBaseCombat_FireBeingHitEvent_Hook(app::LCBaseCombat* __this, uint32_t attackeeRuntimeID, app::AttackResult* attackResult, MethodInfo* method) - //{ - // auto avatarEntity = GetAvatarEntity(); - // if (avatarEntity != nullptr && Config::cfgGodModEnable.GetValue() && avatarEntity->fields._runtimeID_k__BackingField == attackeeRuntimeID) - // return; - // - // return callOrigin(LCBaseCombat_FireBeingHitEvent_Hook, __this, attackeeRuntimeID, attackResult, method); - //} + static void LCBaseCombat_FireBeingHitEvent_Hook(app::LCBaseCombat* __this, uint32_t attackeeRuntimeID, app::AttackResult* attackResult, MethodInfo* method) + { + auto& gm = GodMode::GetInstance(); + auto& manager = game::EntityManager::instance(); + if (gm.f_AltGodMode && manager.avatar()->runtimeID() == attackeeRuntimeID) + return; + + CALL_ORIGIN(LCBaseCombat_FireBeingHitEvent_Hook, __this, attackeeRuntimeID, attackResult, method); + } + + // Environmental damage immunity (Thanks to RELOADED#7236 / GitHub: @34736384) + static bool MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook(app::ActorAbilityPlugin* __this, float delay, app::Object* arg, MethodInfo* method) + { + auto& gm = GodMode::GetInstance(); + if (gm.f_AltGodMode/* || gm.f_Enabled*/) + return FALSE; + + return CALL_ORIGIN(MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook, __this, delay, arg, method); + } } diff --git a/cheat-library/src/user/cheat/player/GodMode.h b/cheat-library/src/user/cheat/player/GodMode.h index 750398f..79baf5a 100644 --- a/cheat-library/src/user/cheat/player/GodMode.h +++ b/cheat-library/src/user/cheat/player/GodMode.h @@ -9,6 +9,7 @@ namespace cheat::feature { public: config::Field> f_Enabled; + config::Field> f_AltGodMode; static GodMode& GetInstance(); diff --git a/cheat-library/src/user/cheat/visuals/EnablePeaking.cpp b/cheat-library/src/user/cheat/visuals/EnablePeaking.cpp new file mode 100644 index 0000000..edf40bd --- /dev/null +++ b/cheat-library/src/user/cheat/visuals/EnablePeaking.cpp @@ -0,0 +1,52 @@ +#include "pch-il2cpp.h" +#include "EnablePeaking.h" + +#include + +namespace cheat::feature +{ + static void MoleMole_VCBaseSetDitherValue_set_ManagerDitherAlphaValue_Hook(app::MoleMole_VCBaseSetDitherValue* __this, float value, MethodInfo* method); + + EnablePeaking::EnablePeaking() : Feature(), + NF(f_Enabled, "Enable Peaking", "Visuals::EnablePeaking", false) + { + HookManager::install(app::MoleMole_VCBaseSetDitherValue_set_ManagerDitherAlphaValue, MoleMole_VCBaseSetDitherValue_set_ManagerDitherAlphaValue_Hook); + } + + const FeatureGUIInfo& EnablePeaking::GetGUIInfo() const + { + static const FeatureGUIInfo info{ "EnablePeaking", "Visuals", false }; + return info; + } + + void EnablePeaking::DrawMain() + { + ConfigWidget(f_Enabled, ";)"); + } + + bool EnablePeaking::NeedStatusDraw() const + { + return f_Enabled; + } + + void EnablePeaking::DrawStatus() + { + ImGui::Text("Enable Peaking"); + } + + EnablePeaking& EnablePeaking::GetInstance() + { + static EnablePeaking instance; + return instance; + } + + static void MoleMole_VCBaseSetDitherValue_set_ManagerDitherAlphaValue_Hook(app::MoleMole_VCBaseSetDitherValue* __this, float value, MethodInfo* method) + { + EnablePeaking& EnablePeaking = EnablePeaking::GetInstance(); + if (EnablePeaking.f_Enabled) + value = 1; + + CALL_ORIGIN(MoleMole_VCBaseSetDitherValue_set_ManagerDitherAlphaValue_Hook, __this, value, method); + } +} + diff --git a/cheat-library/src/user/cheat/visuals/EnablePeaking.h b/cheat-library/src/user/cheat/visuals/EnablePeaking.h new file mode 100644 index 0000000..62604db --- /dev/null +++ b/cheat-library/src/user/cheat/visuals/EnablePeaking.h @@ -0,0 +1,25 @@ +#pragma once +#include +#include + +namespace cheat::feature +{ + + class EnablePeaking : public Feature + { + public: + config::Field> f_Enabled; + + static EnablePeaking& GetInstance(); + + const FeatureGUIInfo& GetGUIInfo() const override; + void DrawMain() override; + + virtual bool NeedStatusDraw() const override; + void DrawStatus() override; + + private: + EnablePeaking(); + }; +} + diff --git a/cheat-library/src/user/cheat/world/MusicEvent.cpp b/cheat-library/src/user/cheat/world/MusicEvent.cpp new file mode 100644 index 0000000..9a7cf92 --- /dev/null +++ b/cheat-library/src/user/cheat/world/MusicEvent.cpp @@ -0,0 +1,152 @@ +#include "pch-il2cpp.h" +#include "MusicEvent.h" + +#include +#include + +namespace cheat::feature +{ + + static void MusicGamePlayComponent_OnStart_Hook(app::MusicGamePlayComponent* __this, app::BeatMapData* beatMapData, app::MusicMetaInfo* musicMetaInfo, MethodInfo* method); + static void MusicGamePlayComponent_OnMiss_Hook(app::MusicGamePlayComponent* __this, MethodInfo* method); + static void MusicGamePlayComponent_set_combo_Hook(app::MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method); + static void MusicGamePlayComponent_set_score_Hook(app::MusicGamePlayComponent* __this, float value, MethodInfo* method); + static void MusicGamePlayComponent_set_maxCombo_Hook(app::MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method); + static void MusicGamePlayComponent_set_perfectCnt_Hook(app::MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method); + static void MusicGamePlayComponent_set_greatCnt_Hook(app::MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method); + static void MusicGamePlayComponent_set_missCnt_Hook(app::MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method); + static void MusicGamePlayComponent_OnHit_Hook(app::MusicGamePlayComponent* __this, float score, MethodInfo* method); + + MusicEvent::MusicEvent() : Feature(), + NF(f_Enabled, "Music Event", "MusicEvent", false) + { + //HookManager::install(app::MusicGamePlayComponent_OnStart, MusicGamePlayComponent_OnStart_Hook); + HookManager::install(app::MusicGamePlayComponent_OnMiss, MusicGamePlayComponent_OnMiss_Hook); + HookManager::install(app::MusicGamePlayComponent_set_combo, MusicGamePlayComponent_set_combo_Hook); + HookManager::install(app::MusicGamePlayComponent_set_score, MusicGamePlayComponent_set_score_Hook); + HookManager::install(app::MusicGamePlayComponent_set_maxCombo, MusicGamePlayComponent_set_maxCombo_Hook); + HookManager::install(app::MusicGamePlayComponent_set_perfectCnt, MusicGamePlayComponent_set_perfectCnt_Hook); + HookManager::install(app::MusicGamePlayComponent_set_greatCnt, MusicGamePlayComponent_set_greatCnt_Hook); + HookManager::install(app::MusicGamePlayComponent_set_missCnt, MusicGamePlayComponent_set_missCnt_Hook); + HookManager::install(app::MusicGamePlayComponent_OnHit, MusicGamePlayComponent_OnHit_Hook); + } + + const FeatureGUIInfo& MusicEvent::GetGUIInfo() const + { + static const FeatureGUIInfo info{ "", "World", false }; + return info; + } + + void MusicEvent::DrawMain() + { + ConfigWidget(f_Enabled, "Enemies don't attack or use abilities against player. \n" + "May not work with some enemies or enemy abilites."); + } + + bool MusicEvent::NeedStatusDraw() const + { + return f_Enabled; + } + + void MusicEvent::DrawStatus() + { + ImGui::Text("Music Event"); + } + + MusicEvent& MusicEvent::GetInstance() + { + static MusicEvent instance; + return instance; + } + + static void MusicGamePlayComponent_OnStart_Hook(app::MusicGamePlayComponent * __this, app::BeatMapData* beatMapData, app::MusicMetaInfo* musicMetaInfo, MethodInfo* method) + { + MusicEvent& MusicEvent = MusicEvent::GetInstance(); + if (MusicEvent.f_Enabled) + { + __this->fields._combo = 9999999; + __this->fields._score_k__BackingField = 9999999; + __this->fields._maxCombo_k__BackingField = 9999999; + __this->fields._perfectCnt_k__BackingField = 9999999; + __this->fields._greatCnt_k__BackingField = 9999999; + __this->fields._missCnt_k__BackingField = 0; + } + CALL_ORIGIN(MusicGamePlayComponent_OnStart_Hook, __this, beatMapData, musicMetaInfo, method); + } + + static void MusicGamePlayComponent_OnMiss_Hook(app::MusicGamePlayComponent* __this, MethodInfo* method) + { + MusicEvent& MusicEvent = MusicEvent::GetInstance(); + if (MusicEvent.f_Enabled) + { + return; + } + CALL_ORIGIN(MusicGamePlayComponent_OnMiss_Hook, __this, method); + } + + static void MusicGamePlayComponent_set_combo_Hook(app::MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method) + { + MusicEvent& MusicEvent = MusicEvent::GetInstance(); + if (MusicEvent.f_Enabled) + { + value = 999999999; + } + CALL_ORIGIN(MusicGamePlayComponent_set_combo_Hook, __this, value, method); + } + + static void MusicGamePlayComponent_set_score_Hook(app::MusicGamePlayComponent* __this, float value, MethodInfo* method) + { + MusicEvent& MusicEvent = MusicEvent::GetInstance(); + if (MusicEvent.f_Enabled) + { + value = 999999999; + } + CALL_ORIGIN(MusicGamePlayComponent_set_score_Hook, __this, value, method); + } + static void MusicGamePlayComponent_set_maxCombo_Hook(app::MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method) + { + MusicEvent& MusicEvent = MusicEvent::GetInstance(); + if (MusicEvent.f_Enabled) + { + value = 999999999; + } + CALL_ORIGIN(MusicGamePlayComponent_set_maxCombo_Hook, __this, value, method); + } + static void MusicGamePlayComponent_set_perfectCnt_Hook(app::MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method) + { + MusicEvent& MusicEvent = MusicEvent::GetInstance(); + if (MusicEvent.f_Enabled) + { + value = 999999999; + } + CALL_ORIGIN(MusicGamePlayComponent_set_perfectCnt_Hook, __this, value, method); + } + static void MusicGamePlayComponent_set_greatCnt_Hook(app::MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method) + { + MusicEvent& MusicEvent = MusicEvent::GetInstance(); + if (MusicEvent.f_Enabled) + { + value = 999999999; + } + CALL_ORIGIN(MusicGamePlayComponent_set_greatCnt_Hook, __this, value, method); + } + static void MusicGamePlayComponent_set_missCnt_Hook(app::MusicGamePlayComponent* __this, uint32_t value, MethodInfo* method) + { + MusicEvent& MusicEvent = MusicEvent::GetInstance(); + if (MusicEvent.f_Enabled) + { + value = 0; + } + CALL_ORIGIN(MusicGamePlayComponent_set_missCnt_Hook, __this, value, method); + } + static void MusicGamePlayComponent_OnHit_Hook(app::MusicGamePlayComponent* __this, float score, MethodInfo* method) + { + MusicEvent& MusicEvent = MusicEvent::GetInstance(); + if (MusicEvent.f_Enabled) + { + score = 999999999; + } + CALL_ORIGIN(MusicGamePlayComponent_OnHit_Hook, __this, score, method); + } +} + diff --git a/cheat-library/src/user/cheat/world/MusicEvent.h b/cheat-library/src/user/cheat/world/MusicEvent.h new file mode 100644 index 0000000..336b059 --- /dev/null +++ b/cheat-library/src/user/cheat/world/MusicEvent.h @@ -0,0 +1,25 @@ +#pragma once +#include +#include + +namespace cheat::feature +{ + + class MusicEvent : public Feature + { + public: + config::Field> f_Enabled; + + static MusicEvent& GetInstance(); + + const FeatureGUIInfo& GetGUIInfo() const override; + void DrawMain() override; + + virtual bool NeedStatusDraw() const override; + void DrawStatus() override; + + private: + MusicEvent(); + }; +} +