Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 2002 Microsoft Corporation
  3. Module Name:
  4. Mutek.cpp
  5. Abstract:
  6. App passes NumberOfBytesRead as inside the block of memory they're reading.
  7. Notes:
  8. This is an app specific shim.
  9. History:
  10. 05/23/2002 linstev Created
  11. --*/
  12. #include "precomp.h"
  13. #include "strsafe.h"
  14. IMPLEMENT_SHIM_BEGIN(Mutek)
  15. #include "ShimHookMacro.h"
  16. APIHOOK_ENUM_BEGIN
  17. APIHOOK_ENUM_ENTRY(ReadProcessMemory)
  18. APIHOOK_ENUM_END
  19. /*++
  20. Buffer parameters so they don't get overwritten.
  21. --*/
  22. BOOL
  23. APIHOOK(ReadProcessMemory)(
  24. HANDLE hProcess,
  25. LPCVOID lpBaseAddress,
  26. LPVOID lpBuffer,
  27. DWORD nSize,
  28. LPDWORD lpNumberOfBytesRead
  29. )
  30. {
  31. __asm nop;
  32. BOOL bRet = ORIGINAL_API(ReadProcessMemory)(hProcess, lpBaseAddress, lpBuffer,
  33. nSize, lpNumberOfBytesRead);
  34. __asm nop;
  35. return bRet;
  36. }
  37. /*++
  38. Register hooked functions
  39. --*/
  40. HOOK_BEGIN
  41. APIHOOK_ENTRY(KERNEL32.DLL, ReadProcessMemory)
  42. HOOK_END
  43. IMPLEMENT_SHIM_END