Public Member Functions | List of all members
crashpad::PEImageResourceReader Class Reference

A reader for resources stored in PE images mapped into another process. More...

#include "snapshot/win/pe_image_resource_reader.h"

Public Member Functions

bool Initialize (const ProcessSubrangeReader &module_subrange_reader, const IMAGE_DATA_DIRECTORY &resources_directory_entry)
 Initializes the resource reader. More...
bool FindResourceByID (uint16_t type, uint16_t name, uint16_t language, WinVMAddress *address, WinVMSize *size, uint32_t *code_page) const
 Locates a resource in a module by its ID. More...

Detailed Description

A reader for resources stored in PE images mapped into another process.

See also

Member Function Documentation

◆ FindResourceByID()

bool crashpad::PEImageResourceReader::FindResourceByID ( uint16_t  type,
uint16_t  name,
uint16_t  language,
WinVMAddress address,
WinVMSize size,
uint32_t *  code_page 
) const

Locates a resource in a module by its ID.

This method is similar to FindResourceEx(), but it operates on modules loaded in a remote process’ address space. It is not necessary to LoadLibrary() a module into a process in order to use this method.

No support is provided at present for locating resources by type or name using strings as opposed to integer identifiers.

Languages are scanned in the order determined by GetEntryFromResourceDirectoryByLanguage().

[in]typeThe integer identifier of the resource type, as in the lpType parameter of FindResourceEx().
[in]nameThe integer identifier of the resource, as in the lpName parameter of FindResourceEx().
[in]languageThe language of the resource, as in the wLanguage parameter of FindResourceEx().
[out]addressThe address, in the remote process’ address space, of the resource data.
[out]sizeThe size of the resource data.
[out]code_pageThe code page used to encode textual resource data. This parameter is optional.
true on success, with the out parameters set appropriately. false if the resource was not found, without logging any messages. false on failure, with a message logged.

◆ Initialize()

bool crashpad::PEImageResourceReader::Initialize ( const ProcessSubrangeReader module_subrange_reader,
const IMAGE_DATA_DIRECTORY &  resources_directory_entry 

Initializes the resource reader.

[in]module_subrange_readerThe reader for the module.
[in]resources_directory_entryThe module’s IMAGE_DATA_DIRECTORY for its resources area. This is taken from the module’s IMAGE_OPTIONAL_HEADER::DataDirectory at index IMAGE_DIRECTORY_ENTRY_RESOURCE.
true on success, false on failure with a message logged.

The documentation for this class was generated from the following files: