This commit is contained in:
rthomas 2020-08-27 09:59:59 +02:00
parent 4881c6f5c4
commit 5f26216f90
2 changed files with 5 additions and 1 deletions

View File

@ -324,7 +324,8 @@ void create<Binary>(py::module& m) {
.def("replace",
static_cast<Segment& (Binary::*)(const Segment&, const Segment&, uint64_t)>(&Binary::replace),
"Replace the segment given in 2nd parameter with the segment given in the first one and return the updated segment",
"Replace the segment given in 2nd parameter with the segment given in the first one and return the updated segment."
".. warning:: The ``original_segment`` is no longer valid after this function\n\n",
"new_segment"_a, "original_segment"_a, "base"_a = 0,
py::return_value_policy::reference)

View File

@ -349,6 +349,9 @@ class LIEF_API Binary : public LIEF::Binary {
//! @return The segment added. `Virtual address` and `File Offset` may have changed
Segment& add(const Segment& segment, uint64_t base = 0);
//! Replace the segment given in 2nd parameter with the segment given in the first one and return the updated segment.
//!
//! @warning .The ``original_segment`` is no longer valid after this function
Segment& replace(const Segment& new_segment, const Segment& original_segment, uint64_t base = 0);
Segment& extend(const Segment& segment, uint64_t size);