libPeConv
A library to load, manipulate, dump PE files.
Loading...
Searching...
No Matches
remote_pe_reader.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <windows.h>
9
10#include "pe_hdrs_helper.h"
11#include "pe_virtual_to_raw.h"
12#include "exports_mapper.h"
13#include "pe_dumper.h"
14
15namespace peconv {
16
17 bool fetch_region_info(HANDLE processHandle, LPVOID start_addr, MEMORY_BASIC_INFORMATION &page_info);
18
22 size_t fetch_region_size(HANDLE processHandle, LPVOID start_addr);
23
30 ULONGLONG fetch_alloc_base(HANDLE processHandle, LPVOID start_addr);
31
44 size_t read_remote_memory(HANDLE processHandle, LPVOID start_addr, OUT BYTE* buffer, const size_t buffer_size, const SIZE_T minimal_size = 0x100);
45
60 size_t read_remote_region(HANDLE processHandle, LPVOID start_addr, OUT BYTE* buffer, const size_t buffer_size, const bool force_access, const SIZE_T minimal_size = 0x100);
61
78 size_t read_remote_area(HANDLE processHandle, LPVOID start_addr, OUT BYTE* buffer, const size_t buffer_size, const bool force_access, const SIZE_T minimal_size = 0x100);
79
89 bool read_remote_pe_header(HANDLE processHandle, LPVOID moduleBase, OUT BYTE* buffer, const size_t bufferSize, bool force_access = false);
90
104 peconv::UNALIGNED_BUF get_remote_pe_section(HANDLE processHandle, LPVOID moduleBase, const size_t sectionNum, OUT size_t &sectionSize, bool roundup, bool force_access = false);
105
109 size_t read_remote_pe(const HANDLE processHandle, LPVOID moduleBase, const size_t moduleSize, OUT BYTE* buffer, const size_t bufferSize);
110
119 bool dump_remote_pe(
120 IN LPCTSTR outputFilePath,
121 IN const HANDLE processHandle,
122 IN LPVOID moduleBase,
123 IN OUT t_pe_dump_mode &dump_mode,
124 IN OPTIONAL peconv::ExportsMapper* exportsMap = nullptr
125 );
126
132 DWORD get_remote_image_size(IN const HANDLE processHandle, IN LPVOID start_addr);
133
134}; //namespace peconv
A definition of ExportsMapper class. Creates a lookup of all the exported functions from the supplied...
peconv::UNALIGNED_BUF get_remote_pe_section(HANDLE processHandle, LPVOID moduleBase, const size_t sectionNum, OUT size_t &sectionSize, bool roundup, bool force_access=false)
bool dump_remote_pe(IN LPCTSTR outputFilePath, IN const HANDLE processHandle, IN LPVOID moduleBase, IN OUT t_pe_dump_mode &dump_mode, IN OPTIONAL peconv::ExportsMapper *exportsMap=nullptr)
size_t read_remote_region(HANDLE processHandle, LPVOID start_addr, OUT BYTE *buffer, const size_t buffer_size, const bool force_access, const SIZE_T minimal_size=0x100)
size_t read_remote_memory(HANDLE processHandle, LPVOID start_addr, OUT BYTE *buffer, const size_t buffer_size, const SIZE_T minimal_size=0x100)
bool fetch_region_info(HANDLE processHandle, LPVOID start_addr, MEMORY_BASIC_INFORMATION &page_info)
t_pe_dump_mode
Definition pe_dumper.h:16
size_t read_remote_area(HANDLE processHandle, LPVOID start_addr, OUT BYTE *buffer, const size_t buffer_size, const bool force_access, const SIZE_T minimal_size=0x100)
bool read_remote_pe_header(HANDLE processHandle, LPVOID moduleBase, OUT BYTE *buffer, const size_t bufferSize, bool force_access=false)
PBYTE UNALIGNED_BUF
Definition buffer_util.h:41
size_t read_remote_pe(const HANDLE processHandle, LPVOID moduleBase, const size_t moduleSize, OUT BYTE *buffer, const size_t bufferSize)
size_t fetch_region_size(HANDLE processHandle, LPVOID start_addr)
ULONGLONG fetch_alloc_base(HANDLE processHandle, LPVOID start_addr)
DWORD get_remote_image_size(IN const HANDLE processHandle, IN LPVOID start_addr)
Dumping PE from the memory buffer into a file.
Wrappers over various fields in the PE header. Read, write, parse PE headers.
Converting PE from virtual to raw format.