| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_COMMON_SAFE_BROWSING_PE_IMAGE_READER_WIN_H_ | 5 #ifndef CHROME_COMMON_SAFE_BROWSING_PE_IMAGE_READER_WIN_H_ |
| 6 #define CHROME_COMMON_SAFE_BROWSING_PE_IMAGE_READER_WIN_H_ | 6 #define CHROME_COMMON_SAFE_BROWSING_PE_IMAGE_READER_WIN_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <stddef.h> |
| 10 #include <stdint.h> |
| 9 | 11 |
| 10 #include "base/basictypes.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 12 | 14 |
| 13 namespace safe_browsing { | 15 namespace safe_browsing { |
| 14 | 16 |
| 15 // Parses headers and various data from a PE image. This parser is safe for use | 17 // Parses headers and various data from a PE image. This parser is safe for use |
| 16 // on untrusted data. | 18 // on untrusted data. |
| 17 class PeImageReader { | 19 class PeImageReader { |
| 18 public: | 20 public: |
| 19 enum WordSize { | 21 enum WordSize { |
| 20 WORD_SIZE_32, | 22 WORD_SIZE_32, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 const uint8_t* image_data_; | 148 const uint8_t* image_data_; |
| 147 size_t image_size_; | 149 size_t image_size_; |
| 148 uint32_t validation_state_; | 150 uint32_t validation_state_; |
| 149 scoped_ptr<OptionalHeader> optional_header_; | 151 scoped_ptr<OptionalHeader> optional_header_; |
| 150 DISALLOW_COPY_AND_ASSIGN(PeImageReader); | 152 DISALLOW_COPY_AND_ASSIGN(PeImageReader); |
| 151 }; | 153 }; |
| 152 | 154 |
| 153 } // namespace safe_browsing | 155 } // namespace safe_browsing |
| 154 | 156 |
| 155 #endif // CHROME_COMMON_SAFE_BROWSING_PE_IMAGE_READER_WIN_H_ | 157 #endif // CHROME_COMMON_SAFE_BROWSING_PE_IMAGE_READER_WIN_H_ |
| OLD | NEW |