Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- -----------------------------------------
- * Game hacking QTS ( Quickie Tip Series )
- * no. 33 - Determining if a hooked function is called from your module
- -----------------------------------------
- * Author: SEGnosis
- * Thanks to:
- * bitterbanana - No known site
- * Drunken Cheetah - No known site
- * fatboy88 - No known site
- * Geek4Ever - No known site
- * learn_more - www.uc-forum.com
- * Novocaine - http://ilsken.net/blog/?page_id=64
- * Philly0494 - No known site
- * Roverturbo - www.uc-forum.com
- * SilentKarma - www.halocoders.com - offline
- * Strife - www.uc-forum.com
- * Wieter20 - No known site
- */
- //----------------------------------//
- bool IsCalledWithinModule(HMODULE hModule, DWORD dwModuleSize)
- {
- DWORD dwTemp;
- // Store the current ebp
- __asm
- {
- push eax
- mov eax, ebp
- mov dwTemp, eax
- pop eax
- }
- // Traverse up two call stacks
- dwTemp = **(DWORD**)dwTemp;
- // Read the return address
- dwTemp = *(DWORD*)(dwTemp + 4);
- return (dwTemp >= (DWORD)hModule && dwTemp <= ((DWORD)hModule + dwModuleSize));
- }
- //----------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement