Source code of Windows XP (NT5)
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.

86 lines
1.8 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. //
  25. // MD5 hashes are of size 16 bytes
  26. //
  27. #define ITH_REVISION_1 1
  28. #define IMPORT_TABLE_MAX_HASH_SIZE 16
  29. typedef struct _IMPORTTABLEP_IMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY {
  30. struct _IMPORTTABLEP_IMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY *Next;
  31. PSZ String;
  32. } IMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY, *PIMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY;
  33. typedef struct _IMPORTTABLEP_IMPORTTABLEP_SORTED_LIST_ENTRY {
  34. struct _IMPORTTABLEP_IMPORTTABLEP_SORTED_LIST_ENTRY *Next;
  35. PSZ String;
  36. PIMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY FunctionList;
  37. } IMPORTTABLEP_SORTED_LIST_ENTRY, *PIMPORTTABLEP_SORTED_LIST_ENTRY;
  38. VOID
  39. ImportTablepInsertModuleSorted(
  40. IN PIMPORTTABLEP_SORTED_LIST_ENTRY pImportName,
  41. OUT PIMPORTTABLEP_SORTED_LIST_ENTRY * ppImportNameList
  42. );
  43. VOID
  44. ImportTablepFreeModuleSorted(
  45. IN PIMPORTTABLEP_SORTED_LIST_ENTRY pImportNameList
  46. );
  47. VOID
  48. ImportTablepInsertFunctionSorted(
  49. IN PIMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY pFunctionName,
  50. OUT PIMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY * ppFunctionNameList
  51. );
  52. VOID
  53. ImportTablepFreeFunctionSorted(
  54. IN PIMPORTTABLEP_SORTED_FUNCTION_LIST_ENTRY pFunctionNameList
  55. );
  56. NTSTATUS
  57. ImportTablepHashCanonicalLists(
  58. IN PIMPORTTABLEP_SORTED_LIST_ENTRY ImportedNameList,
  59. OUT PBYTE Hash
  60. );
  61. #endif