16 std::cerr <<
"Could not open file!" << std::endl;
23 std::cerr <<
"Could not create mapping!" << std::endl;
31 std::cerr <<
"Could not map view of file" << std::endl;
42 std::cerr <<
"[-] Mapping of " <<
filename <<
" is invalid!" << std::endl;
55 std::cerr <<
"Could not allocate memory in the current process" << std::endl;
70 std::cerr <<
"Cannot open the file for reading!" << std::endl;
79 if (buffer ==
nullptr) {
81 std::cerr <<
"Allocation has failed!" << std::endl;
88 std::cerr <<
"Reading failed!" << std::endl;
108 std::cerr <<
"Cannot open the file for writing!" << std::endl;
119 std::cerr <<
"Failed to write to the file : " <<
out_path << std::endl;
134 size_t found =
str.find_last_of(
"/\\");
135 if (
found == std::string::npos) {
143 size_t found =
str.find_last_of(
"/\\");
144 if (
found == std::string::npos) {
152 size_t len =
str.length();
154 for (
size_t k =
len;
k != 0;
k--) {
Definitions of the used buffer types. Functions for their allocation and deallocation.
#define MASK_TO_DWORD(val)
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)
Functions related to operations on files. Wrappers for read/write.
bool dump_to_file(IN LPCTSTR path, IN PBYTE dump_data, IN size_t dump_size)
peconv::UNALIGNED_BUF load_file(IN LPCTSTR filename, OUT size_t &r_size)
UNALIGNED_BUF alloc_unaligned(size_t buf_size)
std::string get_directory_name(IN const std::string full_path)
bool is_bad_read_ptr(LPCVOID areaStart, SIZE_T areaSize)
void free_file(IN peconv::UNALIGNED_BUF buffer)
peconv::UNALIGNED_BUF read_from_file(IN LPCTSTR path, IN OUT size_t &read_size)
size_t find_extension_pos(IN const std::string str)
std::string get_file_name(IN const std::string full_path)
void free_unaligned(UNALIGNED_BUF section_buffer)
Miscellaneous utility functions.