Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.57 KB | None | 0 0
  1. /***
  2. *loadcfg.c
  3. *
  4. *       Copyright (c) Microsoft Corporation.  All rights reserved.
  5. *
  6. *Purpose:
  7. *       Defines the default load config struct linked into images.
  8. *
  9. *******************************************************************************/
  10.  
  11. #include <Windows.h>
  12.  
  13. extern UINT_PTR __security_cookie;  /* /GS security cookie */
  14.  
  15. void __fastcall _guard_check_icall_nop (_In_ PVOID /*Target*/);
  16.  
  17. #pragma warning(disable : 4152)
  18.  
  19. extern const volatile PVOID __guard_check_icall_fptr = _guard_check_icall_nop;
  20.  
  21. #if defined(_AMD64_)
  22. void _guard_dispatch_icall_nop();
  23. extern const volatile PVOID __guard_dispatch_icall_fptr = _guard_dispatch_icall_nop;
  24. #endif
  25.  
  26. #pragma warning(default : 4152)
  27.  
  28. #if defined(_M_IX86) || defined(_X86_)
  29. /*
  30.  * The following two names are automatically created by the linker for any
  31.  * image that has the safe exception table present.
  32.  */
  33.  
  34. extern PVOID __safe_se_handler_table[]; /* base of safe handler entry table */
  35. extern BYTE  __safe_se_handler_count;   /* absolute symbol whose address is
  36.                                            the count of table entries */
  37. #endif
  38.  
  39. extern PVOID __guard_fids_table[];
  40. extern ULONG __guard_fids_count;
  41. extern ULONG __guard_flags;
  42. extern PVOID __guard_iat_table[];
  43. extern ULONG __guard_iat_count;
  44. extern PVOID __guard_longjmp_table[];
  45. extern ULONG __guard_longjmp_count;
  46. extern PVOID __dynamic_value_reloc_table;
  47. extern PVOID __enclave_config;
  48.  
  49.  
  50. #if defined(_CHPE_X86_ARM64_)
  51.  
  52. extern const PVOID __chpe_metadata;
  53.  
  54. #endif
  55.  
  56. extern
  57. const
  58. IMAGE_LOAD_CONFIG_DIRECTORY
  59. _load_config_used = {
  60.     sizeof(_load_config_used),
  61.     0,
  62.     0,
  63.     0,
  64.     0,
  65.     0,
  66.     0,
  67.     0,
  68.     0,
  69.     0,
  70.     0,
  71.     0,
  72.     0,
  73.     0,
  74.     0,
  75.     0,
  76.     0,
  77.     (SIZE_T)&__security_cookie,
  78.  
  79. #if defined(_M_IX86) || defined(_X86_)
  80.  
  81.     (SIZE_T)__safe_se_handler_table,
  82.     (SIZE_T)&__safe_se_handler_count,
  83.  
  84. #else
  85.  
  86.     0,
  87.     0,
  88.  
  89. #endif
  90.  
  91.     (SIZE_T)&__guard_check_icall_fptr,
  92.  
  93. #if defined(_AMD64_)
  94.  
  95.     (SIZE_T)&__guard_dispatch_icall_fptr,
  96.  
  97. #else
  98.  
  99.     0,
  100.  
  101. #endif
  102.  
  103.     (SIZE_T)&__guard_fids_table,
  104.     (SIZE_T)&__guard_fids_count,
  105.  
  106.     (ULONG)(SIZE_T)&__guard_flags,
  107.  
  108.     { 0, 0, 0, 0 },
  109.  
  110.     (SIZE_T)&__guard_iat_table,
  111.     (SIZE_T)&__guard_iat_count,
  112.  
  113.     (SIZE_T)&__guard_longjmp_table,
  114.     (SIZE_T)&__guard_longjmp_count,
  115.  
  116.     0,
  117.  
  118. #if defined(_CHPE_X86_ARM64_)
  119.  
  120.     (SIZE_T)&__chpe_metadata,
  121.  
  122. #else
  123.  
  124.     0,
  125.  
  126. #endif
  127.  
  128.     0,
  129.     0,
  130.  
  131.     0,      // DynamicValueRelocTableOffset
  132.     0,      // DynamicValueRelocTableSection
  133.     0,      // Reserved2
  134.  
  135.     0,
  136.  
  137.     0,      // HotPatchTableOffset
  138.     0,      // Reserved3
  139.     (SIZE_T)&__enclave_config,
  140.     0,      // VolatileMetadataPointer
  141. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement