22#include "LIEF/span.hpp"
23#include "LIEF/Object.hpp"
24#include "LIEF/visibility.h"
26#include "LIEF/PE/enums.hpp"
51 TLS(
const details::pe32_tls& header);
52 TLS(
const details::pe64_tls& header);
56 TLS& operator=(
const TLS& copy);
59 TLS& operator=(
TLS&& other);
84 return addressof_index_;
93 return addressof_callbacks_;
101 return sizeof_zero_fill_;
108 return characteristics_;
113 return data_template_;
118 return directory_ !=
nullptr;
133 return section_ !=
nullptr;
141 const Section* section()
const {
145 void callbacks(std::vector<uint64_t> callbacks) {
146 callbacks_ = std::move(callbacks);
149 void addressof_raw_data(std::pair<uint64_t, uint64_t> addresses) {
150 va_rawdata_ = addresses;
153 void addressof_index(uint64_t addr_idx) {
154 addressof_index_ = addr_idx;
157 void addressof_callbacks(uint64_t addr) {
158 addressof_callbacks_ = addr;
161 void sizeof_zero_fill(uint32_t size) {
162 sizeof_zero_fill_ = size;
165 void characteristics(uint32_t characteristics) {
166 characteristics_ = characteristics;
169 void data_template(std::vector<uint8_t> data_template) {
170 data_template_ = std::move(data_template);
173 void accept(Visitor& visitor)
const override;
175 LIEF_API
friend std::ostream& operator<<(std::ostream& os,
const TLS& entry);
178 std::vector<uint64_t> callbacks_;
179 std::pair<uint64_t, uint64_t> va_rawdata_;
180 uint64_t addressof_index_ = 0;
181 uint64_t addressof_callbacks_ = 0;
182 uint32_t sizeof_zero_fill_ = 0;
183 uint32_t characteristics_ = 0;
184 DataDirectory* directory_ =
nullptr;
185 Section* section_ =
nullptr;
186 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:41
Class which represents the PE Thread Local Storage.
Definition TLS.hpp:45
DataDirectory * directory()
Return the DataDirectory associated with this object or a nullptr If it exists, its type should be Da...
Definition TLS.hpp:123
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:76
const std::vector< uint64_t > & callbacks() const
List of the callback associated with the current TLS.
Definition TLS.hpp:64
uint32_t sizeof_zero_fill() const
The size in bytes of the template, beyond the initialized data delimited by the addressof_raw_data fi...
Definition TLS.hpp:100
bool has_section() const
Check if there is a section associated with this entry.
Definition TLS.hpp:132
uint32_t characteristics() const
The four bits [23:20] describe alignment info. Possible values are those defined as IMAGE_SCN_ALIGN_*...
Definition TLS.hpp:107
uint64_t addressof_callbacks() const
The pointer to an array of TLS callback functions.
Definition TLS.hpp:92
Section * section()
The section associated with the entry (or a nullptr)
Definition TLS.hpp:137
uint64_t addressof_index() const
The location to receive the TLS index, which the loader assigns. This location is in an ordinary data...
Definition TLS.hpp:83
bool has_data_directory() const
True if there is a data directory associated with this entry.
Definition TLS.hpp:117
span< const uint8_t > data_template() const
The data template content.
Definition TLS.hpp:112
LIEF namespace.
Definition Abstract/Binary.hpp:32