-
Notifications
You must be signed in to change notification settings - Fork 8
/
instruction_prefix.hpp
71 lines (44 loc) · 997 Bytes
/
instruction_prefix.hpp
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#pragma once
// STD
#include <array>
#include <vector>
namespace x86
{
class prefix
{
public:
prefix() : m_buffer() {}
bool has(std::uint8_t prefix);
void append(std::uint8_t prefix);
using vector_iter_t = std::vector<std::uint8_t>::const_iterator;
vector_iter_t begin();
vector_iter_t end();
static bool is(std::uint8_t prefix);
using prefix_list_t = std::array<std::uint8_t, 14>;
static const prefix_list_t list;
enum id
{
LOCK = 0xF0,
REPNE = 0xF2,
REP = 0xF3,
BOUND = 0xF2,
CS_OVERRIDE = 0x2E,
SS_OVERRIDE = 0x36,
DS_OVERRIDE = 0x3E,
ES_OVERRIDE = 0x26,
FS_OVERRIDE = 0x64,
GS_OVERRIDE = 0x65,
BR_NOT_TAKEN = 0x2E,
BR_TAKEN = 0x3E,
OPERAND_SIZE_OVERRIDE = 0x66,
ADDRESS_SIZE_OVERRIDE = 0x67
};
private:
// ACCESSORS
std::vector<std::uint8_t>& buffer();
// PRIVATE MEMBERS
// PREFIX BUFFER
// MAYBE USE BITMAP?
std::vector<std::uint8_t> m_buffer;
};
};