PStack  2.0
Stack trace printer for MSVC and GCC binaries
dll_export_view.hpp
Go to the documentation of this file.
1 // ===-- include/psystem/dll_export_view.hpp -------------- -*- C++ -*- --=== //
2 // Copyright (c) 2015 Matt Bisson. All rights reserved.
3 
18 #pragma once
19 #ifndef PSYSTEM_DLL_EXPORT_VIEW_HPP
20 #define PSYSTEM_DLL_EXPORT_VIEW_HPP
21 
22 #include "psystem_ns.hpp"
23 
24 namespace psystem {
25 
26 class dll_export_iterator;
27 
41 {
45 public:
73  uint8_t const *base_address,
74  uint8_t const *load_address,
75  integral_address_t va_offset,
76  uint16_t const *idx_with_name,
77  uint32_t const *export_rva,
78  uint32_t const *export_name_rva,
79  uint32_t number_of_functions,
80  uint32_t number_of_names) noexcept;
81 
85 public:
90  dll_export_iterator begin() const;
91 
97  dll_export_iterator end() const;
98 
112 
116 private:
119  uint8_t const *m_base_address;
120 
127  uint8_t const *m_load_address;
128 
132 
138  uint16_t const *m_idx_with_name;
139 
141  uint32_t const *m_export_rva;
142 
149  uint32_t const *m_export_name_rva;
150 
157 
165 };
166 
167 } // namespace psystem
168 
169 #endif // PSYSTEM_DLL_EXPORT_VIEW_HPP
Iterator type for Windows Dynamic Link-Library (DLL) exports.
Definition: dll_export_iterator.hpp:50
psystem::address_t get_symbol_base_address() const
The address at which this DLL expects to be loaded.
Definition: dll_export_view.cpp:78
Exposes a DLL's symbol export table.
Definition: dll_export_view.hpp:40
integral_address_t m_va_offset
All Relative Virtual Addresses (RVA) must be offset by this value to be treated as a valid pointer...
Definition: dll_export_view.hpp:131
#define noexcept
Replace keyword with something useful.
Definition: platform.hpp:71
uint16_t const * m_idx_with_name
The beginning of an array of DLL export ordinals.
Definition: dll_export_view.hpp:138
std::uintptr_t address_t
Container type for a memory address.
Definition: platform.hpp:221
uint32_t m_number_of_names
The total number of named exported functions in the DLL.
Definition: dll_export_view.hpp:164
uint8_t const * m_load_address
The address at which this DLL expects to be loaded.
Definition: dll_export_view.hpp:127
uint32_t const * m_export_rva
The beginning of an array of DLL export symbols' RVAs.
Definition: dll_export_view.hpp:141
dll_export_iterator begin() const
Acquire an iterator to the first exported symbol in the view.
Definition: dll_export_view.cpp:54
The basic header file for the PSystem namespce.
uint32_t m_number_of_functions
The total number of exported functions in the DLL.
Definition: dll_export_view.hpp:156
Contains the process examination "system" and basic frameworks.
Definition: pstack_event_handler.hpp:28
uint32_t const * m_export_name_rva
The beginning of an array of DLL export symbol names' RVAs.
Definition: dll_export_view.hpp:149
std::ptrdiff_t integral_address_t
A memory address as an integer type (platform specific).
Definition: platform.hpp:228
uint8_t const * m_base_address
All addresses are offsets from the module base address, given here.
Definition: dll_export_view.hpp:119
dll_export_iterator end() const
Acquire an iterator just past the final exported symbol in the view.
Definition: dll_export_view.cpp:66
dll_export_view(uint8_t const *base_address, uint8_t const *load_address, integral_address_t va_offset, uint16_t const *idx_with_name, uint32_t const *export_rva, uint32_t const *export_name_rva, uint32_t number_of_functions, uint32_t number_of_names) noexcept
Construct a view of DLL export information.
Definition: dll_export_view.cpp:28