Skip to content

Commit

Permalink
Resolve #455
Browse files Browse the repository at this point in the history
  • Loading branch information
rthomas committed Aug 27, 2020
1 parent 4881c6f commit 5f26216
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/python/ELF/objects/pyBinary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions include/LIEF/ELF/Binary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5f26216

Please sign in to comment.