15#ifndef LIEF_MACHO_DYNAMIC_SYMBOL_COMMAND_H
16#define LIEF_MACHO_DYNAMIC_SYMBOL_COMMAND_H
33struct dysymtab_command;
60 std::unique_ptr<LoadCommand>
clone()
const override {
61 return std::make_unique<DynamicSymbolCommand>(*
this);
68 std::ostream&
print(std::ostream& os)
const override;
72 return idx_local_symbol_;
77 return nb_local_symbols_;
82 return idx_external_define_symbol_;
87 return nb_external_define_symbols_;
92 return idx_undefined_symbol_;
97 return nb_undefined_symbols_;
119 return module_table_offset_;
126 return nb_module_table_;
133 return external_reference_symbol_offset_;
140 return nb_external_reference_symbols_;
152 return indirect_sym_offset_;
159 return nb_indirect_symbols_;
167 return external_relocation_offset_;
174 return nb_external_relocations_;
181 return local_relocation_offset_;
188 return nb_local_relocations_;
192 idx_local_symbol_ = value;
196 nb_local_symbols_ = value;
200 idx_external_define_symbol_ = value;
204 nb_external_define_symbols_ = value;
208 idx_undefined_symbol_ = value;
212 nb_undefined_symbols_ = value;
224 module_table_offset_ = value;
228 nb_module_table_ = value;
232 external_reference_symbol_offset_ = value;
236 nb_external_reference_symbols_ = value;
240 indirect_sym_offset_ = value;
244 nb_indirect_symbols_ = value;
248 external_relocation_offset_ = value;
252 nb_external_relocations_ = value;
256 local_relocation_offset_ = value;
260 nb_local_relocations_ = value;
265 return indirect_symbols_;
269 return indirect_symbols_;
277 uint32_t idx_local_symbol_ = 0;
278 uint32_t nb_local_symbols_ = 0;
280 uint32_t idx_external_define_symbol_ = 0;
281 uint32_t nb_external_define_symbols_ = 0;
283 uint32_t idx_undefined_symbol_ = 0;
284 uint32_t nb_undefined_symbols_ = 0;
286 uint32_t toc_offset_ = 0;
287 uint32_t nb_toc_ = 0;
289 uint32_t module_table_offset_ = 0;
290 uint32_t nb_module_table_ = 0;
292 uint32_t external_reference_symbol_offset_ = 0;
293 uint32_t nb_external_reference_symbols_ = 0;
295 uint32_t indirect_sym_offset_ = 0;
296 uint32_t nb_indirect_symbols_ = 0;
298 uint32_t external_relocation_offset_ = 0;
299 uint32_t nb_external_relocations_ = 0;
301 uint32_t local_relocation_offset_ = 0;
302 uint32_t nb_local_relocations_ = 0;
304 indirect_symbols_t indirect_symbols_;
Class used to parse a single binary (i.e. non-FAT).
Definition BinaryParser.hpp:80
Class which represents a MachO binary.
Definition MachO/Binary.hpp:93
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:63
uint32_t nb_module_table() const
Number of entries in the module table.
Definition DynamicSymbolCommand.hpp:125
void nb_local_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:195
void local_relocation_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:255
void idx_undefined_symbol(uint32_t value)
Definition DynamicSymbolCommand.hpp:207
void accept(Visitor &visitor) const override
uint32_t nb_undefined_symbols() const
Number of symbols in the group of undefined external symbols.
Definition DynamicSymbolCommand.hpp:96
void indirect_symbol_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:239
void external_reference_symbol_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:231
void idx_external_define_symbol(uint32_t value)
Definition DynamicSymbolCommand.hpp:199
uint32_t nb_indirect_symbols() const
Number of entries in the indirect symbol table.
Definition DynamicSymbolCommand.hpp:158
uint32_t nb_external_relocations() const
Number of entries in the external relocation table.
Definition DynamicSymbolCommand.hpp:173
void nb_module_table(uint32_t value)
Definition DynamicSymbolCommand.hpp:227
friend class BinaryParser
Definition DynamicSymbolCommand.hpp:41
void external_relocation_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:247
it_indirect_symbols indirect_symbols()
Iterator over the indirect symbols indexed by this command.
Definition DynamicSymbolCommand.hpp:264
uint32_t nb_external_define_symbols() const
Number of symbols in the group of defined external symbols.
Definition DynamicSymbolCommand.hpp:86
std::ostream & print(std::ostream &os) const override
void nb_undefined_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:211
uint32_t nb_external_reference_symbols() const
Number of entries in the external reference table.
Definition DynamicSymbolCommand.hpp:139
std::unique_ptr< LoadCommand > clone() const override
Definition DynamicSymbolCommand.hpp:60
const_ref_iterator< const indirect_symbols_t & > it_const_indirect_symbols
Definition DynamicSymbolCommand.hpp:51
void nb_indirect_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:243
DynamicSymbolCommand(const details::dysymtab_command &cmd)
void nb_local_relocations(uint32_t value)
Definition DynamicSymbolCommand.hpp:259
uint32_t external_relocation_offset() const
Byte offset from the start of the file to the external relocation table data.
Definition DynamicSymbolCommand.hpp:166
friend class Builder
Definition DynamicSymbolCommand.hpp:42
static bool classof(const LoadCommand *cmd)
Definition DynamicSymbolCommand.hpp:272
void toc_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:215
DynamicSymbolCommand(const DynamicSymbolCommand ©)=default
uint32_t nb_local_symbols() const
Number of symbols in the group of local symbols.
Definition DynamicSymbolCommand.hpp:76
DynamicSymbolCommand & operator=(const DynamicSymbolCommand ©)=default
friend class Binary
Definition DynamicSymbolCommand.hpp:43
uint32_t module_table_offset() const
Byte offset from the start of the file to the module table data.
Definition DynamicSymbolCommand.hpp:118
uint32_t local_relocation_offset() const
Byte offset from the start of the file to the local relocation table data.
Definition DynamicSymbolCommand.hpp:180
uint32_t indirect_symbol_offset() const
Byte offset from the start of the file to the indirect symbol table data.
Definition DynamicSymbolCommand.hpp:151
void nb_external_define_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:203
uint32_t external_reference_symbol_offset() const
Byte offset from the start of the file to the external reference table data.
Definition DynamicSymbolCommand.hpp:132
it_const_indirect_symbols indirect_symbols() const
Definition DynamicSymbolCommand.hpp:268
void nb_external_reference_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:235
std::vector< Symbol * > indirect_symbols_t
Container for the indirect symbols references (owned by MachO::Binary).
Definition DynamicSymbolCommand.hpp:47
uint32_t toc_offset() const
Byte offset from the start of the file to the table of contents data.
Definition DynamicSymbolCommand.hpp:104
void nb_toc(uint32_t value)
Definition DynamicSymbolCommand.hpp:219
uint32_t nb_local_relocations() const
Number of entries in the local relocation table.
Definition DynamicSymbolCommand.hpp:187
uint32_t idx_external_define_symbol() const
Index of the first symbol in the group of defined external symbols.
Definition DynamicSymbolCommand.hpp:81
uint32_t nb_toc() const
Number of entries in the table of contents.
Definition DynamicSymbolCommand.hpp:111
uint32_t idx_local_symbol() const
Index of the first symbol in the group of local symbols.
Definition DynamicSymbolCommand.hpp:71
void nb_external_relocations(uint32_t value)
Definition DynamicSymbolCommand.hpp:251
void module_table_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:223
void idx_local_symbol(uint32_t value)
Definition DynamicSymbolCommand.hpp:191
ref_iterator< indirect_symbols_t & > it_indirect_symbols
Iterator for the indirect symbols referenced by this command.
Definition DynamicSymbolCommand.hpp:50
~DynamicSymbolCommand() override=default
uint32_t idx_undefined_symbol() const
Index of the first symbol in the group of undefined external symbols.
Definition DynamicSymbolCommand.hpp:91
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:131
@ DYSYMTAB
Definition LoadCommand.hpp:58
Class that represents a Symbol in a Mach-O file.
Definition MachO/Symbol.hpp:46
Definition Visitor.hpp:211
Iterator which returns reference on container's values.
Definition iterators.hpp:120
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Definition endianness_support.hpp:62
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:35
ref_iterator< CT, U, typename decay_t< CT >::const_iterator > const_ref_iterator
Iterator which returns a const ref on container's values.
Definition iterators.hpp:385
#define LIEF_API
Definition visibility.h:44