libPeConv
A library to load, manipulate, dump PE files.
Loading...
Searching...
No Matches
relocate.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <windows.h>
9
10namespace peconv {
11
12 typedef struct _BASE_RELOCATION_ENTRY {
13 WORD Offset : 12;
14 WORD Type : 4;
16
18 {
19 public:
20 RelocBlockCallback(bool _is64bit)
21 : is64bit(_is64bit)
22 {
23 }
24
25 virtual bool processRelocField(ULONG_PTR relocField) = 0;
26
27 protected:
28 bool is64bit;
29 };
30
31 // Processs the relocation table and make your own callback on each relocation field
32 bool process_relocation_table(IN PVOID modulePtr, IN SIZE_T moduleSize, IN RelocBlockCallback *callback);
33
42 bool relocate_module(IN BYTE* modulePtr, IN SIZE_T moduleSize, IN ULONGLONG newBase, IN ULONGLONG oldBase = 0);
43
49 bool has_valid_relocation_table(IN const PBYTE modulePtr, IN const size_t moduleSize);
50
51};//namespace peconv
RelocBlockCallback(bool _is64bit)
Definition relocate.h:20
virtual bool processRelocField(ULONG_PTR relocField)=0
bool process_relocation_table(IN PVOID modulePtr, IN SIZE_T moduleSize, IN RelocBlockCallback *callback)
Definition relocate.cpp:101
bool relocate_module(IN BYTE *modulePtr, IN SIZE_T moduleSize, IN ULONGLONG newBase, IN ULONGLONG oldBase=0)
Definition relocate.cpp:158
struct peconv::_BASE_RELOCATION_ENTRY BASE_RELOCATION_ENTRY
bool has_valid_relocation_table(IN const PBYTE modulePtr, IN const size_t moduleSize)
Definition relocate.cpp:185