From 96305db4e7495065c4ac9ebaed8f770cd216a6b3 Mon Sep 17 00:00:00 2001 From: Joaquin <67109235+Taiga74164@users.noreply.github.com> Date: Tue, 21 Jun 2022 02:09:01 -0600 Subject: [PATCH 1/4] Added filters --- cheat-library/src/appdata/il2cpp-types-ptr.h | 1 + cheat-library/src/appdata/il2cpp-types.h | 167 ++++++++++++++++++ .../src/user/cheat/player/GodMode.cpp | 53 +++++- 3 files changed, 219 insertions(+), 2 deletions(-) diff --git a/cheat-library/src/appdata/il2cpp-types-ptr.h b/cheat-library/src/appdata/il2cpp-types-ptr.h index 29ca488..dfe6565 100644 --- a/cheat-library/src/appdata/il2cpp-types-ptr.h +++ b/cheat-library/src/appdata/il2cpp-types-ptr.h @@ -12,6 +12,7 @@ DO_TYPEDEF(0x0967B508, Int32); // v 2.7 DO_TYPEDEF(0x0968AD88, LCChestPlugin); DO_TYPEDEF(0x09688FD8, SceneTreeObject); +DO_TYPEDEF(0x0969D1F8, MoleMole_ActorModifier); //// v 2.6 //DO_SINGLETONEDEF(0x0B3442D8, Singleton_1_MoleMole_MapModule_); diff --git a/cheat-library/src/appdata/il2cpp-types.h b/cheat-library/src/appdata/il2cpp-types.h index 90f8431..e21c02b 100644 --- a/cheat-library/src/appdata/il2cpp-types.h +++ b/cheat-library/src/appdata/il2cpp-types.h @@ -4118,6 +4118,10 @@ namespace app { uint16_t _value; }; + struct SimpleSafeInt16 { + uint16_t _value; + }; + struct Quaternion { float x; float y; @@ -11728,6 +11732,169 @@ namespace app { struct MoleMole_VCBaseSetDitherValue__Fields fields; }; + enum class MoleMole_Config_AbilityState__Enum : uint64_t { + None = 0x0000000000000000, + Invincible = 0x0000000000000001, + DenyLockOn = 0x0000000000000002, + IsGhostToAllied = 0x0000000000000004, + IsGhostToEnemy = 0x0000000000000008, + ElementBurning = 0x0000000000000010, + ElementWet = 0x0000000000000020, + ElementFrozen = 0x0000000000000080, + LockHP = 0x0000000000000200, + IgnoreTriggerBullet = 0x0000000000000400, + ElementShock = 0x0000000000000800, + Struggle = 0x0000000000001000, + ElementRock = 0x0000000000002000, + ElementIce = 0x0000000000008000, + ElementFreeze = 0x0000000000010000, + AttackUp = 0x0000000000020000, + DefenseUp = 0x0000000000040000, + SpeedUp = 0x0000000000080000, + DefenseDown = 0x0000000000100000, + SpeedDown = 0x0000000000200000, + ElementWind = 0x0000000000400000, + ElementElectric = 0x0000000000800000, + ElementFire = 0x0000000001000000, + NoHeal = 0x0000000002000000, + Limbo = 0x0000000004000000, + MuteTaunt = 0x0000000008000000, + ElementPetrifaction = 0x0000000010000000, + IgnoreAddEnergy = 0x0000000040000000, + ElementGrass = 0x0000000080000000, + ElementOverdose = 0x0000000100000000, + Corruption = 0x0000000200000000, + UnlockFrequencyLimit = 0x0000000400000000, + ElementDeadTime = 0x0000000800000000, + }; + + enum class MoleMole_Config_ModifierTimeScale__Enum : int32_t { + Owner = 0x00000000, + Level = 0x00000001, + }; + + enum class MoleMole_Config_ModifierStacking__Enum : int32_t { + Refresh = 0x00000000, + Unique = 0x00000001, + Prolong = 0x00000002, + RefreshAndAddDurability = 0x00000003, + Multiple = 0x00000004, + MultipleRefresh = 0x00000005, + MultipleRefreshNoRemove = 0x00000006, + MultipleAllRefresh = 0x00000007, + GlobalUnique = 0x00000008, + Overlap = 0x00000009, + RefreshUniqueDurability = 0x0000000a, + }; + + enum class MoleMole_Config_ConfigAbilityModifier_MoleMole_Config_ConfigAbilityModifier_ModifierMPBehavior__Enum : int32_t { + NormallySynced = 0x00000000, + MuteRemoteAuthorityOnly = 0x00000001, + }; + + struct __declspec(align(8)) MoleMole_Config_ConfigAbilityModifier__Fields { + MoleMole_Config_ModifierTimeScale__Enum _timeScale; + MoleMole_Config_ModifierStacking__Enum _stacking; + struct MoleMole_Config_ConfigModifierStackingOption* _stackingOption; + bool _isBuff; + bool _isDebuff; + struct String* _modifierName; + bool _isUnique; + struct MoleMole_Config_DynamicFloat* _duration; + ElementType__Enum _elementType; + struct MoleMole_Config_DynamicFloat* _elementDurability; + struct SimpleSafeFloat maxElementDurabilityRawNum; + struct SimpleSafeFloat purgeIncrementRawNum; + bool _isElementDurabilityMutable; + bool _forceTriggerBurning; + bool _overrideWeaponElement; + struct MoleMole_Config_DynamicFloat* _thinkInterval; + struct MoleMole_Config_ConfigAbilityMixin__Array* _modifierMixins; + bool _trimThinkInterval; + struct Dictionary_2_System_String_MoleMole_Config_DynamicFloat_* _properties; + MoleMole_Config_AbilityState__Enum _state; + struct MoleMole_Config_ConfigAbilityStateOption* _stateOption; + bool _muteStateDisplayEffect; + bool _applyAttackerWitchTimeRatio; + struct MoleMole_Config_ConfigAbilityAction__Array* _onAdded; + struct MoleMole_Config_ConfigAbilityAction__Array* _onRemoved; + struct MoleMole_Config_ConfigAbilityAction__Array* _onBeingHit; + struct MoleMole_Config_ConfigAbilityAction__Array* _onAttackLanded; + struct MoleMole_Config_ConfigAbilityAction__Array* _onHittingOther; + struct MoleMole_Config_ConfigAbilityAction__Array* _onThinkInterval; + struct MoleMole_Config_ConfigAbilityAction__Array* CLKOPBOIEEH; + struct MoleMole_Config_ConfigAbilityAction__Array* PBDDACFFPOE; + bool _onThinkIntervalIsFixedUpdate; + struct MoleMole_Config_ConfigAbilityAction__Array* _onKill; + struct MoleMole_Config_ConfigAbilityAction__Array* _onCrash; + struct MoleMole_Config_ConfigAbilityAction__Array* _onAvatarIn; + struct MoleMole_Config_ConfigAbilityAction__Array* _onAvatarOut; + struct MoleMole_Config_ConfigAbilityAction__Array* _onVehicleIn; + struct MoleMole_Config_ConfigAbilityAction__Array* _onVehicleOut; + struct MoleMole_Config_ConfigAbilityAction__Array* _onZoneEnter; + struct MoleMole_Config_ConfigAbilityAction__Array* _onZoneExit; + struct MoleMole_Config_ConfigAbilityAction__Array* _onReconnect; + struct MoleMole_Config_ConfigAbilityAction__Array* _onChangeAuthority; + struct MoleMole_Config_EntityType__Enum__Array* _forbiddenEntities; + bool _fireEventWhenApply; + bool _isDurabilityGlobal; + bool _tickThinkIntervalAfterDie; + bool _thinkIntervalIgnoreTimeScale; + bool _reduceDurablityIgnoreTimeScale; + bool _isLimitedProperties; + bool _forceSyncToRemote; + void* buffIDRawNum; + bool _retainWhenDurabilityIsZero; + struct OCDGDLOKFEB__Enum__Array* HFBALDBFOOH; + int32_t fullNameHashCode; + int32_t configLocalID; + MoleMole_Config_ConfigAbilityModifier_MoleMole_Config_ConfigAbilityModifier_ModifierMPBehavior__Enum mpBehavior; + bool isAuthorityOnly; + }; + + struct MoleMole_Config_ConfigAbilityModifier { + struct MoleMole_Config_ConfigAbilityModifier__Class* klass; + MonitorData* monitor; + struct MoleMole_Config_ConfigAbilityModifier__Fields fields; + }; + + struct MoleMole_ActorModifier__Fields { + void* _; + struct MoleMole_ActorAbility* parentAbility; + uint32_t parentAbilityInstanceID; + struct MoleMole_Config_ConfigAbility* _parentAbilityConfig; + uint32_t parentAbilityEntityID; + uint32_t _applyEntityId_k__BackingField; + struct MoleMole_LCAbility* owner; + struct MoleMole_Config_ConfigAbilityModifier* _config; + struct Dictionary_2_MoleMole_EncryptedString_System_Int32_* stackIndices; + int32_t _parentOwnedIx; + uint32_t instancedModifierID; + struct MoleMole_ActorModifier* attachedInstancedModifier; + uint32_t attachedModifierOwnerEntityId; + uint32_t attachedModifierInstancedModifierId; + bool attachedModifierIsServerBuff; + int32_t attachedModifierNameHash; + bool isAttachedParentAbility; + bool PBDIKHPKHLF; + struct Action_1_MoleMole_ActorModifier_* onDetached; + uint32_t serverBuffUid; + struct Action_1_Nullable_1_Single_* onDurabilityEmpty; + bool _isValid_k__BackingField; + uint64_t _modifierStartTime_k__BackingField; + bool isModifierInvalidByServer; + bool hasAddedAbilityState; + float thinkInterval; + float reduceElementRatio; + float PHKNIPMALFB; + }; + + struct MoleMole_ActorModifier { + struct MoleMole_ActorModifier__Class* klass; + MonitorData* monitor; + struct MoleMole_ActorModifier__Fields fields; + }; + #if !defined(_GHIDRA_) && !defined(_IDA_) } #endif diff --git a/cheat-library/src/user/cheat/player/GodMode.cpp b/cheat-library/src/user/cheat/player/GodMode.cpp index 484d3db..62b5ce6 100644 --- a/cheat-library/src/user/cheat/player/GodMode.cpp +++ b/cheat-library/src/user/cheat/player/GodMode.cpp @@ -98,9 +98,58 @@ namespace cheat::feature 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; + auto actorModifer = reinterpret_cast(arg); + auto argStr = actorModifer->fields._config->fields._modifierName; + std::string name; + if ((uint64_t)actorModifer->klass == *(uint64_t*)app::MoleMole_ActorModifier__TypeInfo) + { + uintptr_t MoleMole_ActorModifier = (uintptr_t)arg; + uintptr_t ConfigAbilityModifier = *(uintptr_t*)(MoleMole_ActorModifier + 0x68); + if (ConfigAbilityModifier) + { + app::String* modifierName = *(app::String**)(ConfigAbilityModifier + 0x28); + if (modifierName) + { + //printf("%p\n", MoleMole_ActorModifier); + //std::cout << "name = " << il2cppi_to_string(name).c_str() << std::endl; + name = il2cppi_to_string(modifierName).c_str(); + } + // Environmental damage filter: + // SERVER_ClimateAbility_Cold_Area -- Sheer cold + // SERVER_ClimateAbility_Cold_Lv1 -- Sheer cold + // SERVER_ClimateAbility_Cold_Lv2 -- Sheer cold + // SERVER_ClimateAbility_TsurumiMist_Area -- Electric debuff + // SERVER_ClimateAbility_TatariRegion_Area + // SERVER_ClimateAbility_TatariRegion_Lv1 -- Electric debuff + // SERVER_ClimateAbility_TatariRegion_Lv2 -- Electric debuff + // SERVER_ClimateAbility_SeiraiStorm_Area -- Serai Island + // SERVER_ClimateAbility_SeiraiStorm_Lv1 -- Serai Island + // SERVER_ClimateAbility_SeiraiStorm_Lv2 -- Serai Island + // SERVER_ClimateAbility_TsurumiMist_Area -- Tsurumi Island + // ElectricWaterAreaModifier -- All electric water in inazuma + // WaterAreaModifier - + // SeiraiThunder_Manager -- + // UNIQUE_Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldPredicated + // Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldAtk + // BlackMudAreaBuff_Avatar + // BlackMudAreaBuff_Avatar02 + } + } + + if (gm.f_AltGodMode) + { + if (name.find("BlackMud") != std::string::npos || + name.find("SERVER_ClimateAbility") != std::string::npos || + name.find("WaterAreaModifier") != std::string::npos || + name.find("SeiraiThunder") != std::string::npos || + name.find("UNIQUE_Monster_") != std::string::npos || + name.find("Monster_") != std::string::npos) + { + return FALSE; + } + } + std::cout << "" << name.c_str() << std::endl; return CALL_ORIGIN(MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook, __this, delay, arg, method); } } From 8085722f5943b26e5b06fd454b86ea1309336b6e Mon Sep 17 00:00:00 2001 From: Shichiha <77842398+Shichiha@users.noreply.github.com> Date: Tue, 21 Jun 2022 18:29:55 +0900 Subject: [PATCH 2/4] Update GodMode.cpp --- .../src/user/cheat/player/GodMode.cpp | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/cheat-library/src/user/cheat/player/GodMode.cpp b/cheat-library/src/user/cheat/player/GodMode.cpp index 62b5ce6..f085ffe 100644 --- a/cheat-library/src/user/cheat/player/GodMode.cpp +++ b/cheat-library/src/user/cheat/player/GodMode.cpp @@ -11,6 +11,14 @@ namespace cheat::feature 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); + std::vector v{ + "BlackMud", + "SERVER_ClimateAbility", + "WaterAreaModifier", + "SeiraiThunder", + "UNIQUE_Monster_", + "Monster_"}; + GodMode::GodMode() : Feature(), NFEX(f_Enabled, "God mode", "m_GodMode", "Player", false, false), NF(f_AltGodMode, "Alternative God Mode", "Player", false) @@ -101,7 +109,7 @@ namespace cheat::feature auto actorModifer = reinterpret_cast(arg); auto argStr = actorModifer->fields._config->fields._modifierName; std::string name; - + if ((uint64_t)actorModifer->klass == *(uint64_t*)app::MoleMole_ActorModifier__TypeInfo) { uintptr_t MoleMole_ActorModifier = (uintptr_t)arg; @@ -110,47 +118,39 @@ namespace cheat::feature { app::String* modifierName = *(app::String**)(ConfigAbilityModifier + 0x28); if (modifierName) - { - //printf("%p\n", MoleMole_ActorModifier); - //std::cout << "name = " << il2cppi_to_string(name).c_str() << std::endl; name = il2cppi_to_string(modifierName).c_str(); - } - // Environmental damage filter: - // SERVER_ClimateAbility_Cold_Area -- Sheer cold - // SERVER_ClimateAbility_Cold_Lv1 -- Sheer cold - // SERVER_ClimateAbility_Cold_Lv2 -- Sheer cold - // SERVER_ClimateAbility_TsurumiMist_Area -- Electric debuff - // SERVER_ClimateAbility_TatariRegion_Area - // SERVER_ClimateAbility_TatariRegion_Lv1 -- Electric debuff - // SERVER_ClimateAbility_TatariRegion_Lv2 -- Electric debuff - // SERVER_ClimateAbility_SeiraiStorm_Area -- Serai Island - // SERVER_ClimateAbility_SeiraiStorm_Lv1 -- Serai Island - // SERVER_ClimateAbility_SeiraiStorm_Lv2 -- Serai Island - // SERVER_ClimateAbility_TsurumiMist_Area -- Tsurumi Island - // ElectricWaterAreaModifier -- All electric water in inazuma - // WaterAreaModifier - - // SeiraiThunder_Manager -- - // UNIQUE_Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldPredicated - // Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldAtk - // BlackMudAreaBuff_Avatar - // BlackMudAreaBuff_Avatar02 } } if (gm.f_AltGodMode) - { - if (name.find("BlackMud") != std::string::npos || - name.find("SERVER_ClimateAbility") != std::string::npos || - name.find("WaterAreaModifier") != std::string::npos || - name.find("SeiraiThunder") != std::string::npos || - name.find("UNIQUE_Monster_") != std::string::npos || - name.find("Monster_") != std::string::npos) - { - return FALSE; - } - } - std::cout << "" << name.c_str() << std::endl; + for (auto& v : v) + if (name.find(v) != std::string::npos) + return false; + + LOG_DEBUG("%s", name.c_str()); return CALL_ORIGIN(MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook, __this, delay, arg, method); } } +// ____________________________________________________________________________________________________________ +// | Name | Description | +// |------------------------------------------------------------------------|-----------------------------------| +// | SERVER_ClimateAbility_Cold_Area | Sheer cold | +// | SERVER_ClimateAbility_Cold_Lv1 | Sheer cold | +// | SERVER_ClimateAbility_Cold_Lv2 | Sheer cold | +// | SERVER_ClimateAbility_TsurumiMist_Area | Electric debuff | +// | SERVER_ClimateAbility_TatariRegion_Area | Electric debuff | +// | SERVER_ClimateAbility_TatariRegion_Lv1 | Electric debuff | +// | SERVER_ClimateAbility_TatariRegion_Lv2 | Electric debuff | +// | SERVER_ClimateAbility_SeiraiStorm_Area | Serai Island | +// | SERVER_ClimateAbility_SeiraiStorm_Lv1 | Serai Island | +// | SERVER_ClimateAbility_SeiraiStorm_Lv2 | Serai Island | +// | SERVER_ClimateAbility_TsurumiMist_Area | Tsurumi Island | +// | ElectricWaterAreaModifier | All electric water in inazuma | +// | BlackMudAreaBuff_Avatar | | +// | BlackMudAreaBuff_Avatar02 | | +// | WaterAreaModifier | | +// | SeiraiThunder_Manager | | +// | UNIQUE_Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldPredicated | | +// | Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldAtk | | +// |------------------------------------------------------------------------|-----------------------------------| \ No newline at end of file From f9c6734239477c80b080a12e5833db9878db9bf8 Mon Sep 17 00:00:00 2001 From: Joaquin <67109235+Taiga74164@users.noreply.github.com> Date: Tue, 21 Jun 2022 04:45:44 -0600 Subject: [PATCH 3/4] Electrowater filter fix --- cheat-library/src/user/cheat/player/GodMode.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cheat-library/src/user/cheat/player/GodMode.cpp b/cheat-library/src/user/cheat/player/GodMode.cpp index f085ffe..da3807b 100644 --- a/cheat-library/src/user/cheat/player/GodMode.cpp +++ b/cheat-library/src/user/cheat/player/GodMode.cpp @@ -14,10 +14,10 @@ namespace cheat::feature std::vector v{ "BlackMud", "SERVER_ClimateAbility", - "WaterAreaModifier", + "ElectricWater", "SeiraiThunder", "UNIQUE_Monster_", - "Monster_"}; + "Monster_Shougun"}; GodMode::GodMode() : Feature(), NFEX(f_Enabled, "God mode", "m_GodMode", "Player", false, false), @@ -110,12 +110,13 @@ namespace cheat::feature auto argStr = actorModifer->fields._config->fields._modifierName; std::string name; - if ((uint64_t)actorModifer->klass == *(uint64_t*)app::MoleMole_ActorModifier__TypeInfo) + if ((uintptr_t)actorModifer->klass == *(uintptr_t*)app::MoleMole_ActorModifier__TypeInfo) { uintptr_t MoleMole_ActorModifier = (uintptr_t)arg; uintptr_t ConfigAbilityModifier = *(uintptr_t*)(MoleMole_ActorModifier + 0x68); if (ConfigAbilityModifier) { + //app::String* modifierName = actorModifer->fields._config->fields._modifierName; app::String* modifierName = *(app::String**)(ConfigAbilityModifier + 0x28); if (modifierName) name = il2cppi_to_string(modifierName).c_str(); @@ -127,7 +128,7 @@ namespace cheat::feature if (name.find(v) != std::string::npos) return false; - LOG_DEBUG("%s", name.c_str()); + //LOG_DEBUG("%s", name.c_str()); return CALL_ORIGIN(MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook, __this, delay, arg, method); } } From 3b8c96dc0ad367a315400ac196a6dedeeb96dfed Mon Sep 17 00:00:00 2001 From: CallowBlack Date: Tue, 21 Jun 2022 23:56:55 +0300 Subject: [PATCH 4/4] pr #150: fix structure & little refactor --- cheat-library/cheat-library.vcxproj | 3 +- cheat-library/src/appdata/il2cpp-types.h | 11 +- .../src/user/cheat/player/GodMode.cpp | 119 +++++++++--------- cheat-library/src/user/cheat/player/GodMode.h | 10 +- 4 files changed, 77 insertions(+), 66 deletions(-) diff --git a/cheat-library/cheat-library.vcxproj b/cheat-library/cheat-library.vcxproj index f4dabce..627186e 100644 --- a/cheat-library/cheat-library.vcxproj +++ b/cheat-library/cheat-library.vcxproj @@ -931,7 +931,8 @@ - "$(OutDir)injector.exe" powershell -nop -c "&amp; {sleep 15}" + "$(OutDir)injector.exe" +powershell -nop -c "& {sleep 20}" $(OutDir)_noexist.nope;%(Outputs) $(TargetPath);%(Inputs) diff --git a/cheat-library/src/appdata/il2cpp-types.h b/cheat-library/src/appdata/il2cpp-types.h index e21c02b..ca7e76a 100644 --- a/cheat-library/src/appdata/il2cpp-types.h +++ b/cheat-library/src/appdata/il2cpp-types.h @@ -11858,8 +11858,17 @@ namespace app { struct MoleMole_Config_ConfigAbilityModifier__Fields fields; }; + struct __declspec(align(8)) HKMHAGBLLMK__Fields { + struct MoleMole_BaseAbilityMixin__Array* JGLDNAPGGGC; + struct List_1_System_ValueTuple_2__1* JFLGBBBFBLF; + struct List_1_System_ValueTuple_2__2* EFOPNOEMFBI; + struct List_1_MoleMole_Config_ConfigAbilityAction__1* PGICFJEDMAE; + struct List_1_System_ValueTuple_3__1* CGBNAMBLDOE; + struct IList_1_MoleMole_BaseAbilityMixin_* LOGOJNMHLIF; + }; + struct MoleMole_ActorModifier__Fields { - void* _; + HKMHAGBLLMK__Fields _; struct MoleMole_ActorAbility* parentAbility; uint32_t parentAbilityInstanceID; struct MoleMole_Config_ConfigAbility* _parentAbilityConfig; diff --git a/cheat-library/src/user/cheat/player/GodMode.cpp b/cheat-library/src/user/cheat/player/GodMode.cpp index da3807b..bc1ae8d 100644 --- a/cheat-library/src/user/cheat/player/GodMode.cpp +++ b/cheat-library/src/user/cheat/player/GodMode.cpp @@ -6,19 +6,6 @@ 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); - - std::vector v{ - "BlackMud", - "SERVER_ClimateAbility", - "ElectricWater", - "SeiraiThunder", - "UNIQUE_Monster_", - "Monster_Shougun"}; - GodMode::GodMode() : Feature(), NFEX(f_Enabled, "God mode", "m_GodMode", "Player", false, false), NF(f_AltGodMode, "Alternative God Mode", "Player", false) @@ -64,7 +51,7 @@ namespace cheat::feature } // Attack immunity (return false when target is avatar, that mean avatar entity isn't attackable) - static bool Miscs_CheckTargetAttackable_Hook(app::BaseEntity* attacker, app::BaseEntity* target, MethodInfo* method) + bool GodMode::Miscs_CheckTargetAttackable_Hook(app::BaseEntity* attacker, app::BaseEntity* target, MethodInfo* method) { auto& gm = GodMode::GetInstance(); auto& manager = game::EntityManager::instance(); @@ -78,7 +65,7 @@ namespace cheat::feature // Raised when avatar fall on ground. // Sending fall speed, and how many time pass from gain max fall speed (~30m/s). // To disable fall damage reset reachMaxDownVelocityTime and decrease fall velocity. - static void VCHumanoidMove_NotifyLandVelocity_Hook(app::VCHumanoidMove* __this, app::Vector3 velocity, float reachMaxDownVelocityTime, MethodInfo* method) + void GodMode::VCHumanoidMove_NotifyLandVelocity_Hook(app::VCHumanoidMove* __this, app::Vector3 velocity, float reachMaxDownVelocityTime, MethodInfo* method) { auto& gm = GodMode::GetInstance(); if ((gm.f_Enabled || gm.f_AltGodMode) && -velocity.y > 13) @@ -92,7 +79,7 @@ namespace cheat::feature } // Analog function for disable attack damage (Thanks to Taiga74164) - static void LCBaseCombat_FireBeingHitEvent_Hook(app::LCBaseCombat* __this, uint32_t attackeeRuntimeID, app::AttackResult* attackResult, MethodInfo* method) + void GodMode::LCBaseCombat_FireBeingHitEvent_Hook(app::LCBaseCombat* __this, uint32_t attackeeRuntimeID, app::AttackResult* attackResult, MethodInfo* method) { auto& gm = GodMode::GetInstance(); auto& manager = game::EntityManager::instance(); @@ -103,55 +90,61 @@ namespace cheat::feature } // 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) + bool GodMode::MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook(app::ActorAbilityPlugin* __this, float delay, app::Object* arg, MethodInfo* method) { - auto& gm = GodMode::GetInstance(); - auto actorModifer = reinterpret_cast(arg); - auto argStr = actorModifer->fields._config->fields._modifierName; - std::string name; - - if ((uintptr_t)actorModifer->klass == *(uintptr_t*)app::MoleMole_ActorModifier__TypeInfo) - { - uintptr_t MoleMole_ActorModifier = (uintptr_t)arg; - uintptr_t ConfigAbilityModifier = *(uintptr_t*)(MoleMole_ActorModifier + 0x68); - if (ConfigAbilityModifier) - { - //app::String* modifierName = actorModifer->fields._config->fields._modifierName; - app::String* modifierName = *(app::String**)(ConfigAbilityModifier + 0x28); - if (modifierName) - name = il2cppi_to_string(modifierName).c_str(); - } - } + if (GetInstance().NeedBlockHanlerModifierThinkTimeUp(arg)) + return false; - if (gm.f_AltGodMode) - for (auto& v : v) - if (name.find(v) != std::string::npos) - return false; - - //LOG_DEBUG("%s", name.c_str()); return CALL_ORIGIN(MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook, __this, delay, arg, method); } -} -// ____________________________________________________________________________________________________________ -// | Name | Description | -// |------------------------------------------------------------------------|-----------------------------------| -// | SERVER_ClimateAbility_Cold_Area | Sheer cold | -// | SERVER_ClimateAbility_Cold_Lv1 | Sheer cold | -// | SERVER_ClimateAbility_Cold_Lv2 | Sheer cold | -// | SERVER_ClimateAbility_TsurumiMist_Area | Electric debuff | -// | SERVER_ClimateAbility_TatariRegion_Area | Electric debuff | -// | SERVER_ClimateAbility_TatariRegion_Lv1 | Electric debuff | -// | SERVER_ClimateAbility_TatariRegion_Lv2 | Electric debuff | -// | SERVER_ClimateAbility_SeiraiStorm_Area | Serai Island | -// | SERVER_ClimateAbility_SeiraiStorm_Lv1 | Serai Island | -// | SERVER_ClimateAbility_SeiraiStorm_Lv2 | Serai Island | -// | SERVER_ClimateAbility_TsurumiMist_Area | Tsurumi Island | -// | ElectricWaterAreaModifier | All electric water in inazuma | -// | BlackMudAreaBuff_Avatar | | -// | BlackMudAreaBuff_Avatar02 | | -// | WaterAreaModifier | | -// | SeiraiThunder_Manager | | -// | UNIQUE_Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldPredicated | | -// | Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldAtk | | -// |------------------------------------------------------------------------|-----------------------------------| \ No newline at end of file + bool GodMode::NeedBlockHanlerModifierThinkTimeUp(app::Object* arg) + { + if (!f_AltGodMode) + return false; + + auto actorModifier = CastTo(arg, *app::MoleMole_ActorModifier__TypeInfo); + if (actorModifier == nullptr) + return false; + + static std::vector modifierBlacklist + { + "BlackMud", + "SERVER_ClimateAbility", + "ElectricWater", + "SeiraiThunder", + "UNIQUE_Monster_", + "Monster_Shougun" + }; + + std::string modifierName = il2cppi_to_string(actorModifier->fields._config->fields._modifierName); + for (auto& forbiddenModifierName : modifierBlacklist) + if (modifierName.find(forbiddenModifierName) != std::string::npos) + return true; + + return false; + } + + // ____________________________________________________________________________________________________________ + // | Name | Description | + // |------------------------------------------------------------------------|-----------------------------------| + // | SERVER_ClimateAbility_Cold_Area | Sheer cold | + // | SERVER_ClimateAbility_Cold_Lv1 | Sheer cold | + // | SERVER_ClimateAbility_Cold_Lv2 | Sheer cold | + // | SERVER_ClimateAbility_TsurumiMist_Area | Electric debuff | + // | SERVER_ClimateAbility_TatariRegion_Area | Electric debuff | + // | SERVER_ClimateAbility_TatariRegion_Lv1 | Electric debuff | + // | SERVER_ClimateAbility_TatariRegion_Lv2 | Electric debuff | + // | SERVER_ClimateAbility_SeiraiStorm_Area | Serai Island | + // | SERVER_ClimateAbility_SeiraiStorm_Lv1 | Serai Island | + // | SERVER_ClimateAbility_SeiraiStorm_Lv2 | Serai Island | + // | SERVER_ClimateAbility_TsurumiMist_Area | Tsurumi Island | + // | ElectricWaterAreaModifier | All electric water in inazuma | + // | BlackMudAreaBuff_Avatar | | + // | BlackMudAreaBuff_Avatar02 | | + // | WaterAreaModifier | | + // | SeiraiThunder_Manager | | + // | UNIQUE_Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldPredicated | | + // | Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldAtk | | + // |------------------------------------------------------------------------|-----------------------------------| +} \ No newline at end of file diff --git a/cheat-library/src/user/cheat/player/GodMode.h b/cheat-library/src/user/cheat/player/GodMode.h index 79baf5a..94ce8ed 100644 --- a/cheat-library/src/user/cheat/player/GodMode.h +++ b/cheat-library/src/user/cheat/player/GodMode.h @@ -16,10 +16,18 @@ namespace cheat::feature const FeatureGUIInfo& GetGUIInfo() const override; void DrawMain() override; - virtual bool NeedStatusDraw() const override; + bool NeedStatusDraw() const override; void DrawStatus() override; private: + + bool NeedBlockHanlerModifierThinkTimeUp(app::Object* arg); + static bool MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook(app::ActorAbilityPlugin* __this, float delay, app::Object* arg, MethodInfo* method); + + static void LCBaseCombat_FireBeingHitEvent_Hook(app::LCBaseCombat* __this, uint32_t attackeeRuntimeID, app::AttackResult* attackResult, MethodInfo* method); + static void VCHumanoidMove_NotifyLandVelocity_Hook(app::VCHumanoidMove* __this, app::Vector3 velocity, float reachMaxDownVelocityTime, MethodInfo* method); + static bool Miscs_CheckTargetAttackable_Hook(app::BaseEntity* attacker, app::BaseEntity* target, MethodInfo* method); + GodMode(); }; }