Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: syzygy/pe/pe_structs.h

Issue 2771503005: Add support for the Win10 SDK to the PE reader (Closed)
Patch Set: comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « syzygy/pe/pe_file_parser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 Google Inc. All Rights Reserved. 1 // Copyright 2015 Google Inc. All Rights Reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and 12 // See the License for the specific language governing permissions and
13 // limitations under the License. 13 // limitations under the License.
14 // 14 //
15 // Definition of some structures encountered in the PE files. 15 // Definition of some structures encountered in the PE files.
16 16
17 #ifndef SYZYGY_PE_PE_STRUCTS_H_ 17 #ifndef SYZYGY_PE_PE_STRUCTS_H_
18 #define SYZYGY_PE_PE_STRUCTS_H_ 18 #define SYZYGY_PE_PE_STRUCTS_H_
19 19
20 #include <windows.h> 20 #include <windows.h>
21 21
22 namespace pe { 22 namespace pe {
23 23
24 // Redefinition of the IMAGE_LOAD_CONFIG_CODE_INTEGRITY structure. This
25 // corresponds to the structure as encountered in the version 10.0+ of the
26 // Windows SDK.
27 struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY {
28 WORD Flags;
29 WORD Catalog;
30 DWORD CatalogOffset;
31 DWORD Reserved;
32 };
33
24 // Redefinition of the IMAGE_LOAD_CONFIG_DIRECTORY structure. This corresponds 34 // Redefinition of the IMAGE_LOAD_CONFIG_DIRECTORY structure. This corresponds
25 // to the structure as encountered in the version 8.1 of the Windows SDK. 35 // to the structure as encountered in the version 10.0.14393 of the Windows SDK.
26 struct LoadConfigDirectory { 36 struct LoadConfigDirectory {
27 // Fields available in v8.0+ of the Windows SDK. 37 // Fields available in v8.0+ of the Windows SDK.
28 DWORD Size; 38 DWORD Size;
29 DWORD TimeDateStamp; 39 DWORD TimeDateStamp;
30 WORD MajorVersion; 40 WORD MajorVersion;
31 WORD MinorVersion; 41 WORD MinorVersion;
32 DWORD GlobalFlagsClear; 42 DWORD GlobalFlagsClear;
33 DWORD GlobalFlagsSet; 43 DWORD GlobalFlagsSet;
34 DWORD CriticalSectionDefaultTimeout; 44 DWORD CriticalSectionDefaultTimeout;
35 DWORD DeCommitFreeBlockThreshold; 45 DWORD DeCommitFreeBlockThreshold;
36 DWORD DeCommitTotalFreeThreshold; 46 DWORD DeCommitTotalFreeThreshold;
37 DWORD LockPrefixTable; // VA 47 DWORD LockPrefixTable; // VA
38 DWORD MaximumAllocationSize; 48 DWORD MaximumAllocationSize;
39 DWORD VirtualMemoryThreshold; 49 DWORD VirtualMemoryThreshold;
40 DWORD ProcessHeapFlags; 50 DWORD ProcessHeapFlags;
41 DWORD ProcessAffinityMask; 51 DWORD ProcessAffinityMask;
42 WORD CSDVersion; 52 WORD CSDVersion;
43 WORD Reserved1; 53 WORD Reserved1;
44 DWORD EditList; // VA 54 DWORD EditList; // VA
45 DWORD SecurityCookie; // VA 55 DWORD SecurityCookie; // VA
46 DWORD SEHandlerTable; // VA 56 DWORD SEHandlerTable; // VA
47 DWORD SEHandlerCount; 57 DWORD SEHandlerCount;
48 58
49 // Fields available in v8.1+ of the Windows SDK. 59 // Fields available in v8.1+ of the Windows SDK.
50 DWORD GuardCFCheckFunctionPointer; // VA 60 DWORD GuardCFCheckFunctionPointer; // VA
51 DWORD Reserved2; 61 DWORD Reserved2;
52 DWORD GuardCFFunctionTable; // VA 62 DWORD GuardCFFunctionTable; // VA
53 DWORD GuardCFFunctionCount; 63 DWORD GuardCFFunctionCount;
54 DWORD GuardFlags; 64 DWORD GuardFlags;
65
66 // Fields available in v10.0+ of the Windows SDK.
67 IMAGE_LOAD_CONFIG_CODE_INTEGRITY CodeIntegrity;
68 DWORD GuardAddressTakenIatEntryTable; // VA
69 DWORD GuardAddressTakenIatEntryCount;
70 DWORD GuardLongJumpTargetTable; // VA
71 DWORD GuardLongJumpTargetCount;
72 DWORD DynamicValueRelocTable; // VA
73 DWORD HybridMetadataPointer;
55 }; 74 };
56 75
57 // An enum mapping the size of a given IMAGE_LOAD_CONFIG_DIRECTORY structure to 76 // An enum mapping the size of a given IMAGE_LOAD_CONFIG_DIRECTORY structure
58 // the corresponding version of the Windows SDK. 77 // to the corresponding version of the Windows SDK.
59 enum LoadConfigDirectoryVersion { 78 enum LoadConfigDirectoryVersion {
60 kLoadConfigDirectorySizeUnknown = 0, 79 kLoadConfigDirectorySizeUnknown = 0,
80 // Corresponds to the version 8.0 of the Windows SDK.
61 kLoadConfigDirectorySize80 = 81 kLoadConfigDirectorySize80 =
62 offsetof(LoadConfigDirectory, GuardCFCheckFunctionPointer), 82 offsetof(LoadConfigDirectory, GuardCFCheckFunctionPointer),
63 kLoadConfigDirectorySize81 = sizeof(LoadConfigDirectory), 83 // Corresponds to the version 8.1+ of the Windows SDK.
84 kLoadConfigDirectorySize81 = offsetof(LoadConfigDirectory, CodeIntegrity),
85 // Corresponds to the version 10.0+ of the Windows SDK with the code integrity
86 // feature disabled.
87 kLoadConfigDirectorySize100NoCodeIntegrity =
88 offsetof(LoadConfigDirectory, CodeIntegrity),
89 // Corresponds to the version 10.0+ of the Windows SDK with the CFG feature
90 // disabled.
91 kLoadConfigDirectorySize100NoCFG =
92 offsetof(LoadConfigDirectory, GuardAddressTakenIatEntryTable),
93 // Corresponds to the full version 10.0 of the Windows SDK.
94 kLoadConfigDirectorySize100 = sizeof(LoadConfigDirectory),
64 }; 95 };
65 96
66 }; // namespace pe 97 }; // namespace pe
67 98
68 #endif // SYZYGY_PE_PE_STRUCTS_H_ 99 #endif // SYZYGY_PE_PE_STRUCTS_H_
OLDNEW
« no previous file with comments | « syzygy/pe/pe_file_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698