From 6b849fdb2197682f538b72f077927d70a2e304b6 Mon Sep 17 00:00:00 2001 From: Jack Back Date: Sun, 31 Mar 2024 22:33:05 +0200 Subject: [PATCH] maint(network): very good fix --- src/client/component/network.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/client/component/network.cpp b/src/client/component/network.cpp index a895d9b..294ce58 100644 --- a/src/client/component/network.cpp +++ b/src/client/component/network.cpp @@ -97,6 +97,11 @@ namespace network // Rather than try and let the player in, just tell them they are a duplicate player and reject connection game::NET_OutOfBandPrint(game::NS_SERVER, from, "error\nYou are already connected to the server."); } + + void* memmove_stub(void* dest, const void* src, std::size_t count) + { + return std::memmove(dest, src, std::min(count, 1262)); + } } void on(const std::string& command, const callback& callback) @@ -275,6 +280,9 @@ namespace network // ignore built in "print" oob command for security reasons utils::hook::set(0x14020A723, 0xEB); + + // patch buffer overflow + utils::hook::call(0x1403DA8A4, memmove_stub); // NET_GetDeferredClientPacket } } };