mirror of
https://github.com/XLabsProject/s1x-client.git
synced 2023-08-02 15:02:12 +02:00
Import patches from IW6x
This commit is contained in:
parent
455e84d950
commit
2c01821a0e
32
src/client/component/security.cpp
Normal file
32
src/client/component/security.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#include <std_include.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
#include <utils/hook.hpp>
|
||||
#include "game/game.hpp"
|
||||
|
||||
namespace security
|
||||
{
|
||||
namespace
|
||||
{
|
||||
void set_cached_playerdata_stub(const int localclient, const int index1, const int index2)
|
||||
{
|
||||
if (index1 >= 0 && index1 < 18 && index2 >= 0 && index2 < 42)
|
||||
{
|
||||
reinterpret_cast<void(*)(int, int, int)>(0x140536A60)(localclient, index1, index2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
void post_unpack() override
|
||||
{
|
||||
if (game::environment::is_sp()) return;
|
||||
|
||||
// Patch vulnerability in PlayerCards_SetCachedPlayerData
|
||||
utils::hook::call(0x1401BB909, set_cached_playerdata_stub);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
REGISTER_COMPONENT(security::component)
|
Loading…
Reference in New Issue
Block a user