Commit 3aec2617 authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Improved PE class comments

PEImage and PeImageReader are similar classes with slightly different
behaviors. This change updates the comments to clarify how they differ.

Change-Id: Id09868324b93d5a44731f778fb3f7684ca77736f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2336303Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795188}
parent 2d730ea2
......@@ -26,7 +26,12 @@ namespace win {
// This class is a wrapper for the Portable Executable File Format (PE).
// Its main purpose is to provide an easy way to work with imports and exports
// from a file, mapped in memory as image.
// from a file, mapped in memory as image. A PEImage object is constructed from
// a loaded PE file by passing the HMODULE to the constructor. Loading a PE file
// as an image will execute code and should only be done with trusted images.
// Parsing of untrusted PE files is better done with PeImageReader.
// PEImage can only parse PE files that match the bitness of the process.
// See also PEImageAsData.
class PEImage {
public:
// Callback to enumerate sections.
......
......@@ -18,7 +18,11 @@ namespace base {
namespace win {
// Parses headers and various data from a PE image. This parser is safe for use
// on untrusted data.
// on untrusted data and works on PE files with different bitness from the
// current process. The PeImageReader is initialized after construction by
// passing the address and size of a PE file that has been read into memory -
// not loaded by the OS as an image. Parsing of a PE file that has been loaded
// as an image can be done with PEImage.
class BASE_EXPORT PeImageReader {
public:
enum WordSize {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment