From 3d412a4b30a9f7c7f51ea6562e694315948bd3da Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 28 Nov 2018 16:00:02 +1300 Subject: cleaned up in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever. i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64 --- cheat/gmod/send_datagram.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 cheat/gmod/send_datagram.cpp (limited to 'cheat/gmod/send_datagram.cpp') diff --git a/cheat/gmod/send_datagram.cpp b/cheat/gmod/send_datagram.cpp new file mode 100644 index 0000000..dc55887 --- /dev/null +++ b/cheat/gmod/send_datagram.cpp @@ -0,0 +1,29 @@ +#include "base_cheat.hpp" +#include "hooks.hpp" + +int __fastcall hooks::send_datagram( INetChannel* channel, void* edx_, void* datagram ) { + auto send_datagram_o = g_csgo.m_net_channel->get_old_function< decltype( &hooks::send_datagram ) >( 48 ); + if( g_csgo.m_panic || !g_settings.misc.net_fakelag || datagram ) { + return send_datagram_o( channel, 0, datagram ); + } + + int backup_state = channel->m_nInReliableState; + int backup_sequence = channel->m_nInSequenceNr; + //int backup_o_state = channel->m_nOutReliableState; + + if( g_settings.misc.net_fakelag != 4 && g_settings.misc.net_fakeping_amount ) + g_cheat.m_extra.add_latency( channel ); + + auto nci = g_csgo.m_engine( )->GetNetChannelInfo( ); + if( nci && g_settings.misc.net_fakelag == 4 && g_cheat.m_ragebot.can_fakeping( ) ) { + channel->m_nInReliableState = backup_state; + channel->m_nInSequenceNr = backup_sequence + 10; + } + + int ret = send_datagram_o( channel, 0, datagram ); + + channel->m_nInReliableState = backup_state; + channel->m_nInSequenceNr = backup_sequence; + + return ret; +} \ No newline at end of file -- cgit v1.2.3