-
-
Couldn't load subscription status.
- Fork 678
Open
Description
Hello!
I'm currently working with ELF binaries and have a specific requirement to inject a PT_NOTE segment into binaries that originally do not have this segment. I've been going through the LIEF documentation and examples, but I haven't found a straightforward method to achieve this.
Details:
- Binary Type: ELF
- LIEF Version: 0.13.2-2d9855fc
- Platform: Ubuntu 22.04
What I've tried:
# Create and add the PT_NOTE segment
new_segment = lief.ELF.Segment()
new_segment.type = lief.ELF.SEGMENT_TYPES.NOTE
binary.add(new_segment)
# Write the modified binary to the output path
binary.write(output_path)But the resultant binary merely has a newly added LOAD segment, instead of a NOTE one.
Any guidance or pointers would be greatly appreciated.
Best