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 --- loader/server/client.hpp | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 loader/server/client.hpp (limited to 'loader/server/client.hpp') diff --git a/loader/server/client.hpp b/loader/server/client.hpp new file mode 100644 index 0000000..1f577c7 --- /dev/null +++ b/loader/server/client.hpp @@ -0,0 +1,67 @@ +#pragma once + +#ifdef WIN64 +#include +#pragma comment(lib, "ws2_32.lib") +#else +#include +#include +#include +#include +#include +#include +#endif + + +#include +#include +#include +#include +#include +#include + + +#include "util.hpp" + +constexpr auto PORT_NUM = 6969; +constexpr auto BUFFER_SIZE = 255; + +namespace server +{ + class c_client { + SOCKET m_socket{ }; + in_addr m_address{ }; + ulong_t m_hwid{ }; + public: + c_client( SOCKET socket, in_addr& address ) : + m_socket( socket ), + m_address( address ) + { } + + ~c_client( ) { + kill( ); + } + + + void decode_buffer( uint8_t* buf, size_t length ) { + auto key = buf[ 0 ]; + for( size_t i{ 1 }; i < length; ++i ) + buf[ i ] ^= key; + } + + auto get_ip( ) { + return inet_ntoa( m_address ); + } + + void kill( ); + + //std::vector< byte > receive_message( ); + std::string get_msg( ); + bool send_msg( byte* msg, size_t length ); + bool send_msg( const char* ); + + //handles messages, hwid etc + void handle_buffer( byte* msg ); + virtual bool handle( ); + }; +} \ No newline at end of file -- cgit v1.2.3