16#ifndef LIEF_MACHO_DYNAMIC_SYMBOL_COMMAND_H
17#define LIEF_MACHO_DYNAMIC_SYMBOL_COMMAND_H
32struct dysymtab_command;
52 std::unique_ptr<LoadCommand>
clone()
const override {
60 std::ostream&
print(std::ostream& os)
const override;
64 return idx_local_symbol_;
69 return nb_local_symbols_;
74 return idx_external_define_symbol_;
79 return nb_external_define_symbols_;
84 return idx_undefined_symbol_;
89 return nb_undefined_symbols_;
111 return module_table_offset_;
118 return nb_module_table_;
125 return external_reference_symbol_offset_;
132 return nb_external_reference_symbols_;
144 return indirect_sym_offset_;
151 return nb_indirect_symbols_;
159 return external_relocation_offset_;
166 return nb_external_relocations_;
173 return local_relocation_offset_;
180 return nb_local_relocations_;
184 idx_local_symbol_ = value;
187 nb_local_symbols_ = value;
191 idx_external_define_symbol_ = value;
194 nb_external_define_symbols_ = value;
198 idx_undefined_symbol_ = value;
201 nb_undefined_symbols_ = value;
212 module_table_offset_ = value;
215 nb_module_table_ = value;
219 external_reference_symbol_offset_ = value;
222 nb_external_reference_symbols_ = value;
226 indirect_sym_offset_ = value;
229 nb_indirect_symbols_ = value;
233 external_relocation_offset_ = value;
236 nb_external_relocations_ = value;
240 local_relocation_offset_ = value;
243 nb_local_relocations_ = value;
247 return cmd->
command() == LoadCommand::TYPE::DYSYMTAB;
251 uint32_t idx_local_symbol_ = 0;
252 uint32_t nb_local_symbols_ = 0;
254 uint32_t idx_external_define_symbol_ = 0;
255 uint32_t nb_external_define_symbols_ = 0;
257 uint32_t idx_undefined_symbol_ = 0;
258 uint32_t nb_undefined_symbols_ = 0;
260 uint32_t toc_offset_ = 0;
261 uint32_t nb_toc_ = 0;
263 uint32_t module_table_offset_ = 0;
264 uint32_t nb_module_table_ = 0;
266 uint32_t external_reference_symbol_offset_ = 0;
267 uint32_t nb_external_reference_symbols_ = 0;
269 uint32_t indirect_sym_offset_ = 0;
270 uint32_t nb_indirect_symbols_ = 0;
272 uint32_t external_relocation_offset_ = 0;
273 uint32_t nb_external_relocations_ = 0;
275 uint32_t local_relocation_offset_ = 0;
276 uint32_t nb_local_relocations_ = 0;
278 std::vector<Symbol*> indirect_symbols_;
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:74
Class which represents a MachO binary.
Definition MachO/Binary.hpp:77
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:55
Class that represents the LC_DYSYMTAB command.
Definition DynamicSymbolCommand.hpp:39
uint32_t nb_module_table() const
Number of entries in the module table.
Definition DynamicSymbolCommand.hpp:117
void nb_local_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:186
void local_relocation_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:239
void idx_undefined_symbol(uint32_t value)
Definition DynamicSymbolCommand.hpp:197
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:88
void indirect_symbol_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:225
void external_reference_symbol_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:218
void idx_external_define_symbol(uint32_t value)
Definition DynamicSymbolCommand.hpp:190
uint32_t nb_indirect_symbols() const
Number of entries in the indirect symbol table.
Definition DynamicSymbolCommand.hpp:150
uint32_t nb_external_relocations() const
Number of entries in the external relocation table.
Definition DynamicSymbolCommand.hpp:165
void nb_module_table(uint32_t value)
Definition DynamicSymbolCommand.hpp:214
void external_relocation_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:232
uint32_t nb_external_define_symbols() const
Number of symbols in the group of defined external symbols.
Definition DynamicSymbolCommand.hpp:78
std::ostream & print(std::ostream &os) const override
void nb_undefined_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:200
uint32_t nb_external_reference_symbols() const
Number of entries in the external reference table.
Definition DynamicSymbolCommand.hpp:131
std::unique_ptr< LoadCommand > clone() const override
Definition DynamicSymbolCommand.hpp:52
void nb_indirect_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:228
DynamicSymbolCommand(const details::dysymtab_command &cmd)
void nb_local_relocations(uint32_t value)
Definition DynamicSymbolCommand.hpp:242
uint32_t external_relocation_offset() const
Byte offset from the start of the file to the external relocation table data.
Definition DynamicSymbolCommand.hpp:158
static bool classof(const LoadCommand *cmd)
Definition DynamicSymbolCommand.hpp:246
void toc_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:204
DynamicSymbolCommand(const DynamicSymbolCommand ©)=default
uint32_t nb_local_symbols() const
Number of symbols in the group of local symbols.
Definition DynamicSymbolCommand.hpp:68
DynamicSymbolCommand & operator=(const DynamicSymbolCommand ©)=default
uint32_t module_table_offset() const
Byte offset from the start of the file to the module table data.
Definition DynamicSymbolCommand.hpp:110
uint32_t local_relocation_offset() const
Byte offset from the start of the file to the local relocation table data.
Definition DynamicSymbolCommand.hpp:172
uint32_t indirect_symbol_offset() const
Byte offset from the start of the file to the indirect symbol table data.
Definition DynamicSymbolCommand.hpp:143
void nb_external_define_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:193
uint32_t external_reference_symbol_offset() const
Byte offset from the start of the file to the external reference table data.
Definition DynamicSymbolCommand.hpp:124
void nb_external_reference_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:221
uint32_t toc_offset() const
Byte offset from the start of the file to the table of contents data.
Definition DynamicSymbolCommand.hpp:96
void nb_toc(uint32_t value)
Definition DynamicSymbolCommand.hpp:207
uint32_t nb_local_relocations() const
Number of entries in the local relocation table.
Definition DynamicSymbolCommand.hpp:179
uint32_t idx_external_define_symbol() const
Index of the first symbol in the group of defined external symbols.
Definition DynamicSymbolCommand.hpp:73
uint32_t nb_toc() const
Number of entries in the table of contents.
Definition DynamicSymbolCommand.hpp:103
uint32_t idx_local_symbol() const
Index of the first symbol in the group of local symbols.
Definition DynamicSymbolCommand.hpp:63
void nb_external_relocations(uint32_t value)
Definition DynamicSymbolCommand.hpp:235
void module_table_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:211
void idx_local_symbol(uint32_t value)
Definition DynamicSymbolCommand.hpp:183
~DynamicSymbolCommand() override=default
uint32_t idx_undefined_symbol() const
Index of the first symbol in the group of undefined external symbols.
Definition DynamicSymbolCommand.hpp:83
Based class for the Mach-O load commands.
Definition LoadCommand.hpp:36
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:122
Definition Visitor.hpp:224
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41