mirror of
https://github.com/EricPlayZ/EGameTools.git
synced 2025-07-18 17:37:53 +08:00
- Added "Disable Safezone Restrictions" (Player)
- Added "E3 2019 Truck Chase - Tall Building" location (Teleport)
This commit is contained in:
@ -29,6 +29,7 @@
|
||||
<ClCompile Include="src\Engine\CVideoSettings.cpp" />
|
||||
<ClCompile Include="src\Engine\Engine_Hooks.cpp" />
|
||||
<ClCompile Include="src\Engine\Engine_Misc.cpp" />
|
||||
<ClCompile Include="src\GamePH\CoPlayerRestrictions.cpp" />
|
||||
<ClCompile Include="src\GamePH\DayNightCycle.cpp" />
|
||||
<ClCompile Include="src\GamePH\FreeCamera.cpp" />
|
||||
<ClCompile Include="src\GamePH\GameDI_PH.cpp" />
|
||||
@ -76,6 +77,7 @@
|
||||
<ClInclude Include="include\EGSDK\Engine\Engine_Misc.h" />
|
||||
<ClInclude Include="include\EGSDK\Exports.h" />
|
||||
<ClInclude Include="include\EGSDK\GamePH\CoBaseCameraProxy.h" />
|
||||
<ClInclude Include="include\EGSDK\GamePH\CoPlayerRestrictions.h" />
|
||||
<ClInclude Include="include\EGSDK\GamePH\DayNightCycle.h" />
|
||||
<ClInclude Include="include\EGSDK\GamePH\FreeCamera.h" />
|
||||
<ClInclude Include="include\EGSDK\GamePH\GameDI_PH.h" />
|
||||
|
@ -139,6 +139,9 @@
|
||||
<ClCompile Include="src\ClassHelpers.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\GamePH\CoPlayerRestrictions.cpp">
|
||||
<Filter>src\GamePH</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="include">
|
||||
@ -335,5 +338,8 @@
|
||||
<ClInclude Include="include\EGSDK\GamePH\GamePH_Hooks.h">
|
||||
<Filter>include\GamePH</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\EGSDK\GamePH\CoPlayerRestrictions.h">
|
||||
<Filter>include\GamePH</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
15
EGameSDK/include/EGSDK/GamePH/CoPlayerRestrictions.h
Normal file
15
EGameSDK/include/EGSDK/GamePH/CoPlayerRestrictions.h
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include <EGSDK\ClassHelpers.h>
|
||||
|
||||
namespace EGSDK::GamePH {
|
||||
class EGameSDK_API CoPlayerRestrictions {
|
||||
public:
|
||||
union {
|
||||
ClassHelpers::buffer<0x1F0, DWORD64> flags;
|
||||
};
|
||||
DWORD64* GetPlayerRestrictionsFlags(DWORD64* flagsOut);
|
||||
|
||||
static CoPlayerRestrictions* Get();
|
||||
static void SetInstance(void* instance);
|
||||
};
|
||||
}
|
@ -12,13 +12,20 @@ namespace EGSDK::GamePH {
|
||||
public:
|
||||
union {
|
||||
ClassHelpers::buffer<0xF0, Engine::CoPhysicsProperty*> pCoPhysicsProperty;
|
||||
ClassHelpers::buffer<0x3520, bool> restrictionsEnabled;
|
||||
ClassHelpers::buffer<0x35E9, bool> enableTPPModel1;
|
||||
ClassHelpers::buffer<0x35EA, bool> enableTPPModel2;
|
||||
};
|
||||
|
||||
static PlayerDI_PH* Get();
|
||||
static bool areRestrictionsEnabledByGame;
|
||||
|
||||
InventoryItem* GetCurrentWeapon(UINT indexMaybe);
|
||||
InventoryContainerDI* GetInventoryContainer();
|
||||
|
||||
bool EnablePlayerRestrictions(DWORD64* flags);
|
||||
bool DisablePlayerRestrictions(DWORD64* flags);
|
||||
bool HandlePlayerRestrictions();
|
||||
|
||||
static PlayerDI_PH* Get();
|
||||
};
|
||||
}
|
@ -60,34 +60,32 @@ namespace EGSDK {
|
||||
//AddOffset(OnUpdate_ChangeMap, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? 88 44 24 20 48 8B 84 24 ?? ?? ?? ?? 48 83 78 ?? ??", PatternType::RelativePointer, void*)
|
||||
//AddOffset(GetPlayerDI_PH, "gamedll_ph_x64_rwdi.dll", "40 53 48 83 EC ?? 48 8B 01 48 8B D9 FF 90 ?? ?? ?? ?? 84 C0 74 ?? 48 8B 83 ?? ?? ?? ?? 48 8B 88 ?? ?? ?? ?? 48 85 C9 74 ?? 48 83 B9 ?? ?? ?? ?? ?? 74 ?? 48 8B 81", Utils::SigScan::PatternType::Address, void*) // ShowTPPModelFunc2
|
||||
AddOffset(ShowTPPModelFunc3, "gamedll_ph_x64_rwdi.dll", "48 83 EC ?? 38 91 ?? ?? ?? ?? 74 ?? 88 91", Utils::SigScan::PatternType::Address, void*)
|
||||
//AddOffset(CalculateOutOfBoundsTimer, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 48 89 74 24 ?? 57 48 81 EC ?? ?? ?? ?? 0F B6 99", PatternType::Address, void*)
|
||||
AddOffset(IsNotOutOfMapBounds, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 41 56 41 57 48 83 EC ?? 4C 8B F9 48 85 D2", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(IsNotOutOfMissionBounds, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 83 EC ?? 48 8B F9 48 85 D2 74 ?? 48 8D 8A", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(ReloadJumps, "gamedll_ph_x64_rwdi.dll", "48 83 EC ?? E8 ?? ?? ?? ?? 48 8D 15", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(PlaySoundEvent, "gamedll_ph_x64_rwdi.dll", "4C 8B DC 49 89 5B ?? 49 89 73 ?? 57 48 81 EC ?? ?? ?? ?? 48 8B 44 24 ?? 48 8B F9 48 8B DA", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(CalculateFallHeight, "gamedll_ph_x64_rwdi.dll", "40 55 56 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 44 0F 29 9C 24", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(PlayerHealthModuleKillPlayer, "gamedll_ph_x64_rwdi.dll", "40 53 48 83 EC ?? 48 8B 01 48 8B D9 FF 90 ?? ?? ?? ?? 84 C0 74 ?? 48 8B 4B ?? 48 81 C1 ?? ?? ?? ?? 48 8B 01 FF 50", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(CanUseGrappleHook, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 01 0F B6 FA 48 8B D9 FF 90 ?? ?? ?? ?? F6 80", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(ReadPlayerJumpParams, "gamedll_ph_x64_rwdi.dll", "40 55 56 57 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 4C 8B B5", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(PlayerGetCurrentWeapon, "gamedll_ph_x64_rwdi.dll", "8B C2 48 8D 14 80 48 83 BC D1 ?? ?? ?? ?? ?? 74 ?? 48 8B 84 D1 ?? ?? ?? ?? C3 33 C0 C3 CC CC CC 8B C2", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(PlayerGetInventoryMoney, "gamedll_ph_x64_rwdi.dll", "8B C2 48 8B 44 C1", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(HandleInventoryItemsAmount, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 48 83 EC ?? 8B 29", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(SetNewWaypointLocation, "gamedll_ph_x64_rwdi.dll", "85 D2 78 ?? 48 89 74 24 ?? 57 48 83 EC ?? 49 8B F8", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(SetNewWaypointLocationWaypointIsSetBoolInstr, "gamedll_ph_x64_rwdi.dll", "C6 84 33 [?? ?? ?? ?? 01 48 8B 5C 24", Utils::SigScan::PatternType::Address, DWORD*)
|
||||
AddOffset(HandleHeadBob, "gamedll_ph_x64_rwdi.dll", "40 53 48 83 EC ?? 0F 29 74 24 ?? 48 8D 51 ?? 0F 29 7C 24 ?? 0F 28 F3 0F 28 FA F3 0F 11 74 24 ?? F3 0F 10 51 ?? 0F 28 D9 44 0F 29 44 24 ?? 48 8B D9 F3 0F 11 7C 24 ?? 44 0F 28 C1 E8 ?? ?? ?? ?? F3 0F 10 53 ?? 48 8D 53 ?? F3 0F 11 74 24 ?? 48 8D 4B ?? 41 0F 28 D8 F3 0F 11 7C 24 ?? E8 ?? ?? ?? ?? F3 0F 10 53 ?? 48 8D 53 ?? F3 0F 11 74 24 ?? 48 8D 4B ?? 41 0F 28 D8 F3 0F 11 7C 24 ?? E8 ?? ?? ?? ?? F3 0F 10 53", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(SomeFloatCalcFunc, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 81 EC ?? ?? ?? ?? F3 0F 10 0D", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(GetPlayerRestrictionsFlags, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 83 EC ?? 48 8B D9 48 8B FA 48 8B CA E8 ?? ?? ?? ?? 48 8B 4B", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(mEnablePlayerRestrictions, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 83 EC ?? 48 8B F9 E8 ?? ?? ?? ?? 48 8B C8 E8 ?? ?? ?? ?? 48 8B D8 48 85 C0 74 ?? 48 8D 54 24", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(mDisablePlayerRestrictions, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 56 48 83 EC ?? 48 8B F1 E8 ?? ?? ?? ?? 48 8B C8 E8 ?? ?? ?? ?? 48 8B D8 48 85 C0 74 ?? 48 8D 48 ?? 48 89 7C 24 ?? FF 15 ?? ?? ?? ?? 84 C0 75 ?? 48 8D 4B ?? FF 15 ?? ?? ?? ?? 84 C0 75 ?? 48 8D 96", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(EnablePlayerRestrictionsSubFunc, "gamedll_ph_x64_rwdi.dll", "40 53 48 83 EC ?? 48 8B D9 48 81 C1 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B CB 48 83 C4 ?? 5B E9 ?? ?? ?? ?? CC CC CC CC CC CC CC CC CC CC CC CC CC CC 40 57", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(DisablePlayerRestrictionsSubFunc, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 48 89 6C 24 ?? 56 57 41 54 41 56 41 57 48 83 EC ?? 0F B6 81", Utils::SigScan::PatternType::Address, void*)
|
||||
AddOffset(HandlePlayerRestrictions, "gamedll_ph_x64_rwdi.dll", "40 57 48 83 EC ?? 48 89 5C 24 ?? 48 8B F9 48 89 74 24 ?? 0F B6 B1", Utils::SigScan::PatternType::Address, void*) // sub func of m_EnableRestrictions sub funcs and m_DisableRestrictions sub funcs
|
||||
AddOffset(SetIsInCoSafeZone, "gamedll_ph_x64_rwdi.dll", "E8 [?? ?? ?? ?? E8 ?? ?? ?? ?? 48 85 C0 74 ?? E8 ?? ?? ?? ?? 48 8B C8 E8 ?? ?? ?? ?? 48 8B 5C 24 ?? 48 83 C4", Utils::SigScan::PatternType::RelativePointer, void*)
|
||||
//AddOffset(HandleHeadBob, "gamedll_ph_x64_rwdi.dll", "40 53 48 83 EC ?? 0F 29 74 24 ?? 48 8D 51 ?? 0F 29 7C 24 ?? 0F 28 F3 0F 28 FA F3 0F 11 74 24 ?? F3 0F 10 51 ?? 0F 28 D9 44 0F 29 44 24 ?? 48 8B D9 F3 0F 11 7C 24 ?? 44 0F 28 C1 E8 ?? ?? ?? ?? F3 0F 10 53 ?? 48 8D 53 ?? F3 0F 11 74 24 ?? 48 8D 4B ?? 41 0F 28 D8 F3 0F 11 7C 24 ?? E8 ?? ?? ?? ?? F3 0F 10 53 ?? 48 8D 53 ?? F3 0F 11 74 24 ?? 48 8D 4B ?? 41 0F 28 D8 F3 0F 11 7C 24 ?? E8 ?? ?? ?? ?? F3 0F 10 53", Utils::SigScan::PatternType::Address, void*)
|
||||
//AddOffset(SomeFloatCalcFunc, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 81 EC ?? ?? ?? ?? F3 0F 10 0D", Utils::SigScan::PatternType::Address, void*)
|
||||
//AddOffset(CompareAndUpdateFloat, "gamedll_ph_x64_rwdi.dll", "0F 2F C1 73 ?? 0F 28 C1 C3", Utils::SigScan::PatternType::Address, void*)
|
||||
//AddOffset(HandlePlayerImmunity, "gamedll_ph_x64_rwdi.dll", "48 8B C4 53 56 57 41 56 41 57", Utils::SigScan::PatternType::Address, void*)
|
||||
//AddOffset(HandlePlayerImmunity2, "gamedll_ph_x64_rwdi.dll", "40 55 56 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 8B F1 45 0F B6 F0", Utils::SigScan::PatternType::Address, void*)
|
||||
//AddOffset(HandleFallHeight, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 83 EC ?? 0F B6 FA 48 8B D9 0F B6 91", Utils::SigScan::PatternType::Address, void*)
|
||||
//AddOffset(HandlePlayerFall, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 83 EC ?? 0F 29 74 24 ?? 48 8B FA 0F 28 F2", Utils::SigScan::PatternType::Address, void*)
|
||||
//AddOffset(GetTimeWeatherSystem, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? 33 D2 48 8B C8 E8 ?? ?? ?? ?? 49 8D 4F 38", PatternType::RelativePointer, void*)
|
||||
//AddOffset(SetForcedWeather, "engine_x64_rwdi.dll", "89 51 68 C3 CC CC CC CC CC CC CC CC CC CC CC CC", PatternType::Address, void*)
|
||||
//AddOffset(GetCurrentWeather, "engine_x64_rwdi.dll", "48 8B 41 78 48 85 C0 75 0F", PatternType::Address, void*)
|
||||
//AddOffset(GetForwardVector, "engine_x64_rwdi.dll", "4C 8B 41 38 41 8B 40 48", PatternType::Address, void*)
|
||||
//AddOffset(IsLoading, "engine_x64_rwdi.dll", "48 8B 05 ?? ?? ?? ?? 48 8B 51 38", PatternType::Address, void*)
|
||||
//AddOffset(ShowUIManager, "engine_x64_rwdi.dll", "48 8B 0D ?? ?? ?? ?? E9 ?? ?? ?? ?? CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 48 8B 49 ?? E9 ?? ?? ?? ?? CC CC CC CC CC CC CC 40 53", PatternType::Address, void*)
|
||||
//AddOffset(GetGameTimeDelta, "engine_x64_rwdi.dll", "E8 [?? ?? ?? ?? F3 0F 59 05 ?? ?? ?? ?? F3 0F 58 03", PatternType::RelativePointer, void*)
|
||||
};
|
||||
|
||||
#undef AddOffset
|
||||
|
26
EGameSDK/src/GamePH/CoPlayerRestrictions.cpp
Normal file
26
EGameSDK/src/GamePH/CoPlayerRestrictions.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include <EGSDK\Offsets.h>
|
||||
#include <EGSDK\GamePH\CoPlayerRestrictions.h>
|
||||
#include <EGSDK\ClassHelpers.h>
|
||||
|
||||
namespace EGSDK::GamePH {
|
||||
static CoPlayerRestrictions* pCoPlayerRestrictions = nullptr;
|
||||
|
||||
DWORD64* CoPlayerRestrictions::GetPlayerRestrictionsFlags(DWORD64* flagsOut) {
|
||||
return Utils::Memory::SafeCallFunctionOffset<DWORD64*>(Offsets::Get_GetPlayerRestrictionsFlags, nullptr, this, flagsOut);
|
||||
}
|
||||
|
||||
static CoPlayerRestrictions* GetOffset_CoPlayerRestrictions() {
|
||||
if (!pCoPlayerRestrictions)
|
||||
return nullptr;
|
||||
if (!*reinterpret_cast<void**>(pCoPlayerRestrictions))
|
||||
return nullptr;
|
||||
return pCoPlayerRestrictions;
|
||||
}
|
||||
CoPlayerRestrictions* CoPlayerRestrictions::Get() {
|
||||
return ClassHelpers::SafeGetter<CoPlayerRestrictions>(GetOffset_CoPlayerRestrictions, false, false);
|
||||
}
|
||||
|
||||
void CoPlayerRestrictions::SetInstance(void* instance) {
|
||||
pCoPlayerRestrictions = reinterpret_cast<CoPlayerRestrictions*>(instance);
|
||||
}
|
||||
}
|
@ -6,6 +6,8 @@
|
||||
#include <EGSDK\ClassHelpers.h>
|
||||
|
||||
namespace EGSDK::GamePH {
|
||||
bool PlayerDI_PH::areRestrictionsEnabledByGame = false;
|
||||
|
||||
static InventoryItem* GetOffset_CurrentWeapon(PlayerDI_PH* pPlayerDI_PH, UINT indexMaybe) {
|
||||
return Utils::Memory::SafeCallFunctionOffset<InventoryItem*>(Offsets::Get_PlayerGetCurrentWeapon, nullptr, pPlayerDI_PH, indexMaybe);
|
||||
}
|
||||
@ -20,6 +22,16 @@ namespace EGSDK::GamePH {
|
||||
return ClassHelpers::SafeGetter<InventoryContainerDI>(GetOffset_InventoryContainerDI, false, true, this);
|
||||
}
|
||||
|
||||
bool PlayerDI_PH::EnablePlayerRestrictions(DWORD64* flags) {
|
||||
return Utils::Memory::SafeCallFunctionOffset<bool>(Offsets::Get_EnablePlayerRestrictionsSubFunc, false, this, flags);
|
||||
}
|
||||
bool PlayerDI_PH::DisablePlayerRestrictions(DWORD64* flags) {
|
||||
return Utils::Memory::SafeCallFunctionOffset<bool>(Offsets::Get_DisablePlayerRestrictionsSubFunc, false, this, flags);
|
||||
}
|
||||
bool PlayerDI_PH::HandlePlayerRestrictions() {
|
||||
return Utils::Memory::SafeCallFunctionOffset<bool>(Offsets::Get_HandlePlayerRestrictions, false, this);
|
||||
}
|
||||
|
||||
static PlayerDI_PH* GetOffset_PlayerDI_PH() {
|
||||
LocalClientDI* pLocalClientDI = LocalClientDI::Get();
|
||||
return pLocalClientDI ? pLocalClientDI->pPlayerDI_PH : nullptr;
|
||||
|
@ -157,6 +157,8 @@ I have some things planned for the next updates, but time will decide when I'll
|
||||
- Added "Camera Offset" sliders for camera position (Camera)
|
||||
- Added "Zoom In" with default key set to Q (Camera); this is similar to the zoom-in feature from Cyberpunk 2077
|
||||
- Added separate FOV sliders for each type of camera (Camera)
|
||||
- Added "Disable Safezone Restrictions" (Player)
|
||||
- Added "E3 2019 Truck Chase - Tall Building" location (Teleport)
|
||||
- Added "Disable Low Level Mouse Hook" for developer debugging purposes, or in case of performance issues on the end-user side (Debug)
|
||||
- Added "Disable Vftable Scanning" for developer debugging purposes, or in case of performance issues or class detection issues on the end-user side (Debug)
|
||||
- Added "Enable Debugging Console" for developer debugging purposes (Debug)
|
||||
|
@ -19,7 +19,7 @@ namespace EGT::Menu {
|
||||
extern ImGui::KeyBindOption disableOutOfBoundsTimer;
|
||||
extern ImGui::KeyBindOption nightrunnerMode;
|
||||
extern ImGui::KeyBindOption oneHandedMode;
|
||||
extern ImGui::KeyBindOption allowGrappleHookInSafezone;
|
||||
extern ImGui::KeyBindOption disableSafezoneRestrictions;
|
||||
extern ImGui::KeyBindOption disableAirControl;
|
||||
extern ImGui::Option playerVariables;
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace EGT::Config {
|
||||
{ "Menu:Keybinds", "DisableOutOfBoundsTimerToggleKey", Menu::Player::disableOutOfBoundsTimer.ToStringVKeyMap(), &Menu::Player::disableOutOfBoundsTimer, String },
|
||||
{ "Menu:Keybinds", "NightrunnerModeToggleKey", Menu::Player::nightrunnerMode.ToStringVKeyMap(), &Menu::Player::nightrunnerMode, String },
|
||||
{ "Menu:Keybinds", "OneHandedModeToggleKey", Menu::Player::oneHandedMode.ToStringVKeyMap(), &Menu::Player::oneHandedMode, String },
|
||||
{ "Menu:Keybinds", "AllowGrappleHookInSafezoneToggleKey", Menu::Player::allowGrappleHookInSafezone.ToStringVKeyMap(), &Menu::Player::allowGrappleHookInSafezone, String },
|
||||
{ "Menu:Keybinds", "DisableSafezoneRestrictionsToggleKey", Menu::Player::disableSafezoneRestrictions.ToStringVKeyMap(), &Menu::Player::disableSafezoneRestrictions, String },
|
||||
{ "Menu:Keybinds", "DisableAirControlToggleKey", Menu::Player::disableAirControl.ToStringVKeyMap(), &Menu::Player::disableAirControl, String },
|
||||
{ "Menu:Keybinds", "UnlimitedDurabilityToggleKey", Menu::Weapon::unlimitedDurability.ToStringVKeyMap(), &Menu::Weapon::unlimitedDurability, String },
|
||||
{ "Menu:Keybinds", "UnlimitedAmmoToggleKey", Menu::Weapon::unlimitedAmmo.ToStringVKeyMap(), &Menu::Weapon::unlimitedAmmo, String },
|
||||
@ -86,7 +86,7 @@ namespace EGT::Config {
|
||||
{ "Player:Misc", "DisableOutOfBoundsTimer", Menu::Player::disableOutOfBoundsTimer.GetValue(), &Menu::Player::disableOutOfBoundsTimer, OPTION },
|
||||
{ "Player:Misc", "NightrunnerMode", Menu::Player::nightrunnerMode.GetValue(), &Menu::Player::nightrunnerMode, OPTION },
|
||||
{ "Player:Misc", "OneHandedMode", Menu::Player::oneHandedMode.GetValue(), &Menu::Player::oneHandedMode, OPTION },
|
||||
{ "Player:Misc", "AllowGrappleHookInSafezone", Menu::Player::allowGrappleHookInSafezone.GetValue(), &Menu::Player::allowGrappleHookInSafezone, OPTION },
|
||||
{ "Player:Misc", "DisableSafezoneRestrictions", Menu::Player::disableSafezoneRestrictions.GetValue(), &Menu::Player::disableSafezoneRestrictions, OPTION },
|
||||
{ "Player:PlayerJumpParameters", "DisableAirControl", Menu::Player::disableAirControl.GetValue(), &Menu::Player::disableAirControl, OPTION },
|
||||
{ "Player:PlayerVariables", "Enabled", Menu::Player::playerVariables.GetValue(), &Menu::Player::playerVariables, OPTION },
|
||||
{ "Player:PlayerVariables", "LastSaveSCRPath", Menu::Player::saveSCRPath, &Menu::Player::saveSCRPath, String },
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <EGSDK\Offsets.h>
|
||||
#include <EGSDK\Utils\Hook.h>
|
||||
#include <EGSDK\GamePH\CoPlayerRestrictions.h>
|
||||
#include <EGSDK\GamePH\FreeCamera.h>
|
||||
#include <EGSDK\GamePH\GameDI_PH.h>
|
||||
#include <EGSDK\GamePH\GameDI_PH2.h>
|
||||
@ -168,15 +169,6 @@ namespace EGT::GamePH {
|
||||
} };
|
||||
#pragma endregion
|
||||
|
||||
#pragma region CanUseGrappleHook
|
||||
static EGSDK::Utils::Hook::MHook<void*, bool(*)(void*, bool), void*, bool> CanUseGrappleHookHook{ "CanUseGrappleHook", &EGSDK::Offsets::Get_CanUseGrappleHook, [](void* pInstance, bool a2) -> bool {
|
||||
if (Menu::Player::allowGrappleHookInSafezone.GetValue())
|
||||
return true;
|
||||
|
||||
return CanUseGrappleHookHook.ExecuteCallbacksWithOriginal(pInstance, a2);
|
||||
} };
|
||||
#pragma endregion
|
||||
|
||||
#pragma region ReadPlayerJumpParams
|
||||
static EGSDK::Utils::Hook::MHook<void*, DWORD64(*)(DWORD64, DWORD64, DWORD64, char, DWORD64*), DWORD64, DWORD64, DWORD64, char, DWORD64*> ReadPlayerJumpParamsHook{ "ReadPlayerJumpParams", &EGSDK::Offsets::Get_ReadPlayerJumpParams, [](DWORD64 a1, DWORD64 a2, DWORD64 a3, char a4, DWORD64* a5) -> DWORD64 {
|
||||
DWORD64 result = ReadPlayerJumpParamsHook.ExecuteCallbacksWithOriginal(a1, a2, a3, a4, a5);
|
||||
@ -214,6 +206,53 @@ namespace EGT::GamePH {
|
||||
} };
|
||||
#pragma endregion
|
||||
|
||||
#pragma region HandlePlayerRestrictions
|
||||
static EGSDK::Utils::Hook::MHook<void*, bool(*)(EGSDK::GamePH::PlayerDI_PH*), EGSDK::GamePH::PlayerDI_PH*> HandlePlayerRestrictionsHook{ "HandlePlayerRestrictions", &EGSDK::Offsets::Get_HandlePlayerRestrictions, [](EGSDK::GamePH::PlayerDI_PH* pPlayerDI_PH) -> bool {
|
||||
if (!pPlayerDI_PH)
|
||||
return HandlePlayerRestrictionsHook.ExecuteCallbacksWithOriginal(pPlayerDI_PH);
|
||||
if (!pPlayerDI_PH->areRestrictionsEnabledByGame)
|
||||
return HandlePlayerRestrictionsHook.ExecuteCallbacksWithOriginal(pPlayerDI_PH);
|
||||
|
||||
if (Menu::Player::disableSafezoneRestrictions.GetValue())
|
||||
pPlayerDI_PH->restrictionsEnabled = false;
|
||||
else if (!Menu::Player::disableSafezoneRestrictions.GetValue())
|
||||
pPlayerDI_PH->restrictionsEnabled = true;
|
||||
|
||||
return HandlePlayerRestrictionsHook.ExecuteCallbacksWithOriginal(pPlayerDI_PH);
|
||||
} };
|
||||
#pragma endregion
|
||||
|
||||
#pragma region mEnablePlayerRestrictions
|
||||
static EGSDK::Utils::Hook::MHook<void*, DWORD64(*)(EGSDK::GamePH::CoPlayerRestrictions*), EGSDK::GamePH::CoPlayerRestrictions*> mEnablePlayerRestrictionsHook{ "mEnablePlayerRestrictions", &EGSDK::Offsets::Get_mEnablePlayerRestrictions, [](EGSDK::GamePH::CoPlayerRestrictions* pCoPlayerRestrictions) -> DWORD64 {
|
||||
EGSDK::GamePH::CoPlayerRestrictions::SetInstance(pCoPlayerRestrictions);
|
||||
auto playerDI_PH = EGSDK::GamePH::PlayerDI_PH::Get();
|
||||
if (playerDI_PH)
|
||||
playerDI_PH->areRestrictionsEnabledByGame = true;
|
||||
|
||||
return mEnablePlayerRestrictionsHook.ExecuteCallbacksWithOriginal(pCoPlayerRestrictions);
|
||||
} };
|
||||
#pragma endregion
|
||||
|
||||
#pragma region mDisablePlayerRestrictions
|
||||
static EGSDK::Utils::Hook::MHook<void*, DWORD64(*)(EGSDK::GamePH::CoPlayerRestrictions*), EGSDK::GamePH::CoPlayerRestrictions*> mDisablePlayerRestrictionsHook{ "mDisablePlayerRestrictions", &EGSDK::Offsets::Get_mDisablePlayerRestrictions, [](EGSDK::GamePH::CoPlayerRestrictions* pCoPlayerRestrictions) -> DWORD64 {
|
||||
EGSDK::GamePH::CoPlayerRestrictions::SetInstance(pCoPlayerRestrictions);
|
||||
auto playerDI_PH = EGSDK::GamePH::PlayerDI_PH::Get();
|
||||
if (playerDI_PH)
|
||||
playerDI_PH->areRestrictionsEnabledByGame = false;
|
||||
|
||||
return mDisablePlayerRestrictionsHook.ExecuteCallbacksWithOriginal(pCoPlayerRestrictions);
|
||||
} };
|
||||
#pragma endregion
|
||||
|
||||
#pragma region SetIsInCoSafeZone
|
||||
static EGSDK::Utils::Hook::MHook<void*, DWORD64(*)(DWORD64*, UINT, DWORD64, bool, bool, bool), DWORD64*, UINT, DWORD64, bool, bool, bool> SetIsInCoSafeZoneHook{ "SetIsInCoSafeZone", &EGSDK::Offsets::Get_SetIsInCoSafeZone, [](DWORD64* pCoSafeZone, UINT a2, DWORD64 a3, bool a4, bool a5, bool a6) -> DWORD64 {
|
||||
if (Menu::Player::disableSafezoneRestrictions.GetValue())
|
||||
return 0;
|
||||
|
||||
return SetIsInCoSafeZoneHook.ExecuteCallbacksWithOriginal(pCoSafeZone, a2, a3, a4, a5, a6);
|
||||
} };
|
||||
#pragma endregion
|
||||
|
||||
#pragma region ByteHooks
|
||||
static unsigned char SaveGameCRCBoolCheckBytes[3] = { 0xB3, 0x01, 0x90 }; // mov bl, 01
|
||||
EGSDK::Utils::Hook::ByteHook<void*> SaveGameCRCBoolCheckHook{ "SaveGameCRCBoolCheck", &EGSDK::Offsets::Get_SaveGameCRCBoolCheck, SaveGameCRCBoolCheckBytes, sizeof(SaveGameCRCBoolCheckBytes) }; // and bl, dil
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <ImGuiFileDialog\ImGuiFileDialog.h>
|
||||
#include <EGSDK\Utils\Files.h>
|
||||
#include <EGSDK\Engine\CBulletPhysicsCharacter.h>
|
||||
#include <EGSDK\GamePH\CoPlayerRestrictions.h>
|
||||
#include <EGSDK\GamePH\FreeCamera.h>
|
||||
#include <EGSDK\GamePH\LevelDI.h>
|
||||
#include <EGSDK\GamePH\PlayerDI_PH.h>
|
||||
@ -16,6 +17,7 @@
|
||||
#include <EGSDK\GamePH\GamePH_Misc.h>
|
||||
#include <EGT\ImGui_impl\DeferredActions.h>
|
||||
#include <EGT\FileEmbeds\player_variables.scr.embed>
|
||||
#include <EGT\GamePH\GamePH_Hooks.h>
|
||||
#include <EGT\Config\Config.h>
|
||||
#include <EGT\Menu\Camera.h>
|
||||
#include <EGT\Menu\Menu.h>
|
||||
@ -38,7 +40,7 @@ namespace EGT::Menu {
|
||||
ImGui::KeyBindOption disableOutOfBoundsTimer{ VK_NONE };
|
||||
ImGui::KeyBindOption nightrunnerMode{ VK_F7 };
|
||||
ImGui::KeyBindOption oneHandedMode{ VK_NONE };
|
||||
ImGui::KeyBindOption allowGrappleHookInSafezone{ VK_NONE };
|
||||
ImGui::KeyBindOption disableSafezoneRestrictions{ VK_NONE };
|
||||
ImGui::KeyBindOption disableAirControl{ VK_NONE };
|
||||
ImGui::Option playerVariables{ false };
|
||||
|
||||
@ -438,6 +440,25 @@ namespace EGT::Menu {
|
||||
|
||||
playerImmunity = playerInfectionModule->immunity * 100.0f;
|
||||
}
|
||||
static void PlayerRestrictionsUpdate() {
|
||||
if (!disableSafezoneRestrictions.HasChanged())
|
||||
return;
|
||||
auto playerDI_PH = EGSDK::GamePH::PlayerDI_PH::Get();
|
||||
if (!playerDI_PH || !playerDI_PH->areRestrictionsEnabledByGame)
|
||||
return;
|
||||
auto coPlayerRestrictions = EGSDK::GamePH::CoPlayerRestrictions::Get();
|
||||
if (!coPlayerRestrictions)
|
||||
return;
|
||||
|
||||
DWORD64 tempFlags = 0;
|
||||
DWORD64* flagsPtr = coPlayerRestrictions->GetPlayerRestrictionsFlags(&tempFlags);
|
||||
if (flagsPtr)
|
||||
coPlayerRestrictions->flags = *flagsPtr;
|
||||
|
||||
disableSafezoneRestrictions.HasChangedTo(false) ? playerDI_PH->EnablePlayerRestrictions(&coPlayerRestrictions->flags.data) : playerDI_PH->DisablePlayerRestrictions(&coPlayerRestrictions->flags.data);
|
||||
|
||||
disableSafezoneRestrictions.SetPrevValue(disableSafezoneRestrictions.GetValue());
|
||||
}
|
||||
static void UpdateDisabledOptions() {
|
||||
freezePlayer.SetChangesAreDisabled(!EGSDK::Engine::CBulletPhysicsCharacter::Get());
|
||||
}
|
||||
@ -484,6 +505,7 @@ namespace EGT::Menu {
|
||||
PlayerPositionUpdate();
|
||||
PlayerHealthUpdate();
|
||||
PlayerImmunityUpdate();
|
||||
PlayerRestrictionsUpdate();
|
||||
|
||||
PlayerVarsUpdate();
|
||||
PlayerVarListValuesUpdate();
|
||||
@ -530,7 +552,7 @@ namespace EGT::Menu {
|
||||
ImGui::CheckboxHotkey("Nightrunner Mode", &nightrunnerMode, "Makes Aiden super-human/infected");
|
||||
ImGui::SameLine();
|
||||
ImGui::CheckboxHotkey("One-handed Mode", &oneHandedMode, "Removes Aiden's left hand");
|
||||
ImGui::CheckboxHotkey("Allow Grapple Hook in Safezone", &allowGrappleHookInSafezone, "Allows player to use grapple hook while in a safezone");
|
||||
ImGui::CheckboxHotkey("Disable Safezone Restrictions", &disableSafezoneRestrictions, "Disables all player restrictions inside a safezone, such as no jumping, climbing, weapons, etc.");
|
||||
|
||||
ImGui::SeparatorText("Player Jump Parameters");
|
||||
ImGui::CheckboxHotkey("Disable Air Control", &disableAirControl, "Disables the ability to change the player's direction of momentum while jumping (in-air)");
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
namespace EGT::Menu {
|
||||
namespace Teleport {
|
||||
std::string savedTeleportLocationsStr = "Bazaar - Highest Point:1944,123.6,932.8;Bazaar - Main Entrance:1962.9,50.1,927.9;Colonel Williams Stronghold - Main Entrance Bridge:994.3,22.8,-1138.6;Dynamo Cars Factory - Main Entrance:2295.9,-2.1,-78.6;Fish Eye - Player Safehouse:1180.4,32.4,-146.8;Fish Eye - Top of The Baloon:1122.6,98.8,-101.2;Observatory - Meeting Room:1951.2,-13.4,-329.6;Observatory - The 2 Domes (No Chemicals):1985.4,19.9,-357.2;Out of Bounds - Cut Road Quest:2693.3,-4.7,-241.5;PK Metro Station - Main Entrance:1886.9,50,628.9;PK Ship - Main Entrance:801.8,4.2,139.8;St. Paul Cathedral - GRE Entrance:463.4,4.2,-421;Tolga & Fatin Quest - Underground Loot Box:2343.9,12.2,-661.5;VNC Tower - \"V\" Logo:1434.2,4.3,-319.3;VNC Tower - Highest Player Safehouse:1424.7,354.6,-455;VNC Tower - Highest Point:1403.8,446.7,-389.8;X13 - Tunnel Near the City Walls Towards Facility:2407.9,36.2,-461.7;X13 - Underground Facility:2437.8,12.2,-649.9;X13 - Waltz Arena:2551.9,15.3,-569.1";
|
||||
std::string savedTeleportLocationsStr = "Bazaar - Highest Point:1944,123.6,932.8;Bazaar - Main Entrance:1962.9,50.1,927.9;Colonel Williams Stronghold - Main Entrance Bridge:994.3,22.8,-1138.6;Dynamo Cars Factory - Main Entrance:2295.9,-2.1,-78.6;Fish Eye - Player Safehouse:1180.4,32.4,-146.8;Fish Eye - Top of The Baloon:1122.6,98.8,-101.2;Observatory - Meeting Room:1951.2,-13.4,-329.6;Observatory - The 2 Domes (No Chemicals):1985.4,19.9,-357.2;Out of Bounds - Cut Road Quest:2693.3,-4.7,-241.5;PK Metro Station - Main Entrance:1886.9,50,628.9;PK Ship - Main Entrance:801.8,4.2,139.8;St. Paul Cathedral - GRE Entrance:463.4,4.2,-421;Tolga & Fatin Quest - Underground Loot Box:2343.9,12.2,-661.5;VNC Tower - \"V\" Logo:1434.2,4.3,-319.3;VNC Tower - Highest Player Safehouse:1424.7,354.6,-455;VNC Tower - Highest Point:1403.8,446.7,-389.8;X13 - Tunnel Near the City Walls Towards Facility:2407.9,36.2,-461.7;X13 - Underground Facility:2437.8,12.2,-649.9;X13 - Waltz Arena:2551.9,15.3,-569.1;E3 2019 Truck Chase - Tall Building:1019.6,43.6,-213.6";
|
||||
std::vector<TeleportLocation> savedTeleportLocations{};
|
||||
static std::vector<std::string> savedTeleportLocationNames{};
|
||||
static std::vector<const char*> savedTeleportLocationNamesPtrs{};
|
||||
|
Reference in New Issue
Block a user