LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
LIEF::PE::TLS Class Reference

Class which represents the PE Thread Local Storage. More...

#include <TLS.hpp>

Inheritance diagram for LIEF::PE::TLS:
Collaboration diagram for LIEF::PE::TLS:

Public Member Functions

 TLS (const details::pe32_tls &header)
 
 TLS (const details::pe64_tls &header)
 
 TLS (const TLS &copy)=default
 
TLSoperator= (const TLS &copy)=default
 
 TLS (TLS &&other) noexcept=default
 
TLSoperator= (TLS &&other) noexcept=default
 
const std::vector< uint64_t > & callbacks () const
 List of the callback associated with the current TLS.
 
const std::pair< uint64_t, uint64_t > & addressof_raw_data () const
 Pair (start address, end address) of the TLS template. The template is a block of data that is used to initialize TLS data. The system copies all of this data each time a thread is created, so it must not be corrupted.
 
uint64_t addressof_index () const
 The location to receive the TLS index assigned by the loader. This location should be located in a writable section like .data
 
uint64_t addressof_callbacks () const
 Pointer to an array of TLS callback functions.
 
uint32_t sizeof_zero_fill () const
 Size in bytes of the zero to be padded after the data specified by data_template.
 
uint32_t characteristics () const
 The four bits [23:20] describe alignment info. Possible values are those defined as IMAGE_SCN_ALIGN_*, which are also used to describe alignment of section in object files. The other 28 bits are reserved for future use.
 
span< const uint8_t > data_template () const
 The initial content used to initialize TLS data.
 
bool has_data_directory () const
 True if there is a data directory associated with this entry.
 
DataDirectorydirectory ()
 Return the DataDirectory associated with this object or a nullptr If it exists, its type should be DataDirectory::TYPES::TLS_TABLE.
 
const DataDirectorydirectory () const
 
bool has_section () const
 Check if there is a section associated with this entry.
 
Sectionsection ()
 The section associated with the entry (or a nullptr)
 
const Sectionsection () const
 
void callbacks (std::vector< uint64_t > callbacks)
 
void addressof_raw_data (std::pair< uint64_t, uint64_t > addresses)
 
void addressof_index (uint64_t addr_idx)
 
void addressof_callbacks (uint64_t addr)
 
void sizeof_zero_fill (uint32_t size)
 
void characteristics (uint32_t characteristics)
 
void data_template (std::vector< uint8_t > data_template)
 
void accept (Visitor &visitor) const override
 
- 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
 

Additional Inherited Members

- 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>>>
 

Detailed Description

Class which represents the PE Thread Local Storage.

This PE structure is also used to implement binary/library constructors.

Member Function Documentation

◆ accept()

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

Implements LIEF::Object.

◆ addressof_callbacks()

uint64_t LIEF::PE::TLS::addressof_callbacks ( ) const
inline

Pointer to an array of TLS callback functions.

The array is null-terminated, so if there is no callback function this field points to 4 bytes set to zero.

◆ addressof_raw_data()

const std::pair< uint64_t, uint64_t > & LIEF::PE::TLS::addressof_raw_data ( ) const
inline

Pair (start address, end address) of the TLS template. The template is a block of data that is used to initialize TLS data. The system copies all of this data each time a thread is created, so it must not be corrupted.

Note
These addresses are not RVA. It is addresses for which there should be a rebase relocation in the .reloc section.

◆ callbacks()

const std::vector< uint64_t > & LIEF::PE::TLS::callbacks ( ) const
inline

List of the callback associated with the current TLS.

These functions are called before any other functions .


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