libPeConv
A library to load, manipulate, dump PE files.
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "file_util.h"
9#include "resource_util.h"
10
11#ifdef _MSC_VER
12#define PECONV_FORCEINLINE __forceinline
13#define PECONV_TRY_EXCEPT_BLOCK_START __try {
14#define PECONV_TRY_EXCEPT_BLOCK_END __except (EXCEPTION_EXECUTE_HANDLER) {
15#else
16#define PECONV_FORCEINLINE __attribute__((always_inline)) inline
17#define PECONV_TRY_EXCEPT_BLOCK_START try {
18#define PECONV_TRY_EXCEPT_BLOCK_END catch (...) {
19#endif
20
21
22namespace peconv {
29 bool is_padding(const BYTE* cave_ptr, size_t cave_size, const BYTE padding_char);
30
34 DWORD get_process_id(HANDLE hProcess);
35
43 bool is_mem_accessible(LPCVOID areaStart, SIZE_T areaSize, DWORD accessRights);
44
50 bool is_bad_read_ptr(LPCVOID areaStart, SIZE_T areaSize);
51};
Functions related to operations on files. Wrappers for read/write.
DWORD get_process_id(HANDLE hProcess)
Definition util.cpp:76
bool is_mem_accessible(LPCVOID areaStart, SIZE_T areaSize, DWORD accessRights)
Definition util.cpp:110
bool is_padding(const BYTE *cave_ptr, size_t cave_size, const BYTE padding_char)
Definition util.cpp:100
bool is_bad_read_ptr(LPCVOID areaStart, SIZE_T areaSize)
Definition util.cpp:150
Functions related to manual retrieving of PE resources.