-
Notifications
You must be signed in to change notification settings - Fork 1
/
Offset.h
35 lines (28 loc) · 881 Bytes
/
Offset.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
#ifndef _OFFSET_H
#define _OFFSET_H
#define INST_INT3 0xCC
#define INST_CALL 0xE8
#define INST_NOP 0x90
#define INST_JMP 0xE9
#define INST_RET 0xC3
typedef struct PatchHook_t
{
void (*pFunc)(DWORD, DWORD, DWORD);
DWORD dwAddr;
DWORD dwFunc;
DWORD dwLen;
BYTE *bOldCode;
} PatchHook;
void DefineOffsets();
DWORD GetDllOffset(int num);
DWORD GetDllOffset(char *DllName, int Offset);
PatchHook *RetrievePatchHooks(PINT pBuffer);
void PatchBytes(DWORD dwAddr, DWORD dwValue, DWORD dwLen);
void PatchJmp(DWORD dwAddr, DWORD dwFunc, DWORD dwLen);
void PatchCall(DWORD dwAddr, DWORD dwFunc, DWORD dwLen);
void InterceptLocalCode(BYTE bInst, DWORD pAddr, DWORD pFunc, DWORD dwLen);
void FillBytes(void *pAddr, BYTE bFill, DWORD dwLen);
BOOL WriteBytes(void *pAddr, void *pData, DWORD dwLen);
void RemovePatchs();
void InstallPatchs();
#endif