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

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

#include <TLS.hpp>

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

Public Member Functions

 TLS (const details::pe32_tls &header)
 
 TLS (const details::pe64_tls &header)
 
 TLS (const TLS &copy)
 
TLSoperator= (const TLS &copy)
 
 TLS (TLS &&other)
 
TLSoperator= (TLS &&other)
 
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, which the loader assigns. This location is in an ordinary data section, so it can be given a symbolic name that is accessible to the program.
 
uint64_t addressof_callbacks () const
 The pointer to an array of TLS callback functions.
 
uint32_t sizeof_zero_fill () const
 The size in bytes of the template, beyond the initialized data delimited by the addressof_raw_data field. The total template size should be the same as the total size of TLS data in the image file. The zero fill is the amount of data that comes after the initialized nonzero data.
 
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 data template content.
 
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

The pointer to an array of TLS callback functions.

The array is null-terminated, so if no callback function is supported, 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 of the PE binary.


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