LIEF: Library to Instrument Executable Formats Version 0.16.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
16#ifndef LIEF_MACHO_DYNAMIC_SYMBOL_COMMAND_H
17#define LIEF_MACHO_DYNAMIC_SYMBOL_COMMAND_H
33struct dysymtab_command;
41 friend class BinaryParser;
45 public:
using indirect_symbols_t = std::vector<Symbol*>;
48 using it_indirect_symbols = ref_iterator<indirect_symbols_t&>;
51 using it_const_indirect_symbols = const_ref_iterator<const indirect_symbols_t&>;
57 DynamicSymbolCommand&
operator=(
const DynamicSymbolCommand& copy) =
default;
60 std::unique_ptr<LoadCommand>
clone()
const override {
61 return std::unique_ptr<DynamicSymbolCommand>(
new DynamicSymbolCommand(*
this));
66 void accept(Visitor& visitor)
const override;
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;
195 nb_local_symbols_ = value;
199 idx_external_define_symbol_ = value;
202 nb_external_define_symbols_ = value;
206 idx_undefined_symbol_ = value;
209 nb_undefined_symbols_ = value;
220 module_table_offset_ = value;
223 nb_module_table_ = value;
227 external_reference_symbol_offset_ = value;
230 nb_external_reference_symbols_ = value;
234 indirect_sym_offset_ = value;
237 nb_indirect_symbols_ = value;
241 external_relocation_offset_ = value;
244 nb_external_relocations_ = value;
248 local_relocation_offset_ = value;
251 nb_local_relocations_ = value;
256 return indirect_symbols_;
260 return indirect_symbols_;
264 return cmd->
command() == LoadCommand::TYPE::DYSYMTAB;
268 uint32_t idx_local_symbol_ = 0;
269 uint32_t nb_local_symbols_ = 0;
271 uint32_t idx_external_define_symbol_ = 0;
272 uint32_t nb_external_define_symbols_ = 0;
274 uint32_t idx_undefined_symbol_ = 0;
275 uint32_t nb_undefined_symbols_ = 0;
277 uint32_t toc_offset_ = 0;
278 uint32_t nb_toc_ = 0;
280 uint32_t module_table_offset_ = 0;
281 uint32_t nb_module_table_ = 0;
283 uint32_t external_reference_symbol_offset_ = 0;
284 uint32_t nb_external_reference_symbols_ = 0;
286 uint32_t indirect_sym_offset_ = 0;
287 uint32_t nb_indirect_symbols_ = 0;
289 uint32_t external_relocation_offset_ = 0;
290 uint32_t nb_external_relocations_ = 0;
292 uint32_t local_relocation_offset_ = 0;
293 uint32_t nb_local_relocations_ = 0;
295 indirect_symbols_t 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:85
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:57
Class that represents the LC_DYSYMTAB command.
Definition DynamicSymbolCommand.hpp:40
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:194
void local_relocation_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:247
void idx_undefined_symbol(uint32_t value)
Definition DynamicSymbolCommand.hpp:205
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:233
void external_reference_symbol_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:226
void idx_external_define_symbol(uint32_t value)
Definition DynamicSymbolCommand.hpp:198
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:222
void external_relocation_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:240
it_indirect_symbols indirect_symbols()
Iterator over the indirect symbols indexed by this command.
Definition DynamicSymbolCommand.hpp:255
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:208
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
void nb_indirect_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:236
DynamicSymbolCommand(const details::dysymtab_command &cmd)
void nb_local_relocations(uint32_t value)
Definition DynamicSymbolCommand.hpp:250
uint32_t external_relocation_offset() const
Byte offset from the start of the file to the external relocation table data.
Definition DynamicSymbolCommand.hpp:166
static bool classof(const LoadCommand *cmd)
Definition DynamicSymbolCommand.hpp:263
void toc_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:212
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
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:201
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:259
void nb_external_reference_symbols(uint32_t value)
Definition DynamicSymbolCommand.hpp:229
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:215
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:243
void module_table_offset(uint32_t value)
Definition DynamicSymbolCommand.hpp:219
void idx_local_symbol(uint32_t value)
Definition DynamicSymbolCommand.hpp:191
~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
Based class for the Mach-O load commands.
Definition LoadCommand.hpp:37
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:124
Class that represents a Symbol in a Mach-O file.
Definition MachO/Symbol.hpp:47
Definition endianness_support.hpp:59
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41