| 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 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 kLoadConfigDirectorySize81: |
| 1167 // case kLoadConfigDirectorySize100NoCodeIntegrity: |
| 1168 case kLoadConfigDirectorySize100NoCFG: |
| 1169 case kLoadConfigDirectorySize100: |
| 1167 load_config_version = | 1170 load_config_version = |
| 1168 static_cast<LoadConfigDirectoryVersion>(*load_config_len.ptr()); | 1171 static_cast<LoadConfigDirectoryVersion>(*load_config_len.ptr()); |
| 1169 break; | 1172 break; |
| 1170 default: | 1173 default: |
| 1171 LOG(ERROR) << "Unknown version of the IMAGE_LOAD_CONFIG_DIRECTORY " | 1174 LOG(ERROR) << "Unknown version of the IMAGE_LOAD_CONFIG_DIRECTORY " |
| 1172 << "structure (" << *load_config_len.ptr() << " bytes), might " | 1175 << "structure (" << *load_config_len.ptr() << " bytes), might " |
| 1173 << "be because you're using a new version of the Windows SDK."; | 1176 << "be because you're using a new version of the Windows SDK."; |
| 1174 return NULL; | 1177 return NULL; |
| 1175 } | 1178 } |
| 1176 | 1179 |
| (...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 | 1443 // in-image file structure. So, translation to an in-image relative |
| 1441 // address is expected to yield a valid RVA. | 1444 // address is expected to yield a valid RVA. |
| 1442 return image_file_.Translate(offs, &rel) && | 1445 return image_file_.Translate(offs, &rel) && |
| 1443 AddReference(structure.AddressOf(item), | 1446 AddReference(structure.AddressOf(item), |
| 1444 BlockGraph::FILE_OFFSET_REF, | 1447 BlockGraph::FILE_OFFSET_REF, |
| 1445 sizeof(*item), | 1448 sizeof(*item), |
| 1446 rel); | 1449 rel); |
| 1447 } | 1450 } |
| 1448 | 1451 |
| 1449 } // namespace pe | 1452 } // namespace pe |
| OLD | NEW |