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.

87 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. ImportTableHash.h
  5. Abstract:
  6. This module contains hash computation routine
  7. RtlComputeImportTableHash to compute the hash
  8. based on the import table of an exe.
  9. Author:
  10. Vishnu Patankar (vishnup) 31-May-2001
  11. Revision History:
  12. --*/
  13. #ifndef _ITH_
  14. #define _ITH_
  15. #include <nt.h>
  16. #include <ntrtl.h>
  17. #include <nturtl.h>
  18. #include <windows.h>
  19. #include <wincrypt.h>
  20. #include <stdio.h>
  21. #include <process.h>
  22. #include <stdlib.h>
  23. #include <string.h>
  24. #include <md5.h>
  25. //
  26. // MD5 hashes are of size 16 bytes
  27. //
  28. #define ITH_REVISION_1 1
  29. #define IMPORT_TABLE_MAX_HASH_SIZE 16
  30. typedef struct _IMPORTTABLEP_IMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY {
  31. struct _IMPORTTABLEP_IMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY *Next;
  32. PSZ String;
  33. } IMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY, *PIMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY;
  34. typedef struct _IMPORTTABLEP_IMPORTTABLEP_SORTED_LIST_ENTRY {
  35. struct _IMPORTTABLEP_IMPORTTABLEP_SORTED_LIST_ENTRY *Next;
  36. PSZ String;
  37. PIMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY FunctionList;
  38. } IMPORTTABLEP_SORTED_LIST_ENTRY, *PIMPORTTABLEP_SORTED_LIST_ENTRY;
  39. VOID
  40. ImportTablepInsertModuleSorted(
  41. IN PIMPORTTABLEP_SORTED_LIST_ENTRY pImportName,
  42. OUT PIMPORTTABLEP_SORTED_LIST_ENTRY * ppImportNameList
  43. );
  44. VOID
  45. ImportTablepFreeModuleSorted(
  46. IN PIMPORTTABLEP_SORTED_LIST_ENTRY pImportNameList
  47. );
  48. VOID
  49. ImportTablepInsertFunctionSorted(
  50. IN PIMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY pFunctionName,
  51. OUT PIMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY * ppFunctionNameList
  52. );
  53. VOID
  54. ImportTablepFreeFunctionSorted(
  55. IN PIMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY pFunctionNameList
  56. );
  57. NTSTATUS
  58. ImportTablepHashCanonicalLists(
  59. IN PIMPORTTABLEP_SORTED_LIST_ENTRY ImportedNameList,
  60. OUT PBYTE Hash
  61. );
  62. #endif