-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathBreakpoint.h
More file actions
42 lines (34 loc) · 759 Bytes
/
Breakpoint.h
File metadata and controls
42 lines (34 loc) · 759 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 <Windows.h>
class Breakpoint
{
public:
enum Type
{
Exec = 0x0,
Write = 0x1,
ReadWrite = 0x3,
Size1 = 0x0,
Size2 = 0x4,
Size4 = 0xC,
Size8 = 0x8,
AccessMask = 0x3,
SizeMask = 0xC
};
Breakpoint(DWORD tid, void* addr, UCHAR type);
~Breakpoint();
bool set(void* addr, UCHAR type);
bool enable();
bool disable();
bool enabled() const { return m_nIndex >= 0 && m_nIndex < 4; }
void* addr() const { return m_pAddr; }
UCHAR type() const { return m_nType; }
UCHAR access() const { return m_nType & AccessMask; }
UCHAR size() const { return m_nType & SizeMask; }
HANDLE thread() const { return m_hThread; }
private:
HANDLE m_hThread;
void* m_pAddr;
UCHAR m_nType;
CHAR m_nIndex;
};