-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCPatchEngine.h
More file actions
43 lines (32 loc) · 964 Bytes
/
CPatchEngine.h
File metadata and controls
43 lines (32 loc) · 964 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
43
#ifndef _CPATCHENGINE_
#define _CPATCHENGINE_
#ifndef _WINDOWS_
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
#ifndef _INC_STDIO
#include "stdio.h"
#endif
class CPatchEngine
{
public:
CPatchEngine();
static CPatchEngine *Instance();
void WriteByte(BYTE *pAddress, BYTE pData);
void WriteInt16(BYTE *pAddress, Int16 pData);
void WriteInt32(BYTE *pAddress, Int32 pData);
void WriteInt64(BYTE *pAddress, Int64 pData);
void WriteArray(BYTE *pAddress, LPCVOID pData, Int32 iLen);
void WritePointer(BYTE *pAddress, Int32 pPointerAddr);
void WriteUnicodeString(BYTE *pAddress, WChar *pData);
void WriteAnsiString(BYTE *pAddress, Char *pData);
void WriteJump(BYTE *pAddress, DWORD *pNewFunc);
void WriteCall(BYTE *pAddress, DWORD *pNewFunc);
void WriteNops(BYTE *pAddress, Int32 iNopCount);
~CPatchEngine();
private:
void WriteMemory(BYTE *pAddress, LPCVOID pData, SIZE_T nSize);
HANDLE hL2Server;
HANDLE hToken;
};
#endif