23#define TO_LOWERCASE(c1) c1 = (c1 <= 'Z' && c1 >= 'A') ? c1 = (c1 - 'A') + 'a': c1;
40 if (
c1 !=
c2)
return false;
69 std::cerr <<
"[!] Forwarded function: ["<<
wanted_ordinal <<
" -> "<<
fPtr <<
"] cannot be resolved!" << std::endl;
81 if (
exp == 0)
return 0;
113 std::cerr <<
"[*] Getting function by ordinal" << std::endl;
119 std::cerr <<
"[-] Invalid pointer to the name" << std::endl;
136 std::cerr <<
"[!] Forwarded function: ["<<
name <<
" -> "<<
fPtr <<
"] cannot be resolved!" << std::endl;
143 std::cerr <<
"Function not found!" << std::endl;
152 std::cerr <<
"Could not load the library!" << std::endl;
161 std::cerr <<
"[!] Cound not get the function: "<<
func_name <<
" from exports!" << std::endl;
165 std::cerr <<
"[!] Falling back to the default resolver..." <<std::endl;
169 std::cerr <<
"[-] Loading function from " <<
lib_name <<
" failed!" << std::endl;
175 std::cerr <<
"[-] Loaded proc is not matching the default one!" << std::endl;
#define MASK_TO_DWORD(val)
virtual FARPROC resolve_func(LPCSTR lib_name, LPCSTR func_name)
virtual FARPROC resolve_func(LPCSTR lib_name, LPCSTR func_name)
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)
bool is_wanted_func(LPCSTR curr_name, LPCSTR wanted_name)
FARPROC get_export_by_ord(PVOID modulePtr, IMAGE_EXPORT_DIRECTORY *exp, DWORD wanted_ordinal)
bool is_ordinal(IMAGE_EXPORT_DIRECTORY *exp, LPCSTR func_name)
Searching specific functions in PE's Exports Table.
LPSTR read_dll_name(HMODULE modulePtr)
size_t forwarder_name_len(BYTE *fPtr)
size_t get_exported_names(PVOID modulePtr, std::vector< std::string > &names_list)
FARPROC get_exported_func(PVOID modulePtr, LPCSTR wanted_name)
bool is_bad_read_ptr(LPCVOID areaStart, SIZE_T areaSize)
IMAGE_EXPORT_DIRECTORY * get_export_directory(IN HMODULE modulePtr)
Miscellaneous utility functions.