OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file implements PEImage, a generic class to manipulate PE files. | 5 // This file implements PEImage, a generic class to manipulate PE files. |
6 // This file was adapted from GreenBorder's Code. | 6 // This file was adapted from GreenBorder's Code. |
7 | 7 |
8 #include "base/pe_image.h" | 8 #include "base/win/pe_image.h" |
| 9 |
| 10 namespace base { |
| 11 namespace win { |
9 | 12 |
10 #if defined(_WIN64) && !defined(NACL_WIN64) | 13 #if defined(_WIN64) && !defined(NACL_WIN64) |
11 // TODO(rvargas): Bug 27218. Make sure this is ok. | 14 // TODO(rvargas): Bug 27218. Make sure this is ok. |
12 #error This code is not tested on x64. Please make sure all the base unit tests\ | 15 #error This code is not tested on x64. Please make sure all the base unit tests\ |
13 pass before doing any real work. The current unit tests don't test the\ | 16 pass before doing any real work. The current unit tests don't test the\ |
14 differences between 32- and 64-bits implementations. Bugs may slip through.\ | 17 differences between 32- and 64-bits implementations. Bugs may slip through.\ |
15 You need to improve the coverage before continuing. | 18 You need to improve the coverage before continuing. |
16 #endif | 19 #endif |
17 | 20 |
18 // Structure to perform imports enumerations. | 21 // Structure to perform imports enumerations. |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 return NULL; | 558 return NULL; |
556 | 559 |
557 PVOID in_memory = PEImage::RVAToAddr(rva); | 560 PVOID in_memory = PEImage::RVAToAddr(rva); |
558 DWORD dummy; | 561 DWORD dummy; |
559 | 562 |
560 if (!ImageAddrToOnDiskOffset(in_memory, &dummy)) | 563 if (!ImageAddrToOnDiskOffset(in_memory, &dummy)) |
561 return NULL; | 564 return NULL; |
562 | 565 |
563 return in_memory; | 566 return in_memory; |
564 } | 567 } |
| 568 |
| 569 } // namespace win |
| 570 } // namespace base |
OLD | NEW |