Add relocation in the Abstract layer

The abstracted attributes are:
  * Address: virtual address where the relocation occurs
  * Size: size in bits of the relocation

See: LIEF::Relocation / lief.Relocation and abstract_reader

Resolve: #53
This commit is contained in:
Romain Thomas
2017-09-05 22:00:31 +02:00
parent 58bf7a2987
commit 9503f2fc7b
42 changed files with 785 additions and 214 deletions
+1 -11
View File
@@ -29,16 +29,11 @@ using setter_t = void (Relocation::*)(T);
void init_ELF_Relocation_class(py::module& m) {
// Relocation object
py::class_<Relocation>(m, "Relocation")
py::class_<Relocation, LIEF::Relocation>(m, "Relocation")
.def(py::init<>())
.def(py::init<uint64_t, uint32_t, int64_t, bool>(),
"address"_a, "type"_a = 0, "addend"_a = 0, "is_rela"_a = false)
.def_property("address",
static_cast<getter_t<uint64_t>>(&Relocation::address),
static_cast<setter_t<uint64_t>>(&Relocation::address),
"Address (or offset) of the relocation")
.def_property("addend",
static_cast<getter_t<int64_t>>(&Relocation::addend),
static_cast<setter_t<int64_t>>(&Relocation::addend),
@@ -75,11 +70,6 @@ void init_ELF_Relocation_class(py::module& m) {
static_cast<getter_t<bool>>(&Relocation::is_rel),
"``True`` if the relocation doesn't use the :attr:`~lief.ELF.Relocation.addend` proprety")
.def_property_readonly("size",
static_cast<getter_t<uint32_t>>(&Relocation::size),
"Size in **bits** of the value patched by the relocation")
.def("__eq__", &Relocation::operator==)
.def("__ne__", &Relocation::operator!=)
.def("__hash__",