mirror of
https://github.com/lief-project/LIEF
synced 2026-06-08 15:30:44 +00:00
Resolve #1233
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user