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.

73 lines
2.6 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1993-1998
  5. //
  6. // File: ldrpatch.h
  7. //
  8. // Contents: Patch data structures
  9. //
  10. // History: 13-Oct-99 v-johnwh created
  11. // 15-Feb-00 markder Changed CHARs to WCHARs
  12. //
  13. //---------------------------------------------------------------------------
  14. #ifndef _LDRPATCH_H_
  15. #define _LDRPATCH_H_
  16. typedef struct _PATCHOP
  17. {
  18. DWORD dwOpcode; // opcode to be performed
  19. DWORD dwNextOpcode; // relative offset to next opcode
  20. #pragma warning( disable : 4200 )
  21. BYTE data[]; //data for this operation type is dependent on the operation code
  22. #pragma warning( default : 4200 )
  23. } PATCHOP, *PPATCHOP;
  24. typedef struct _RELATIVE_MODULE_ADDRESS
  25. {
  26. DWORD address; //relative address from beginning of loaded module
  27. BYTE reserved[3]; //reserved for system use
  28. WCHAR moduleName[32]; //module name for this address.
  29. } RELATIVE_MODULE_ADDRESS, *PRELATIVE_MODULE_ADDRESS;
  30. typedef struct _PATCHWRITEDATA
  31. {
  32. DWORD dwSizeData; //size of patch data in bytes
  33. RELATIVE_MODULE_ADDRESS rva; //relative address where this patch data is to be applied.
  34. #pragma warning( disable : 4200 )
  35. BYTE data[]; //patch data bytes.
  36. #pragma warning( default : 4200 )
  37. } PATCHWRITEDATA, *PPATCHWRITEDATA;
  38. typedef struct _PATCHMATCHDATA
  39. {
  40. DWORD dwSizeData; //size of matching data data in bytes
  41. RELATIVE_MODULE_ADDRESS rva; //relative address where this patch data is to be verified.
  42. #pragma warning( disable : 4200 )
  43. BYTE data[]; //Matching data bytes.
  44. #pragma warning( default : 4200 )
  45. } PATCHMATCHDATA, *PPATCHMATCHDATA;
  46. typedef struct _SETACTIVATEADDRESS
  47. {
  48. RELATIVE_MODULE_ADDRESS rva; //relative address where this patch data is to be applied.
  49. } SETACTIVATEADDRESS, *PSETACTIVATEADDRESS;
  50. typedef struct _HOOKPATCHINFO
  51. {
  52. DWORD dwHookAddress; // Address of a hooked function
  53. PSETACTIVATEADDRESS pData; // Pointer to the real patch data
  54. PVOID pThunkAddress; // Pointer to the call thunk
  55. struct _HOOKPATCHINFO *pNextHook;
  56. } HOOKPATCHINFO, *PHOOKPATCHINFO;
  57. typedef enum _PATCHOPCODES
  58. {
  59. PEND = 0, //no more opcodes
  60. PSAA, //Set Activate Address, SETACTIVATEADDRESS
  61. PWD, //Patch Write Data, PATCHWRITEDATA
  62. PNOP, //No Operation
  63. PMAT, //Patch match the matching bytes but do not replace the bytes.
  64. } PATCHOPCODES;
  65. #endif //_LDRPATCH_H_