Classes | |
class | MemoryLocker |
Allows retreiving read/write access to read-only kernel memory. More... | |
Public Member Functions | |
FunctionPatch () | |
~FunctionPatch () | |
bool | Patch (void *pFunc, void *pNewFunc) |
Inserts the JMP instruction in the beginning of a function and stores the bytes being overwritten. | |
Static Private Member Functions | |
static void | _PatchFunction (void *pFunc, void *pDest) |
Replaces the first 5 bytes of a function by a JMP instruction. | |
Private Attributes | |
char | m_PreviousBytes [5] |
void * | m_pAddress |
This class represents a single patched function (with a JMP instruction inserted in the beginning). Typically, after creation the FunctionPatch::Patch() method should be called to patch a function. During patching, the class instance stores the data that was replaced by inserting a JMP and restores this data back when the object is deleted. That way, each patched function should have a corresponding FunctionPatch instance.
Definition at line 22 of file kdpatch.cpp.
FunctionPatch::FunctionPatch | ( | ) | [inline] |
Definition at line 90 of file kdpatch.cpp.
FunctionPatch::~FunctionPatch | ( | ) | [inline] |
static void FunctionPatch::_PatchFunction | ( | void * | pFunc, | |
void * | pDest | |||
) | [inline, static, private] |
Replaces the first 5 bytes of a function by a JMP instruction.
This method performs the actual patching and is internally used by Patch() method.
pFunc | Specifies the address of a function to be patched | |
pDest | Specifies the target address of the JMP instruction |
Definition at line 73 of file kdpatch.cpp.
bool FunctionPatch::Patch | ( | void * | pFunc, | |
void * | pNewFunc | |||
) | [inline] |
Inserts the JMP instruction in the beginning of a function and stores the bytes being overwritten.
pFunc | Specifies the address of a function to be patched | |
pNewFunc | Specifies the target address of the JMP instruction |
Definition at line 110 of file kdpatch.cpp.
void* FunctionPatch::m_pAddress [private] |
Definition at line 26 of file kdpatch.cpp.
char FunctionPatch::m_PreviousBytes[5] [private] |
Definition at line 25 of file kdpatch.cpp.