28 DllInfo(ULONGLONG _moduleBase,
size_t _moduelSize,
bool _is64b, std::string _moduleName)
72 size_t add_to_lookup(std::string moduleName, HMODULE modulePtr,
size_t moduleSize, ULONGLONG moduleBase);
80 size_t add_to_lookup(std::string moduleName, HMODULE modulePtr, ULONGLONG moduleBase)
94 return add_to_lookup(moduleName, modulePtr,
reinterpret_cast<ULONGLONG
>(modulePtr));
102 std::map<ULONGLONG, std::set<ExportedFunc>>::const_iterator itr =
va_to_func.find(va);
104 const std::set<ExportedFunc> &fSet = itr->second;
116 std::map<ULONGLONG, DllInfo>::const_iterator firstGreater =
dll_base_to_info.upper_bound(func_rva);
118 std::map<ULONGLONG, DllInfo>::const_iterator itr;
120 const DllInfo& module = itr->second;
124 return module.moduleBase;
135 std::map<ULONGLONG, DllInfo>::const_iterator found = this->
dll_base_to_info.find(base);
139 const DllInfo& info = found->second;
151 size_t get_dll_paths(IN std::string short_name, OUT std::set<std::string>& paths)
const;
159 if (dll_path.length() == 0)
return "";
170 if (exp_set == NULL)
return NULL;
172 std::set<ExportedFunc>::iterator fItr = exp_set->begin();
182 enum ADD_FUNC_RES { RES_INVALID = 0, RES_MAPPED = 1, RES_FORWARDED = 2 };
183 ADD_FUNC_RES add_function_to_lookup(HMODULE modulePtr, ULONGLONG moduleBase,
size_t moduleSize, ExportedFunc &currFunc, DWORD callRVA);
185 bool add_forwarded(ExportedFunc &currFunc, DWORD callRVA, PBYTE modulePtr,
size_t moduleSize);
186 bool add_to_maps(ULONGLONG va, ExportedFunc &currFunc);
188 size_t resolve_forwarders(
const ULONGLONG va, ExportedFunc &currFunc);
189 size_t make_ord_lookup_tables(PVOID modulePtr,
size_t moduleSize, std::map<PDWORD, DWORD> &va_to_ord);
void print_va_to_func(std::stringstream &stream) const
ULONGLONG find_dll_base_by_func_va(ULONGLONG func_rva) const
size_t get_dll_paths(IN std::string short_name, OUT std::set< std::string > &paths) const
std::map< ULONGLONG, DllInfo > dll_base_to_info
size_t add_to_lookup(std::string moduleName, HMODULE modulePtr, ULONGLONG moduleBase)
std::map< std::string, std::set< ULONGLONG > > dll_shortname_to_base
size_t add_to_lookup(std::string moduleName, HMODULE modulePtr, size_t moduleSize, ULONGLONG moduleBase)
size_t add_to_lookup(std::string moduleName, HMODULE modulePtr)
void associateVaAndFunc(ULONGLONG va, const ExportedFunc &func)
std::string get_dll_path(ULONGLONG base) const
std::map< ExportedFunc, ULONGLONG > func_to_va
void print_func_to_va(std::stringstream &stream) const
const ExportedFunc * find_export_by_va(ULONGLONG va) const
std::string get_dll_fullname(std::string short_name) const
const std::set< ExportedFunc > * find_exports_by_va(ULONGLONG va) const
std::map< ExportedFunc, std::set< ExportedFunc > > forwarders_lookup
std::map< ULONGLONG, std::set< ExportedFunc > > va_to_func
A definition of ExportedFunc class - used for storing the details of the exported function....
Functions related to operations on files. Wrappers for read/write.
std::string get_dll_shortname(const std::string &str)
std::string get_file_name(IN const std::string full_path)
Wrappers over various fields in the PE header. Read, write, parse PE headers.
Converting PE from raw to virtual format.
DllInfo(ULONGLONG _moduleBase, size_t _moduelSize, bool _is64b, std::string _moduleName)
DllInfo(const DllInfo &other)
bool operator<(const DllInfo &other) const