Files
lief-project-LIEF/api/python/ELF/objects
Nicolas Iooss bb7faf3e72 Support setting ELF header identity from bytes
The following Python code currently fails with Python 3.9:

    import lief
    elf = lief.ELF.Binary("test", lief.ELF.ELF_CLASS.CLASS32)
    elf.header.identity = bytes.fromhex("7f454c46010101000000000000000000")

The reported error is:

    TypeError: b'\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00' is not supported!

It is possible to use `.decode()` to convert the bytes to string, or to
use `list(...)` to convert them to a list of integers. Both these
solutions work, but they are not as elegant as directly using `bytes`.

Modify the `identity` setter to support bytes. As `Header::identity_t`
is directly an array of `uint8_t`, casting it from `py::bytes` is
straightforward.
2022-01-24 23:18:20 +01:00
..
2021-01-16 18:17:17 +01:00
2022-01-22 13:23:52 +01:00
2021-01-16 18:17:17 +01:00
2021-01-16 18:17:17 +01:00
2021-05-31 05:34:18 +02:00
2021-01-16 18:17:17 +01:00
2021-01-16 18:17:17 +01:00
2021-01-16 18:17:17 +01:00
2021-01-16 18:17:17 +01:00
2021-01-16 18:17:17 +01:00
2021-01-16 18:17:17 +01:00
2021-01-16 18:17:17 +01:00
2021-01-16 18:17:17 +01:00
2021-06-22 17:50:57 +02:00
2021-06-22 17:50:57 +02:00
2021-01-16 18:17:17 +01:00
2021-01-16 18:17:17 +01:00
2021-01-16 18:17:17 +01:00
2021-01-16 18:17:17 +01:00
2022-01-22 13:23:52 +01:00