summaryrefslogtreecommitdiff
path: root/csgo-loader/csgo-server/RemoteCode/RemoteCodeServer.hpp
blob: dde8b7dde782bc804f98e31c4ecba713f04de049 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#include <cstdint>
#include <vector>
#include <algorithm>

using ByteArray = std::vector<uint8_t>;

namespace RemoteCode
{
	struct RemoteCodeParameters
	{
		uintptr_t m_EndSceneVmt;
		uintptr_t m_OriginalEndScene;
		uintptr_t m_EntryPoint;
		uintptr_t m_CheatHeader;
		uintptr_t m_VirtualProtect;
	};

	class RemoteCodeServer
	{
		ByteArray m_CustomCode;

		// swoo
		uintptr_t GetOffsetByPattern(ByteArray &Data, ByteArray Pattern);

	public:
		RemoteCodeServer() = default;

		// Send client the prepared shellcode.
		// This will also send the original and vmt address of endscene.
		bool Start(ByteArray &Parameters);

		// Get the response for the client
		ByteArray GetShellcode();
	};
}