22#include "LIEF/span.hpp"
23#include "LIEF/Object.hpp"
24#include "LIEF/visibility.h"
48 TLS(
const details::pe32_tls& header);
49 TLS(
const details::pe64_tls& header);
50 ~TLS()
override =
default;
52 TLS(
const TLS& copy) =
default;
53 TLS& operator=(
const TLS& copy) =
default;
55 TLS(
TLS&& other)
noexcept =
default;
56 TLS& operator=(
TLS&& other)
noexcept =
default;
80 return addressof_index_;
88 return addressof_callbacks_;
94 return sizeof_zero_fill_;
102 return characteristics_;
107 return data_template_;
112 return directory_ !=
nullptr;
127 return section_ !=
nullptr;
135 const Section* section()
const {
139 void callbacks(std::vector<uint64_t> callbacks) {
140 callbacks_ = std::move(callbacks);
143 void addressof_raw_data(std::pair<uint64_t, uint64_t> addresses) {
144 va_rawdata_ = addresses;
147 void addressof_index(uint64_t addr_idx) {
148 addressof_index_ = addr_idx;
151 void addressof_callbacks(uint64_t addr) {
152 addressof_callbacks_ = addr;
155 void sizeof_zero_fill(uint32_t size) {
156 sizeof_zero_fill_ = size;
159 void characteristics(uint32_t characteristics) {
160 characteristics_ = characteristics;
163 void data_template(std::vector<uint8_t> data_template) {
164 data_template_ = std::move(data_template);
167 void accept(Visitor& visitor)
const override;
169 LIEF_API
friend std::ostream& operator<<(std::ostream& os,
const TLS& entry);
172 std::vector<uint64_t> callbacks_;
173 std::pair<uint64_t, uint64_t> va_rawdata_;
174 uint64_t addressof_index_ = 0;
175 uint64_t addressof_callbacks_ = 0;
176 uint32_t sizeof_zero_fill_ = 0;
177 uint32_t characteristics_ = 0;
178 DataDirectory* directory_ =
nullptr;
179 Section* section_ =
nullptr;
180 std::vector<uint8_t> data_template_;
Class that is used to rebuild a raw PE binary from a PE::Binary object.
Definition PE/Builder.hpp:45
Class that represents a PE data directory entry.
Definition DataDirectory.hpp:38
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition PE/Parser.hpp:47
Class which represents a PE section.
Definition PE/Section.hpp:40
Class which represents the PE Thread Local Storage.
Definition TLS.hpp:42
DataDirectory * directory()
Return the DataDirectory associated with this object or a nullptr If it exists, its type should be Da...
Definition TLS.hpp:117
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 t...
Definition TLS.hpp:73
const std::vector< uint64_t > & callbacks() const
List of the callback associated with the current TLS.
Definition TLS.hpp:61
uint32_t sizeof_zero_fill() const
Size in bytes of the zero to be padded after the data specified by data_template.
Definition TLS.hpp:93
bool has_section() const
Check if there is a section associated with this entry.
Definition TLS.hpp:126
uint32_t characteristics() const
The four bits [23:20] describe alignment info. Possible values are those defined as IMAGE_SCN_ALIGN_*...
Definition TLS.hpp:101
uint64_t addressof_callbacks() const
Pointer to an array of TLS callback functions.
Definition TLS.hpp:87
Section * section()
The section associated with the entry (or a nullptr)
Definition TLS.hpp:131
uint64_t addressof_index() const
The location to receive the TLS index assigned by the loader. This location should be located in a wr...
Definition TLS.hpp:79
bool has_data_directory() const
True if there is a data directory associated with this entry.
Definition TLS.hpp:111
span< const uint8_t > data_template() const
The initial content used to initialize TLS data.
Definition TLS.hpp:106
LIEF namespace.
Definition Abstract/Binary.hpp:31