Import patches from IW6x

This commit is contained in:
momo5502 2021-04-20 15:17:30 +02:00
parent 455e84d950
commit 2c01821a0e

View 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)