Tutorial on basic function hooking by Patrickssj6
In this tutorial we are going to use C++ and injection DLL to hook the function which updates the time inside MS Minesweeper.
[flash 700,500]http://www.vivid-abstractions.net/downloads/InDem%20Present/Hooking%20Tutorial.swf?build=1[/flash]
Full screen video
The hooking function:
void WriteJMP(byte* location, byte* newFunction){
DWORD dwOldProtection;
VirtualProtect(location, 5, PAGE_EXECUTE_READWRITE, &dwOldProtection);
location[0] = 0xE9;
*((dword*)(location + 1)) = (dword)(newFunction - location) - 5;
VirtualProtect(location, 5, dwOldProtection, &dwOldProtection);
}