mirror of
https://github.com/lief-project/LIEF
synced 2026-06-08 15:30:44 +00:00
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:
@@ -35,16 +35,29 @@ using it_t = T (Relocation::*)(void);
|
||||
|
||||
template<>
|
||||
void create<Relocation>(py::module& m) {
|
||||
py::class_<Relocation, LIEF::Object>(m, "Relocation")
|
||||
py::class_<Relocation, LIEF::Object>(m, "Relocation",
|
||||
R"delim(
|
||||
Class which represents the *Base Relocation Block*
|
||||
Usually, we find this structure in the ``.reloc`` section
|
||||
)delim")
|
||||
.def(py::init<>())
|
||||
|
||||
.def_property("virtual_address",
|
||||
static_cast<getter_t<uint32_t>>(&Relocation::virtual_address),
|
||||
static_cast<setter_t<uint32_t>>(&Relocation::virtual_address))
|
||||
static_cast<setter_t<uint32_t>>(&Relocation::virtual_address),
|
||||
"The RVA for which the offset of the relocation entries (RelocationEntry) is added")
|
||||
|
||||
.def_property("block_size",
|
||||
static_cast<getter_t<uint32_t>>(&Relocation::block_size),
|
||||
static_cast<setter_t<uint32_t>>(&Relocation::block_size),
|
||||
R"delim(
|
||||
The total number of bytes in the base relocation block.
|
||||
``block_size = sizeof(BaseRelocationBlock) + nb_of_relocs * sizeof(uint16_t = RelocationEntry)``
|
||||
)delim")
|
||||
|
||||
.def_property_readonly("entries",
|
||||
static_cast<it_t<it_relocation_entries>>(&Relocation::entries),
|
||||
py::return_value_policy::reference_internal)
|
||||
"Iterator over the " RST_CLASS_REF(lief.PE.RelocationEntry) "")
|
||||
|
||||
.def("add_entry",
|
||||
&Relocation::add_entry,
|
||||
|
||||
Reference in New Issue
Block a user