16#ifndef LIEF_MACHO_DYNAMIC_SYMBOL_COMMAND_H
17#define LIEF_MACHO_DYNAMIC_SYMBOL_COMMAND_H
34struct dysymtab_command;
61 std::unique_ptr<LoadCommand>
clone()
const override {
62 return std::make_unique<DynamicSymbolCommand>(*
this);
69 std::ostream&
print(std::ostream& os)
const override;
73 return idx_local_symbol_;
78 return nb_local_symbols_;
83 return idx_external_define_symbol_;
88 return nb_external_define_symbols_;
93 return idx_undefined_symbol_;
98 return nb_undefined_symbols_;
120 return module_table_offset_;
127 return nb_module_table_;
134 return external_reference_symbol_offset_;
141 return nb_external_reference_symbols_;
153 return indirect_sym_offset_;
160 return nb_indirect_symbols_;
168 return external_relocation_offset_;
175 return nb_external_relocations_;
182 return local_relocation_offset_;
189 return nb_local_relocations_;
193 idx_local_symbol_ = value;
196 nb_local_symbols_ = value;
200 idx_external_define_symbol_ = value;
203 nb_external_define_symbols_ = value;
207 idx_undefined_symbol_ = value;
210 nb_undefined_symbols_ = value;
221 module_table_offset_ = value;
224 nb_module_table_ = value;
228 external_reference_symbol_offset_ = value;
231 nb_external_reference_symbols_ = value;
235 indirect_sym_offset_ = value;
238 nb_indirect_symbols_ = value;
242 external_relocation_offset_ = value;
245 nb_external_relocations_ = value;
249 local_relocation_offset_ = value;
252 nb_local_relocations_ = value;
257 return indirect_symbols_;
261 return indirect_symbols_;
269 uint32_t idx_local_symbol_ = 0;
270 uint32_t nb_local_symbols_ = 0;
272 uint32_t idx_external_define_symbol_ = 0;
273 uint32_t nb_external_define_symbols_ = 0;
275 uint32_t idx_undefined_symbol_ = 0;
276 uint32_t nb_undefined_symbols_ = 0;
278 uint32_t toc_offset_ = 0;
279 uint32_t nb_toc_ = 0;
281 uint32_t module_table_offset_ = 0;
282 uint32_t nb_module_table_ = 0;
284 uint32_t external_reference_symbol_offset_ = 0;
285 uint32_t nb_external_reference_symbols_ = 0;
287 uint32_t indirect_sym_offset_ = 0;
288 uint32_t nb_indirect_symbols_ = 0;
290 uint32_t external_relocation_offset_ = 0;
291 uint32_t nb_external_relocations_ = 0;
293 uint32_t local_relocation_offset_ = 0;
294 uint32_t nb_local_relocations_ = 0;
296 indirect_symbols_t indirect_symbols_;
Class used to parse a single binary (i.e. non-FAT).
Definition BinaryParser.hpp:79
Class which represents a MachO binary.
Definition MachO/Binary.hpp:94
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:64
uint32_t nb_module_table() const
Number of entries in the module table.
Definition DynamicSymbolCommand.hpp:126
void nb_local_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:195
void local_relocation_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:248
void idx_undefined_symbol(uint32_t value)
Definition DynamicSymbolCommand.hpp:206
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:97
void indirect_symbol_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:234
void external_reference_symbol_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:227
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:159
uint32_t nb_external_relocations() const
Number of entries in the external relocation table.
Definition DynamicSymbolCommand.hpp:174
void nb_module_table(uint32_t value)
Definition DynamicSymbolCommand.hpp:223
friend class BinaryParser
Definition DynamicSymbolCommand.hpp:42
void external_relocation_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:241
it_indirect_symbols indirect_symbols()
Iterator over the indirect symbols indexed by this command.
Definition DynamicSymbolCommand.hpp:256
uint32_t nb_external_define_symbols() const
Number of symbols in the group of defined external symbols.
Definition DynamicSymbolCommand.hpp:87
std::ostream & print(std::ostream &os) const override
void nb_undefined_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:209
uint32_t nb_external_reference_symbols() const
Number of entries in the external reference table.
Definition DynamicSymbolCommand.hpp:140
std::unique_ptr< LoadCommand > clone() const override
Definition DynamicSymbolCommand.hpp:61
const_ref_iterator< const indirect_symbols_t & > it_const_indirect_symbols
Definition DynamicSymbolCommand.hpp:52
void nb_indirect_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:237
DynamicSymbolCommand(const details::dysymtab_command &cmd)
void nb_local_relocations(uint32_t value)
Definition DynamicSymbolCommand.hpp:251
uint32_t external_relocation_offset() const
Byte offset from the start of the file to the external relocation table data.
Definition DynamicSymbolCommand.hpp:167
friend class Builder
Definition DynamicSymbolCommand.hpp:43
static bool classof(const LoadCommand *cmd)
Definition DynamicSymbolCommand.hpp:264
void toc_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:213
DynamicSymbolCommand(const DynamicSymbolCommand ©)=default
uint32_t nb_local_symbols() const
Number of symbols in the group of local symbols.
Definition DynamicSymbolCommand.hpp:77
DynamicSymbolCommand & operator=(const DynamicSymbolCommand ©)=default
friend class Binary
Definition DynamicSymbolCommand.hpp:44
uint32_t module_table_offset() const
Byte offset from the start of the file to the module table data.
Definition DynamicSymbolCommand.hpp:119
uint32_t local_relocation_offset() const
Byte offset from the start of the file to the local relocation table data.
Definition DynamicSymbolCommand.hpp:181
uint32_t indirect_symbol_offset() const
Byte offset from the start of the file to the indirect symbol table data.
Definition DynamicSymbolCommand.hpp:152
void nb_external_define_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:202
uint32_t external_reference_symbol_offset() const
Byte offset from the start of the file to the external reference table data.
Definition DynamicSymbolCommand.hpp:133
it_const_indirect_symbols indirect_symbols() const
Definition DynamicSymbolCommand.hpp:260
void nb_external_reference_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:230
std::vector< Symbol * > indirect_symbols_t
Container for the indirect symbols references (owned by MachO::Binary).
Definition DynamicSymbolCommand.hpp:48
uint32_t toc_offset() const
Byte offset from the start of the file to the table of contents data.
Definition DynamicSymbolCommand.hpp:105
void nb_toc(uint32_t value)
Definition DynamicSymbolCommand.hpp:216
uint32_t nb_local_relocations() const
Number of entries in the local relocation table.
Definition DynamicSymbolCommand.hpp:188
uint32_t idx_external_define_symbol() const
Index of the first symbol in the group of defined external symbols.
Definition DynamicSymbolCommand.hpp:82
uint32_t nb_toc() const
Number of entries in the table of contents.
Definition DynamicSymbolCommand.hpp:112
uint32_t idx_local_symbol() const
Index of the first symbol in the group of local symbols.
Definition DynamicSymbolCommand.hpp:72
void nb_external_relocations(uint32_t value)
Definition DynamicSymbolCommand.hpp:244
void module_table_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:220
void idx_local_symbol(uint32_t value)
Definition DynamicSymbolCommand.hpp:192
ref_iterator< indirect_symbols_t & > it_indirect_symbols
Iterator for the indirect symbols referenced by this command.
Definition DynamicSymbolCommand.hpp:51
~DynamicSymbolCommand() override=default
uint32_t idx_undefined_symbol() const
Index of the first symbol in the group of undefined external symbols.
Definition DynamicSymbolCommand.hpp:92
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:132
@ DYSYMTAB
Definition LoadCommand.hpp:59
Class that represents a Symbol in a Mach-O file.
Definition MachO/Symbol.hpp:47
Definition Visitor.hpp:212
Iterator which returns reference on container's values.
Definition iterators.hpp:47
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Definition endianness_support.hpp:59
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
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:316
#define LIEF_API
Definition visibility.h:45