25 std::cout <<
"Found name:" <<
found_name << std::endl;
51 std::cerr <<
"Cannot save the DLL name: " <<
dll_name << std::endl;
64template <
typename FIELD_T>
112 std::cout <<
"[+] Found the name at: " << std::hex <<
name_offset << std::endl;
118 std::cout <<
"[+] Wrote found to offset: " << std::hex <<
call_via_ptr << std::endl;
126 std::cout <<
"[+] Filling ordinal: " <<
lastOrdinal << std::endl;
135template <
typename FIELD_T,
typename IMAGE_THUNK_DATA_T>
143 std::cout <<
"[+] Saved ordinal" << std::endl;
158 std::cout <<
"[+] Saved name" << std::endl;
165template <
typename FIELD_T,
typename IMAGE_THUNK_DATA_T>
240 std::cerr <<
"[-] Could not fill some import names!" << std::endl;
#define MASK_TO_WORD(val)
#define MASK_TO_DWORD(val)
std::string toString() const
bool writeFoundDllName(IMAGE_IMPORT_DESCRIPTOR *lib_desc, const std::string &dll_name)
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)
bool uneraseDllName(IMAGE_IMPORT_DESCRIPTOR *lib_desc, const std::string &dll_name)
bool writeFoundFunction(IMAGE_THUNK_DATA_T *desc, const FIELD_T ordinal_flag, const ExportedFunc &foundFunc)
bool uneraseDllImports(IN OUT IMAGE_IMPORT_DESCRIPTOR *lib_desc, IN ImportedDllCoverage &dllCoverage, OUT OPTIONAL ImpsNotCovered *not_covered)
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)
bool parse_delayed_desc(BYTE *modulePtr, const size_t moduleSize, const ULONGLONG img_base, LPSTR lib_name, const T_FIELD ordinal_flag, IMAGE_DELAYLOAD_DESCRIPTOR *desc, peconv::t_function_resolver *func_resolver)
LPVOID search_name(std::string name, const char *modulePtr, size_t moduleSize)
A definition of ImportsUneraser class - for recovery of a partialy erased Import Table.
bool validate_ptr(IN const void *buffer_bgn, IN size_t buffer_size, IN const void *field_bgn, IN size_t field_size)
PBYTE find_ending_cave(BYTE *module_ptr, size_t module_size, const DWORD cave_size, const DWORD cave_charact=IMAGE_SCN_MEM_READ)
IMAGE_DATA_DIRECTORY * get_directory_entry(IN const BYTE *pe_buffer, IN DWORD dir_id, IN bool allow_empty=false)