feat(hook): Add IsLoadoutAllowed hook to allow all loadout configurations

Add new hook function Hook_IsLoadoutAllowed to bypass loadout configuration restrictions
Register this hook in CHook_Loader to make it effective
This commit is contained in:
Am4191LOL
2026-02-25 16:49:32 +08:00
parent b516884c87
commit 17fe4e26e8
3 changed files with 18 additions and 0 deletions
@@ -21,6 +21,7 @@
#include <CS2/Hook/Hook_IsRelativeMouseMode.hpp> #include <CS2/Hook/Hook_IsRelativeMouseMode.hpp>
#include <CS2/Hook/Hook_UpdateInPVS.hpp> #include <CS2/Hook/Hook_UpdateInPVS.hpp>
#include <CS2/Hook/Hook_AntiTamper.hpp> #include <CS2/Hook/Hook_AntiTamper.hpp>
#include <CS2/Hook/Hook_IsLoadoutAllowed.hpp>
static CHook_Loader g_CHook_Loader{}; static CHook_Loader g_CHook_Loader{};
@@ -72,6 +73,7 @@ auto CHook_Loader::InstallSecondHook() -> bool
{ { XorStr( "Hook::IsRelativeMouseMode" ) , XorStr( "48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 0F B6 F2" ) , INPUTSYSTEM_DLL } , &Hook_IsRelativeMouseMode , reinterpret_cast<LPVOID*>( &IsRelativeMouseMode_o ) }, { { XorStr( "Hook::IsRelativeMouseMode" ) , XorStr( "48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 0F B6 F2" ) , INPUTSYSTEM_DLL } , &Hook_IsRelativeMouseMode , reinterpret_cast<LPVOID*>( &IsRelativeMouseMode_o ) },
{ { XorStr( "Hook::UpdateInPVS" ) , XorStr( "48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B D9 8B F2 48 8B 89 ? ? ? ? 48 8B 01 FF 50 ? 33 FF 48 85 C0 74 ? 48 8B 80 ? ? ? ? EB ? 48 8B C7 39 B8 ? ? ? ? 0F 8F ? ? ? ? 0F B6 48 ? 80 F9" ) , CLIENT_DLL } , &Hook_UpdateInPVS , reinterpret_cast<LPVOID*>( &UpdateInPVS_o ) }, { { XorStr( "Hook::UpdateInPVS" ) , XorStr( "48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B D9 8B F2 48 8B 89 ? ? ? ? 48 8B 01 FF 50 ? 33 FF 48 85 C0 74 ? 48 8B 80 ? ? ? ? EB ? 48 8B C7 39 B8 ? ? ? ? 0F 8F ? ? ? ? 0F B6 48 ? 80 F9" ) , CLIENT_DLL } , &Hook_UpdateInPVS , reinterpret_cast<LPVOID*>( &UpdateInPVS_o ) },
{ { XorStr( "Hook::AntiTamper" ) , XorStr( "40 53 41 57 48 83 EC ? 48 89 74 24 ? 48 8B F1" ) , CLIENT_DLL } , &Hook_AntiTamper , reinterpret_cast<LPVOID*>( &AntiTamper_o ) }, { { XorStr( "Hook::AntiTamper" ) , XorStr( "40 53 41 57 48 83 EC ? 48 89 74 24 ? 48 8B F1" ) , CLIENT_DLL } , &Hook_AntiTamper , reinterpret_cast<LPVOID*>( &AntiTamper_o ) },
{ {XorStr("Hook::IsLoadoutAllowed") , XorStr("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC ? 48 8B E9 48 8B 0D ? ? ? ? ? ? ? FF 50") , CLIENT_DLL } ,&Hook_IsLoadoutAllowed , reinterpret_cast<LPVOID*>(&IsLoadoutAllowed_o) , true , true }
}; };
return InstallHooks(); return InstallHooks();
@@ -0,0 +1,8 @@
#include "Hook_IsLoadoutAllowed.hpp"
auto Hook_IsLoadoutAllowed() -> bool
{
return true;
return IsLoadoutAllowed_o();
}
@@ -0,0 +1,8 @@
#pragma once
#include <common/Common.hpp>
auto Hook_IsLoadoutAllowed() -> bool;
using IsLoadoutAllowed_t = decltype(&Hook_IsLoadoutAllowed);
inline IsLoadoutAllowed_t IsLoadoutAllowed_o = nullptr;