libPeConv
A library to load, manipulate, dump PE files.
|
#include <fix_imports.h>
Public Member Functions | |
ImportedDllCoverage (std::set< ULONGLONG > &_addresses, const peconv::ExportsMapper &_exportsMap) | |
bool | findCoveringDll () |
size_t | mapAddressesToFunctions (const std::string &_mappedDllName) |
bool | isMappingComplete () |
Public Attributes | |
std::map< ULONGLONG, std::set< ExportedFunc > > | addrToFunc |
std::set< ULONGLONG > | notFound |
std::string | dllName |
Protected Attributes | |
std::string | mappedDllName |
std::set< ULONGLONG > & | addresses |
const peconv::ExportsMapper & | exportsMap |
a helper class that allows to find out where the functions are imported from
Definition at line 52 of file fix_imports.h.
|
inline |
A constructor of an object of ImportedDllCoverage class.
_addresses | : the list of filled imports (VAs): the addresses to be covered |
_exportsMap | : the map of the exports of all the loaded DLLs (the space in which we will be searching) |
Definition at line 60 of file fix_imports.h.
bool ImportedDllCoverage::findCoveringDll | ( | ) |
Checks if all the addresses can be covered by one DLL. If yes, this dll will be saved into: dllName.
Definition at line 125 of file fix_imports.cpp.
|
inline |
Check if the functions mapping is complete.
Definition at line 85 of file fix_imports.h.
size_t ImportedDllCoverage::mapAddressesToFunctions | ( | const std::string & | _mappedDllName | ) |
Maps the addresses from the set to functions from the given DLL. Results are saved into: addrToFunc. Addresses that could not be covered by the given DLL are saved into notFound. Before each execution, the content of involved variables is erased.
_mappedDllName | : the name of the DLL that we will be used to mapping. This DLL is saved into mappedDllName. |
Definition at line 186 of file fix_imports.cpp.
|
protected |
A supplied set of the addresses of imported functions. Those addressed will be covered (associated with the corresponding exports from available DLLs, defined by exportsMap).
Definition at line 112 of file fix_imports.h.
std::map<ULONGLONG, std::set<ExportedFunc> > peconv::ImportedDllCoverage::addrToFunc |
A mapping associating each of the covered function addresses with the set of exports (from mapped DLL) that cover this address
Definition at line 90 of file fix_imports.h.
std::string peconv::ImportedDllCoverage::dllName |
Name of the covering DLL
Definition at line 100 of file fix_imports.h.
|
protected |
A supplied exportsMap. Only used as a lookup, no changes applied.
Definition at line 117 of file fix_imports.h.
|
protected |
A name of the DLL that was used for mapping. In a typical scenario it will be the same as covering DLL, but may be set different.
Definition at line 106 of file fix_imports.h.
std::set<ULONGLONG> peconv::ImportedDllCoverage::notFound |
Addresses of the functions not found in the mapped DLL
Definition at line 95 of file fix_imports.h.