-
Notifications
You must be signed in to change notification settings - Fork 8
/
hwbreakpoint.h
35 lines (32 loc) · 883 Bytes
/
hwbreakpoint.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
#pragma once
#ifndef HWBREAKPOINT_H
#define HWBREAKPOINT_H
#include "ntdll.h"
#include "hook.h"
#include "bypass.h"
#include <iostream>
#include <mutex>
#include <tlhelp32.h>
class HWBreakpoint {
public:
static enum class Condition {
Execute = 0,
Write = 1,
ReadWrite = 3
};
static inline void SetBits(ULONG_PTR& dw, int lowBit, int bits, int newValue);
static void SetConditionLen(int& len, int value);
static bool Set(void* address, int size, Condition when);
static void Clear(void* address);
static void ClearAll();
static void ThreadDetourExternal(DWORD threadId);
static void Init();
static void Terminate();
static void BuildTrampoline();
static void ThreadDeutor();
static void SetForThreads(std::unique_lock<std::mutex>& lock);
static void RegisterThread(DWORD tid);
static void WorkerThreadProc();
static bool ignoreNextThreadContextCall;
};
#endif