_module_data_t Struct Reference

#include <dr_tools.h>

Data Fields

app_pc end
app_pc entry_point
uint flags
module_names_t names
char * full_path
version_number_t file_version
version_number_t product_version
uint checksum
uint timestamp
size_t module_internal_size
app_pc start
module_handle_t handle

Detailed Description

Holds information about a loaded module.

On Linux the start address can be cast to an Elf32_Ehdr or Elf64_Ehdr.
On Windows the start address can be cast to an IMAGE_DOS_HEADER for use in finding the IMAGE_NT_HEADER and its OptionalHeader. The OptionalHeader can be used to walk the module sections (among other things). See WINNT.H.
On MacOS the start address can be cast to mach_header or mach_header_64.
When accessing any memory inside the module (including header fields) user is responsible for guarding against corruption and the possibility of the module being unmapped.

Field Documentation

uint _module_data_t::checksum

module checksum from the PE headers

app_pc _module_data_t::end

Ending address of this module. If the module is not contiguous (which is common on MacOS, and can happen on Linux), this is the highest address of the module, but there can be gaps in between start and end that are either unmapped or that contain other mappings or libraries. Use the segments array to examine each mapped region, and use dr_module_contains_addr() as a convenience routine, rather than checking against [start..end).

app_pc _module_data_t::entry_point

entry point for this module as specified in the headers

version_number_t _module_data_t::file_version

file version number from .rsrc section

uint _module_data_t::flags

Reserved, set to 0

char* _module_data_t::full_path

full path to the file backing this module

module_handle_t _module_data_t::handle

module_handle for use with dr_get_proc_address()

size_t _module_data_t::module_internal_size

module internal size (from PE headers SizeOfImage)

module_names_t _module_data_t::names

struct containing name(s) for this module; use dr_module_preferred_name() to get the preferred name for this module

version_number_t _module_data_t::product_version

product version number from .rsrc section

app_pc _module_data_t::start

starting address of this module

uint _module_data_t::timestamp

module timestamp from the PE headers

The documentation for this struct was generated from the following file: