-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.h
51 lines (42 loc) · 853 Bytes
/
server.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include "stdint.h"
constexpr auto packet_magic = 0x54456885;
constexpr auto server_ip = 0x7F000001; // 127.0.0.1
constexpr auto server_port = 69685;
enum class PacketType
{
packet_copy_memory,
packet_get_base_address,
packet_completed
};
struct PacketCopyMemory
{
uint32_t dest_process_id;
uint64_t dest_address;
uint32_t src_process_id;
uint64_t src_address;
uint32_t size;
};
struct PacketGetBaseAddress
{
uint32_t process_id;
};
struct PackedCompleted
{
uint64_t result;
};
struct PacketHeader
{
uint32_t magic;
PacketType type;
};
struct Packet
{
PacketHeader header;
union
{
PacketCopyMemory copy_memory;
PacketGetBaseAddress get_base_address;
PackedCompleted completed;
} data;
};