Hookapi.h
上传用户:chzmdj
上传日期:2007-01-22
资源大小:135k
文件大小:1k
源码类别:

源码/资料

开发平台:

C/C++

  1. // hookapi.h
  2. #ifndef _INC_HOOKAPI
  3. #define _INC_HOOKAPI
  4. #include <windows.h>
  5. #include "public.h"
  6. #define PC_WRITEABLE 0x00020000
  7. #define PC_USER 0x00040000
  8. #define PC_STATIC 0x20000000
  9. #define HOOK_NEED_CHECK 0
  10. #define HOOK_CAN_WRITE 1
  11. #define HOOK_ONLY_READ 2
  12. #define BUFFERLEN 7
  13. #define GETWORDEND_EVENT_NAME __TEXT("NH_GetWordEnd") //added by ZHHN 1999.12.30
  14. typedef struct _tagApiHookStruct
  15. {
  16. LPSTR  lpszApiModuleName;
  17. LPSTR  lpszApiName;
  18. DWORD  dwApiOffset;
  19. LPVOID lpWinApiProc;
  20. BYTE   WinApiFiveByte[7];
  21. LPSTR  lpszHookApiModuleName;
  22. LPSTR  lpszHookApiName;
  23. LPVOID lpHookApiProc;
  24. BYTE   HookApiFiveByte[7];
  25. HINSTANCE hInst;
  26. BYTE   WinApiBakByte[7];
  27. }
  28. APIHOOKSTRUCT, *LPAPIHOOKSTRUCT;
  29. FARPROC WINAPI NHGetFuncAddress(HINSTANCE hInst, LPCSTR lpMod, LPCSTR lpFunc);
  30. void MakeJMPCode(LPBYTE lpJMPCode, LPVOID lpCodePoint);
  31. void MakeMemCanWrite(LPVOID lpMemPoint, BOOL bCanWrite, int nSysMemStatus);
  32. void HookWin32Api(LPAPIHOOKSTRUCT lpApiHook, int nSysMemStatus);
  33. void RestoreWin32Api(LPAPIHOOKSTRUCT lpApiHook, int nSysMemStatus);
  34. #endif // _INC_HOOKAPI