LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
LIEF::PE::RelocationEntry Class Reference

Class which represents an entry of the PE relocation table. More...

#include <RelocationEntry.hpp>

Inheritance diagram for LIEF::PE::RelocationEntry:
Inheritance graph
[legend]
Collaboration diagram for LIEF::PE::RelocationEntry:
Collaboration graph
[legend]

Public Types

enum class  BASE_TYPES {
  UNKNOWN = -1 , ABS = 0 , HIGH = 1 , LOW = 2 ,
  HIGHLOW = 3 , HIGHADJ = 4 , MIPS_JMPADDR = 5 , ARM_MOV32A = 5 + 0x101 ,
  ARM_MOV32 = 5 + 0x102 , RISCV_HI20 = 5 + 0x103 , SECTION = 6 , REL = 7 ,
  ARM_MOV32T = 7 + 0x201 , THUMB_MOV32 = 7 + 0x202 , RISCV_LOW12I = 7 + 0x203 , RISCV_LOW12S = 8 ,
  IA64_IMM64 = 9 , MIPS_JMPADDR16 = 9 + 0x300 , DIR64 = 10 , HIGH3ADJ = 11
}
 
- Public Types inherited from LIEF::Object
template<class T >
using output_t = add_pointer_t<decay_t<T>>
 
template<class T >
using output_const_t = add_pointer_t<add_const_t<decay_t<T>>>
 

Public Member Functions

 RelocationEntry (const RelocationEntry &other)
 
RelocationEntryoperator= (RelocationEntry other)
 
 RelocationEntry (uint16_t position, BASE_TYPES type)
 
void swap (RelocationEntry &other)
 
uint64_t address () const override
 The address of the relocation.
 
void address (uint64_t address) override
 
size_t size () const override
 The size of the relocatable pointer.
 
void size (size_t size) override
 
uint16_t data () const
 Raw data of the relocation:
 
uint16_t position () const
 Offset relative to Relocation::virtual_address where the relocation occurs.
 
BASE_TYPES type () const
 Type of the relocation.
 
void data (uint16_t data)
 
void position (uint16_t position)
 
void type (BASE_TYPES type)
 
void accept (Visitor &visitor) const override
 Method so that the visitor can visit us.
 
- Public Member Functions inherited from LIEF::Relocation
 Relocation (uint64_t address, uint8_t size)
 Constructor from a relocation's address and size.
 
Relocationoperator= (const Relocation &)
 
 Relocation (const Relocation &)
 
void swap (Relocation &other)
 
virtual bool operator< (const Relocation &rhs) const
 Comparaison based on the Relocation's address
 
virtual bool operator<= (const Relocation &rhs) const
 Comparaison based on the Relocation's address
 
virtual bool operator> (const Relocation &rhs) const
 Comparaison based on the Relocation's address
 
virtual bool operator>= (const Relocation &rhs) const
 Comparaison based on the Relocation's address
 
- Public Member Functions inherited from LIEF::Object
 Object (const Object &other)
 
Objectoperator= (const Object &other)
 
template<class T >
output_t< T > as ()
 
template<class T >
output_const_t< T > as () const
 
virtual bool operator== (const Object &other) const
 
virtual bool operator!= (const Object &other) const
 

Static Public Member Functions

static RelocationEntry from_raw (Header::MACHINE_TYPES arch, uint16_t raw)
 

Detailed Description

Class which represents an entry of the PE relocation table.

It extends the LIEF::Relocation object to provide an uniform API across the file formats

Member Function Documentation

◆ accept()

void LIEF::PE::RelocationEntry::accept ( Visitor & visitor) const
overridevirtual

Method so that the visitor can visit us.

Reimplemented from LIEF::Relocation.

◆ address() [1/2]

uint64_t LIEF::PE::RelocationEntry::address ( ) const
overridevirtual

The address of the relocation.

Reimplemented from LIEF::Relocation.

◆ address() [2/2]

void LIEF::PE::RelocationEntry::address ( uint64_t address)
overridevirtual

Reimplemented from LIEF::Relocation.

◆ data()

uint16_t LIEF::PE::RelocationEntry::data ( ) const

Raw data of the relocation:

  • The high 4 bits store the relocation type
  • The low 12 bits store the relocation offset

◆ size() [1/2]

size_t LIEF::PE::RelocationEntry::size ( ) const
overridevirtual

The size of the relocatable pointer.

Reimplemented from LIEF::Relocation.

◆ size() [2/2]

void LIEF::PE::RelocationEntry::size ( size_t size)
overridevirtual

Reimplemented from LIEF::Relocation.


The documentation for this class was generated from the following file: