-
Notifications
You must be signed in to change notification settings - Fork 229
/
Copy pathDataBreak.h
57 lines (52 loc) · 2.72 KB
/
DataBreak.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
52
53
54
55
56
57
//--------------------------------------------------------------------------------------
// DataBreak.h
//
// Advanced Technology Group (ATG)
// Copyright (C) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
#pragma once
#include <cstdint>
namespace ATG
{
namespace DataBreak
{
enum class ADDRESS_SIZE {
SIZE_1, // 1 byte
SIZE_2, // 2 bytes
SIZE_4, // 4 bytes
SIZE_8 // 8 bytes
};
enum class ADDRESS_OPERATION
{
EXECUTION, // A specific address was accessed for execution. This only applies to the first byte of a full instruction
READ_WRITE, // An address was either read from or written to
WRITE, // An address was written to
};
enum class DEBUG_REGISTER // There are only four slots available for hardware breakpoints
{
REGISTER_1,
REGISTER_2,
REGISTER_3,
REGISTER_4,
};
//************************************
// Method: SetHardwareBreakPointForThread
// FullName: ATG::DataBreak::SetHardwareBreakPointForThread
// Returns: bool indicating success or failure
// Parameter: void * thread Which thread to set the breakpoint for, can be the current thread, Windows HANDLE object
// Parameter: void * address The location in memory of the breakpoint
// Parameter: DEBUG_REGISTER debugRegister Which debug register slot to use on the processor, only 4 hardware breakpoints are supported
// Parameter: ADDRESS_OPERATION addressOperation What type of operation to break on
// Parameter: ADDRESS_SIZE addressSize How big is the memory location in questions, 1 byte, 2 bytes, etc.
//************************************
bool SetHardwareBreakPointForThread(void *thread, void *address, DEBUG_REGISTER debugRegister, ADDRESS_OPERATION addressOperation, ADDRESS_SIZE addressSize);
//************************************
// Method: ClearHardwareBreakPointForThread
// FullName: ATG::DataBreak::ClearHardwareBreakPointForThread
// Returns: bool indicating success or failure
// Parameter: void * thread Which thread to clear the breakpoint for, can be the current thread
// Parameter: DEBUG_REGISTER debugRegister Which debug register to use on the processor, only 4 hardware breakpoints are supported
//************************************
bool ClearHardwareBreakPointForThread(void *thread, DEBUG_REGISTER debugRegister);
}
}