-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathPackets.hpp
More file actions
42 lines (32 loc) · 798 Bytes
/
Packets.hpp
File metadata and controls
42 lines (32 loc) · 798 Bytes
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
#pragma once
#include "PacketBuilder.hpp"
#include <queue>
#include <random>
namespace PacketHelper
{
std::string randomStr(size_t size);
std::wstring randomWStr(size_t size);
uint16_t changeEndianness16(UINT16 val);
int32_t changeEndianness32(int32_t val);
LPBYTE ToPacketFormat(CHAR* input);
std::string ToString(LPBYTE packetStr, int byteLength);
int GetPacketLength(CHAR* input);
int rand_lim(int limit);
BOOL CreatePacket(LPBYTE data, UINT length);
BOOL CreateRecvPacket(LPBYTE data, DWORD length);
};
struct OutPacket {
DWORD dwLength;
unsigned char bData[8192];
};
typedef enum PacketDirection {
in,
out
};
struct ModifyRule {
PacketDirection direction;
int len;
char* pattern;
uint8_t* replacement;
uint16_t opcode;
};