blob: 706c9ba54469814120bda3576fd12c590573a650 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#pragma once
#include <Windows.h>
#include <cstdint>
class Patcher
{
public:
void PatchBytes(BYTE* address, BYTE* shellcode, const int shellCodeSize, bool modifyPageProtection = true, DWORD newPageProtection = PAGE_EXECUTE_READWRITE, bool restorePageProtection = true);
void NOPBytes(BYTE* address, const int amount, bool modifyPageProtection = true, DWORD newPageProtection = PAGE_EXECUTE_READWRITE, bool restorePageProtection = true);
//TODO: template?
void Patch(BYTE* address, int8_t value);
void Patch(BYTE* address, int16_t value);
void Patch(BYTE* address, int32_t value);
void Patch(BYTE* address, int64_t value);
};
|