LIEF: Library to Instrument Executable Formats Version 0.17.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
16#ifndef LIEF_PE_RELOCATION_H
17#define LIEF_PE_RELOCATION_H
37struct pe_base_relocation_block;
48 using entries_t = std::vector<std::unique_ptr<RelocationEntry>>;
49 using it_entries = ref_iterator<entries_t&, RelocationEntry*>;
50 using it_const_entries = const_ref_iterator<const entries_t&, RelocationEntry*>;
56 block_size_(block_size),
57 virtual_address_(base)
68 Relocation&
operator=(Relocation&& other) =
default;
70 Relocation(
const details::pe_base_relocation_block& header);
73 void swap(Relocation& other);
77 return virtual_address_;
89 it_const_entries
entries()
const {
100 virtual_address_ = virtual_address;
104 block_size_ = block_size;
107 RelocationEntry&
add_entry(
const RelocationEntry& entry);
109 void accept(Visitor& visitor)
const override;
114 using relocations_t = std::vector<std::unique_ptr<Relocation>>;
119 uint32_t block_size_ = 0;
120 uint32_t virtual_address_ = 0;
Class that is used to a read stream of data from different sources.
Definition BinaryStream.hpp:33
Class which represents a PE binary This is the main interface to manage and modify a PE executable.
Definition PE/Binary.hpp:56
Class that is used to rebuild a raw PE binary from a PE::Binary object.
Definition PE/Builder.hpp:45
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition PE/Parser.hpp:52
Class which represents an entry of the PE relocation table.
Definition RelocationEntry.hpp:36
Class which represents the Base Relocation Block We usually find this structure in the ....
Definition PE/Relocation.hpp:42
Relocation & operator=(Relocation other)
it_entries entries()
Definition PE/Relocation.hpp:95
void accept(Visitor &visitor) const override
uint32_t block_size() const
The total number of bytes in the base relocation block.
Definition PE/Relocation.hpp:86
void swap(Relocation &other)
static relocations_t parse(Parser &ctx, BinaryStream &stream)
uint32_t virtual_address() const
The RVA for which the offset of the relocation entries (RelocationEntry) is added.
Definition PE/Relocation.hpp:76
RelocationEntry & add_entry(const RelocationEntry &entry)
Relocation(uint32_t base)
Definition PE/Relocation.hpp:60
void virtual_address(uint32_t virtual_address)
Definition PE/Relocation.hpp:99
~Relocation() override=default
it_const_entries entries() const
Iterator over the RelocationEntry.
Definition PE/Relocation.hpp:91
Relocation(const details::pe_base_relocation_block &header)
Relocation(const Relocation &other)
friend std::ostream & operator<<(std::ostream &os, const Relocation &relocation)
Relocation & operator=(Relocation &&other)=default
Relocation(Relocation &&)=default
Relocation(uint32_t base, uint32_t block_size)
Definition PE/Relocation.hpp:54
void block_size(uint32_t block_size)
Definition PE/Relocation.hpp:103
Definition DataDirectory.hpp:37
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42