libPeConv
A library to load, manipulate, dump PE files.
|
#include <imports_uneraser.h>
Public Member Functions | |
ImportsUneraser (PVOID _modulePtr, size_t _moduleSize) | |
bool | uneraseDllImports (IN OUT IMAGE_IMPORT_DESCRIPTOR *lib_desc, IN ImportedDllCoverage &dllCoverage, OUT OPTIONAL ImpsNotCovered *not_covered) |
bool | uneraseDllName (IMAGE_IMPORT_DESCRIPTOR *lib_desc, const std::string &dll_name) |
Protected Member Functions | |
bool | writeFoundDllName (IMAGE_IMPORT_DESCRIPTOR *lib_desc, const std::string &dll_name) |
template<typename FIELD_T , typename IMAGE_THUNK_DATA_T > | |
bool | fillImportNames (IN OUT IMAGE_IMPORT_DESCRIPTOR *lib_desc, IN const FIELD_T ordinal_flag, IN std::map< ULONGLONG, std::set< ExportedFunc > > &addr_to_func, OUT OPTIONAL ImpsNotCovered *not_covered) |
template<typename FIELD_T > | |
bool | findNameInBinaryAndFill (IMAGE_IMPORT_DESCRIPTOR *lib_desc, LPVOID call_via_ptr, LPVOID thunk_ptr, const FIELD_T ordinal_flag, std::map< ULONGLONG, std::set< ExportedFunc > > &addr_to_func) |
template<typename FIELD_T , typename IMAGE_THUNK_DATA_T > | |
bool | writeFoundFunction (IMAGE_THUNK_DATA_T *desc, const FIELD_T ordinal_flag, const ExportedFunc &foundFunc) |
Protected Attributes | |
PBYTE | modulePtr |
size_t | moduleSize |
bool | is64 |
A class responsible for recovering the partially erased Import Table from the PE.
Definition at line 24 of file imports_uneraser.h.
|
protected |
Fill the names of imported functions with names of the prepared mapping. Collect addressees of functions that couldn't be filled with the given mapping.
lib_desc | : the IMAGE_IMPORT_DESCRIPTOR where the functions' names should be set |
ordinal_flag | : the flag that is used to recognize import by ordinal (32 or 64 bit) |
addr_to_func | : a mapping assigning functions' addresses to their definitions (names etc.) |
not_covered | : a set of addresses that could not be found in the supplied mapping |
Definition at line 166 of file imports_uneraser.cpp.
|
protected |
bool ImportsUneraser::uneraseDllImports | ( | IN OUT IMAGE_IMPORT_DESCRIPTOR * | lib_desc, |
IN ImportedDllCoverage & | dllCoverage, | ||
OUT OPTIONAL ImpsNotCovered * | not_covered ) |
Fill the imported functions' names in the given Import Descriptor, using the given coverage. Collect addressees of functions that couldn't be filled with the given mapping.
lib_desc | : the IMAGE_IMPORT_DESCRIPTOR where the functions' names should be set |
dllCoverage | : a mapping associating addresses with the corresponding exports from available DLLs |
not_covered | : a set of addresses that could not be found in the supplied mapping |
Definition at line 230 of file imports_uneraser.cpp.
bool ImportsUneraser::uneraseDllName | ( | IMAGE_IMPORT_DESCRIPTOR * | lib_desc, |
const std::string & | dll_name ) |
Recover the imported DLL name in the given Import Descriptor, filling it with the given dll_name.
Definition at line 40 of file imports_uneraser.cpp.
|
protected |
Copy the given DLL name into the given IMAGE_IMPORT_DESCRIPTOR. Validates the data correctness before writing.
lib_desc | : the IMAGE_IMPORT_DESCRIPTOR where the DLL name should be set |
dll_name | : the DLL name that needs to be written into the lib_desc |
Definition at line 22 of file imports_uneraser.cpp.
|
protected |
Fill the function data into the given IMAGE_THUNK_DATA.
desc | : the poiner to IMAGE_THUNK_DATA that will be filled |
ordinal_flag | : an ordinal flag: 32 or 64 bit |
foundFunc | : the ExportedFunc that will be used for filling the desc |
Definition at line 136 of file imports_uneraser.cpp.
|
protected |
Definition at line 92 of file imports_uneraser.h.
|
protected |
Definition at line 90 of file imports_uneraser.h.
|
protected |
Definition at line 91 of file imports_uneraser.h.