41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
//globals
|
|
#pragma once
|
|
#ifndef _MEM_H
|
|
#define _MEM_H
|
|
|
|
#define Naked(Function) void __declspec(naked) Function()
|
|
|
|
namespace ASM
|
|
{
|
|
enum T
|
|
{
|
|
JMP = 0xE9,
|
|
JE = 0x74,
|
|
JNE = 0x75,
|
|
JGE = 0x7D,
|
|
NOP = 0x90,
|
|
CALL = 0xE8,
|
|
PUSH = 0x68,
|
|
};
|
|
};
|
|
|
|
DWORD WriteMemory(const LPVOID lpAddress, const LPVOID lpBuf, const UINT uSize);
|
|
DWORD ReadMemory(const LPVOID lpAddress, LPVOID lpBuf, const UINT uSize);
|
|
DWORD SetByte(const LPVOID dwOffset, const BYTE btValue);
|
|
DWORD GetByte(const LPVOID dwOffset, BYTE & btValue);
|
|
DWORD SetWord(const LPVOID dwOffset, const WORD wValue);
|
|
DWORD GetWord(const LPVOID dwOffset, WORD & wValue);
|
|
DWORD SetDword(const LPVOID dwOffset, const DWORD dwValue);
|
|
DWORD GetDword(const LPVOID dwOffset, DWORD & dwValue);
|
|
DWORD SetFloat(const LPVOID dwOffset, const float fValue);
|
|
DWORD GetFloat(const LPVOID dwOffset, float & fValue);
|
|
DWORD SetDouble(const LPVOID dwOffset, double dValue);
|
|
DWORD SetJg(const LPVOID dwEnterFunction, const LPVOID dwJMPAddress);
|
|
DWORD SetJa(const LPVOID dwEnterFunction, const LPVOID dwJMPAddress);
|
|
DWORD SetOp(const LPVOID dwEnterFunction, const LPVOID dwJMPAddress, BYTE cmd);
|
|
DWORD SetRange(const LPVOID dwAddress, const USHORT wCount, const BYTE btValue);
|
|
DWORD SetJmp(const LPVOID dwEnterFunction, const LPVOID dwJMPAddress);
|
|
void HookThis(DWORD dwMyFuncOffset, DWORD dwJmpOffset);
|
|
|
|
|
|
#endif |