This commit cleans and modernizes the code base of LIEF.

Among the changes:

- It removes the ``and, or, not`` keywords
- It updates the Documentation
- It moves the internal structures in the ``details::`` namespace
This commit is contained in:
rthomas
2022-01-27 18:50:12 +01:00
committed by Romain Thomas
parent 540049d0d9
commit a615adbee4
625 changed files with 15701 additions and 15535 deletions
@@ -39,7 +39,12 @@ using no_const_getter = T (DynamicSymbolCommand::*)(void);
template<>
void create<DynamicSymbolCommand>(py::module& m) {
py::class_<DynamicSymbolCommand, LoadCommand>(m, "DynamicSymbolCommand")
py::class_<DynamicSymbolCommand, LoadCommand>(m, "DynamicSymbolCommand",
R"delim(
Class that represents the LC_DYSYMTAB command.
This command completes the LC_SYMTAB (SymbolCommand) to provide
a better granularity over the symbols layout.
)delim")
.def_property("idx_local_symbol",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::idx_local_symbol),
@@ -80,105 +85,102 @@ void create<DynamicSymbolCommand>(py::module& m) {
.def_property("toc_offset",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::toc_offset),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::toc_offset),
"Byte offset from the start of the file to the table of contents data\n\n"
"Table of content is used by legacy Mach-O loader and this field should be set to 0"
)
R"delim(
Byte offset from the start of the file to the table of contents data.
Table of content is used by legacy Mach-O loader and this field should be set to 0
)delim")
.def_property("nb_toc",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::nb_toc),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::nb_toc),
"Number of entries in the table of contents\n\n"
"Should be set to 0 on recent Mach-O"
)
R"delim(
Number of entries in the table of contents
Should be set to 0 on recent Mach-O
)delim")
.def_property("module_table_offset",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::module_table_offset),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::module_table_offset),
"Byte offset from the start of the file to the module table data.\n\n"
"This field seems unused by recent Mach-O loader and should be set to 0"
)
R"delim(
Byte offset from the start of the file to the module table data.
This field seems unused by recent Mach-O loader and should be set to 0
)delim")
.def_property("nb_module_table",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::nb_module_table),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::nb_module_table),
"Number of entries in the module table..\n\n"
"This field seems unused by recent Mach-O loader and should be set to 0"
)
R"delim(
Number of entries in the module table.
This field seems unused by recent Mach-O loader and should be set to 0.
)delim")
.def_property("external_reference_symbol_offset",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::external_reference_symbol_offset),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::external_reference_symbol_offset),
"Byte offset from the start of the file to the external reference table data.\n\n"
"This field seems unused by recent Mach-O loader and should be set to 0"
)
R"delim(
Byte offset from the start of the file to the external reference table data.
This field seems unused by recent Mach-O loader and should be set to 0
)delim")
.def_property("nb_external_reference_symbols",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::nb_external_reference_symbols),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::nb_external_reference_symbols),
"Number of entries in the external reference table\n\n"
"This field seems unused by recent Mach-O loader and should be set to 0"
)
R"delim(
Number of entries in the external reference table.
This field seems unused by recent Mach-O loader and should be set to 0.
)delim")
.def_property("indirect_symbol_offset",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::indirect_symbol_offset),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::indirect_symbol_offset),
"Byte offset from the start of the file to the indirect symbol table data..\n\n"
R"delim(
Byte offset from the start of the file to the indirect symbol table data.
"Indirect symbol table is used by the loader to speed-up symbol resolution during "
"the *lazy binding* process\n\n"
Indirect symbol table is used by the loader to speed-up symbol resolution during
the *lazy binding* process
"References:\n\n"
"\t* ``dyld-519.2.1/src/ImageLoaderMachOCompressed.cpp``\n"
"\t* ``dyld-519.2.1/src/ImageLoaderMachOClassic.cpp``\n"
)
References:
* ``dyld-519.2.1/src/ImageLoaderMachOCompressed.cpp``
* ``dyld-519.2.1/src/ImageLoaderMachOClassic.cpp``
)delim")
.def_property("nb_indirect_symbols",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::nb_indirect_symbols),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::nb_indirect_symbols),
"Number of entries in the indirect symbol table."
)
"Number of entries in the indirect symbol table.")
.def_property("external_relocation_offset",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::external_relocation_offset),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::external_relocation_offset),
"Byte offset from the start of the file to the module table data.\n\n"
"This field seems unused by recent Mach-O loader and should be set to 0"
)
R"delim(
Byte offset from the start of the file to the module table data.
This field seems unused by recent Mach-O loader and should be set to 0
)delim")
.def_property("nb_external_relocations",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::nb_external_relocations),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::nb_external_relocations),
"Number of entries in the external relocation table.\n\n"
"This field seems unused by recent Mach-O loader and should be set to 0"
)
R"delim(
Number of entries in the external relocation table.
This field seems unused by recent Mach-O loader and should be set to 0
)delim")
.def_property("local_relocation_offset",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::local_relocation_offset),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::local_relocation_offset),
"Byte offset from the start of the file to the local relocation table data.\n\n"
"This field seems unused by recent Mach-O loader and should be set to 0"
)
R"delim(
Byte offset from the start of the file to the local relocation table data.
This field seems unused by recent Mach-O loader and should be set to 0
)delim")
.def_property("nb_local_relocations",
static_cast<getter_t<uint32_t>>(&DynamicSymbolCommand::nb_local_relocations),
static_cast<setter_t<uint32_t>>(&DynamicSymbolCommand::nb_local_relocations),
"Number of entries in the local relocation table.\n\n"
"This field seems unused by recent Mach-O loader and should be set to 0"
)
R"delim(
Number of entries in the local relocation table.
This field seems unused by recent Mach-O loader and should be set to 0
)delim")
.def("__eq__", &DynamicSymbolCommand::operator==)
.def("__ne__", &DynamicSymbolCommand::operator!=)