From 77b52da44b263df4884be2f35f885d8edccbb6fa Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 19 Dec 2018 00:13:24 +1300 Subject: added new loader project :) merry christmas --- csgo-loader/csgo-client/Networking/TCPClient.hpp | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 csgo-loader/csgo-client/Networking/TCPClient.hpp (limited to 'csgo-loader/csgo-client/Networking/TCPClient.hpp') diff --git a/csgo-loader/csgo-client/Networking/TCPClient.hpp b/csgo-loader/csgo-client/Networking/TCPClient.hpp new file mode 100644 index 0000000..f057cdc --- /dev/null +++ b/csgo-loader/csgo-client/Networking/TCPClient.hpp @@ -0,0 +1,39 @@ +#pragma once + +// For encryption wrappers. +#include + +// WinSocks +#include +#pragma comment(lib, "ws2_32.lib") + +// std::min +#include + +namespace Networking { + // A TCPClient is essentially the same as the TCPConnection counterpart on the server, + // however, it independently handles connection. + class TCPClient { + WSADATA m_WinSocks; + SOCKET m_Socket; + sockaddr_in m_Context; + Wrapper::Encryption m_Encryption; + + public: + TCPClient() = default; + + // Connects to a remote server. + // Also handles the initial handshake between server and client. + bool Start(uint32_t ServerAddress, uint16_t ServerPort); + + // Kills the client. + void Kill(); + + // Wrappers for sending/receiving data. + void SendRawBytes(ByteArray &Bytes); + ByteArray ReceiveRawBytes(); + + void SendBytes(ByteArray &Bytes); + ByteArray ReceiveBytes(); + }; +} \ No newline at end of file -- cgit v1.2.3