27 IN OUT BYTE *buffer, IN
size_t mod_size,
28 IN
const ULONGLONG start_addr,
34 if (exportsMap !=
nullptr) {
36 std::cerr <<
"[-] Unable to fix imports!" << std::endl;
43 BYTE* dump_data = buffer;
44 size_t dump_size = mod_size;
46 BYTE* unmapped_module =
nullptr;
57 unmapped_module =
pe_virtual_to_raw(buffer, mod_size, (ULONGLONG)start_addr, out_size,
false);
63 if (unmapped_module) {
64 dump_data = unmapped_module;
69 const bool is_dumped =
dump_to_file(out_path, dump_data, dump_size);
Functions related to operations on files. Wrappers for read/write.
bool is_dot_net(BYTE *pe_buffer, size_t pe_buffer_size)
bool fix_dot_net_ep(BYTE *pe_buffer, size_t pe_buffer_size)
Functions and classes responsible for fixing Import Table. A definition of ImportedDllCoverage class.
bool is_pe_raw(IN const BYTE *pe_buffer, IN size_t pe_size)
bool update_image_base(IN OUT BYTE *payload, IN ULONGLONG destImageBase)
bool fix_imports(IN OUT PVOID modulePtr, IN size_t moduleSize, IN const peconv::ExportsMapper &exportsMap, OUT OPTIONAL peconv::ImpsNotCovered *notCovered)
bool dump_pe(IN const char *outputFilePath, IN OUT BYTE *buffer, IN size_t buffer_size, IN const ULONGLONG module_base, IN OUT t_pe_dump_mode &dump_mode, IN OPTIONAL const peconv::ExportsMapper *exportsMap=nullptr)
ULONGLONG get_image_base(IN const BYTE *pe_buffer)
BYTE * pe_virtual_to_raw(IN BYTE *payload, IN size_t in_size, IN ULONGLONG loadBase, OUT size_t &outputSize, IN OPTIONAL bool rebuffer=true)
bool free_pe_buffer(ALIGNED_BUF buffer, size_t buffer_size=0)
bool dump_to_file(IN const char *path, IN PBYTE dump_data, IN size_t dump_size)
t_pe_dump_mode detect_dump_mode(IN const BYTE *buffer, IN size_t buffer_size)
bool is_pe_expanded(IN const BYTE *pe_buffer, IN size_t pe_size)
BYTE * pe_realign_raw_to_virtual(IN const BYTE *payload, IN size_t in_size, IN ULONGLONG loadBase, OUT size_t &outputSize)
Dumping PE from the memory buffer into a file.
Wrappers over various fields in the PE header. Read, write, parse PE headers.
Detecting in which mode is the PE in the supplied buffer (i.e. raw, virtual). Analyzes PE features ty...
Converting PE from virtual to raw format.