16#ifndef LIEF_MACHO_DYNAMIC_SYMBOL_COMMAND_H
17#define LIEF_MACHO_DYNAMIC_SYMBOL_COMMAND_H
20#include "LIEF/visibility.h"
22#include "LIEF/MachO/LoadCommand.hpp"
32struct dysymtab_command;
52 std::unique_ptr<LoadCommand> clone()
const override {
58 void accept(
Visitor& visitor)
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_;
183 void idx_local_symbol(uint32_t value) {
184 idx_local_symbol_ = value;
186 void nb_local_symbols(uint32_t value) {
187 nb_local_symbols_ = value;
190 void idx_external_define_symbol(uint32_t value) {
191 idx_external_define_symbol_ = value;
193 void nb_external_define_symbols(uint32_t value) {
194 nb_external_define_symbols_ = value;
197 void idx_undefined_symbol(uint32_t value) {
198 idx_undefined_symbol_ = value;
200 void nb_undefined_symbols(uint32_t value) {
201 nb_undefined_symbols_ = value;
204 void toc_offset(uint32_t value) {
207 void nb_toc(uint32_t value) {
211 void module_table_offset(uint32_t value) {
212 module_table_offset_ = value;
214 void nb_module_table(uint32_t value) {
215 nb_module_table_ = value;
218 void external_reference_symbol_offset(uint32_t value) {
219 external_reference_symbol_offset_ = value;
221 void nb_external_reference_symbols(uint32_t value) {
222 nb_external_reference_symbols_ = value;
225 void indirect_symbol_offset(uint32_t value) {
226 indirect_sym_offset_ = value;
228 void nb_indirect_symbols(uint32_t value) {
229 nb_indirect_symbols_ = value;
232 void external_relocation_offset(uint32_t value) {
233 external_relocation_offset_ = value;
235 void nb_external_relocations(uint32_t value) {
236 nb_external_relocations_ = value;
239 void local_relocation_offset(uint32_t value) {
240 local_relocation_offset_ = value;
242 void nb_local_relocations(uint32_t value) {
243 nb_local_relocations_ = value;
246 static bool classof(
const LoadCommand* cmd) {
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:73
Class which represents a MachO binary.
Definition MachO/Binary.hpp:73
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:54
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
uint32_t nb_undefined_symbols() const
Number of symbols in the group of undefined external symbols.
Definition DynamicSymbolCommand.hpp:88
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
uint32_t nb_external_define_symbols() const
Number of symbols in the group of defined external symbols.
Definition DynamicSymbolCommand.hpp:78
uint32_t nb_external_reference_symbols() const
Number of entries in the external reference table.
Definition DynamicSymbolCommand.hpp:131
uint32_t external_relocation_offset() const
Byte offset from the start of the file to the external relocation table data.
Definition DynamicSymbolCommand.hpp:158
uint32_t nb_local_symbols() const
Number of symbols in the group of local symbols.
Definition DynamicSymbolCommand.hpp:68
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
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
uint32_t toc_offset() const
Byte offset from the start of the file to the table of contents data.
Definition DynamicSymbolCommand.hpp:96
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
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
Definition Visitor.hpp:219
LIEF namespace.
Definition Abstract/Binary.hpp:32