This commit is contained in:
Romain Thomas
2025-07-12 11:39:49 +02:00
parent 7fce27408a
commit 0762ca3cf4
14 changed files with 144 additions and 6 deletions
+15
View File
@@ -564,6 +564,21 @@ void create<Binary>(nb::module_& m) {
"we must fill its content with ``0`` before removing"_doc,
"section"_a, "clear"_a = false)
.def("remove",
nb::overload_cast<const Segment&, bool>(&Binary::remove),
R"doc(
Remove the segment provided in parameter. If ``clear`` is set, the
original content of the segment will be filled with zeros before removal.
)doc"_doc, "segment"_a, "clear"_a = false)
.def("remove",
nb::overload_cast<Segment::TYPE, bool>(&Binary::remove),
R"doc(
Remove **all** segments with the given type. If ``clear`` is set, the
original content of the segment will be filled with zeros before removal.
)doc"_doc, "type"_a, "clear"_a = false)
.def("remove",
nb::overload_cast<const Note&>(&Binary::remove),
"Remove the given " RST_CLASS_REF(lief.ELF.Note) ""_doc,
+7
View File
@@ -202,6 +202,13 @@ void create<Segment>(nb::module_& m) {
"in :attr:`~lief.ELF.Segment.sections`"_doc,
"section_name"_a)
.def("clear", &Segment::clear, "Clear the content of this segment"_doc)
.def("fill", &Segment::fill,
"value"_a,
"Fill the content of this segment with the value provided in parameter"_doc
)
.def_prop_ro("sections",
nb::overload_cast<>(&Segment::sections),
"Iterator over the " RST_CLASS_REF(lief.ELF.Section) " wrapped by this segment"_doc,