iw5-mod/src/module/security.cpp

27 lines
563 B
C++
Raw Normal View History

2019-09-24 04:30:08 -04:00
#include <std_include.hpp>
2022-03-23 09:48:13 -04:00
#include <loader/module_loader.hpp>
#include <utils/hook.hpp>
2019-09-24 04:30:08 -04:00
#include "game/game.hpp"
class security final : public module
{
public:
void post_load() override
{
2019-09-24 05:46:47 -04:00
if (game::is_mp())
2019-09-24 04:30:08 -04:00
{
utils::hook(0x4AECD4, read_p2p_auth_ticket_stub, HOOK_JUMP).install()->quick();
}
}
private:
static void read_p2p_auth_ticket_stub(game::native::msg_t* msg, void* data, const int len)
{
if (len < 0) return;
return game::native::MSG_ReadData(msg, data, std::min(len, 200));
}
};
REGISTER_MODULE(security)