Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 Google Inc. All Rights Reserved. | 1 // Copyright 2012 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, |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1156 PEFileStructPtr<DWORD> load_config_len; | 1156 PEFileStructPtr<DWORD> load_config_len; |
| 1157 if (!load_config_len.Read(image_file_, RelativeAddress(dir.VirtualAddress))) { | 1157 if (!load_config_len.Read(image_file_, RelativeAddress(dir.VirtualAddress))) { |
| 1158 LOG(ERROR) << "Unable to read load config len."; | 1158 LOG(ERROR) << "Unable to read load config len."; |
| 1159 return NULL; | 1159 return NULL; |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 LoadConfigDirectoryVersion load_config_version = | 1162 LoadConfigDirectoryVersion load_config_version = |
| 1163 kLoadConfigDirectorySizeUnknown; | 1163 kLoadConfigDirectorySizeUnknown; |
| 1164 switch (*load_config_len.ptr()) { | 1164 switch (*load_config_len.ptr()) { |
| 1165 case kLoadConfigDirectorySize80: | 1165 case kLoadConfigDirectorySize80: |
| 1166 case kLoadConfigDirectorySize81: | 1166 case kLoadConfigDirectorySizeNoCodeIntegrity: |
| 1167 case kLoadConfigDirectorySizeNoCFG: | |
|
chrisha
2017/03/23 20:53:32
Should these be 100NoCFG and 100NoCodeIntegrity?
Sébastien Marchand
2017/03/23 20:56:43
It depends, 100NoCFG will also mean 81, so I've de
| |
| 1168 case kLoadConfigDirectorySize100: | |
| 1167 load_config_version = | 1169 load_config_version = |
| 1168 static_cast<LoadConfigDirectoryVersion>(*load_config_len.ptr()); | 1170 static_cast<LoadConfigDirectoryVersion>(*load_config_len.ptr()); |
| 1169 break; | 1171 break; |
| 1170 default: | 1172 default: |
| 1171 LOG(ERROR) << "Unknown version of the IMAGE_LOAD_CONFIG_DIRECTORY " | 1173 LOG(ERROR) << "Unknown version of the IMAGE_LOAD_CONFIG_DIRECTORY " |
| 1172 << "structure (" << *load_config_len.ptr() << " bytes), might " | 1174 << "structure (" << *load_config_len.ptr() << " bytes), might " |
| 1173 << "be because you're using a new version of the Windows SDK."; | 1175 << "be because you're using a new version of the Windows SDK."; |
| 1174 return NULL; | 1176 return NULL; |
| 1175 } | 1177 } |
| 1176 | 1178 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1440 // in-image file structure. So, translation to an in-image relative | 1442 // in-image file structure. So, translation to an in-image relative |
| 1441 // address is expected to yield a valid RVA. | 1443 // address is expected to yield a valid RVA. |
| 1442 return image_file_.Translate(offs, &rel) && | 1444 return image_file_.Translate(offs, &rel) && |
| 1443 AddReference(structure.AddressOf(item), | 1445 AddReference(structure.AddressOf(item), |
| 1444 BlockGraph::FILE_OFFSET_REF, | 1446 BlockGraph::FILE_OFFSET_REF, |
| 1445 sizeof(*item), | 1447 sizeof(*item), |
| 1446 rel); | 1448 rel); |
| 1447 } | 1449 } |
| 1448 | 1450 |
| 1449 } // namespace pe | 1451 } // namespace pe |
| OLD | NEW |