Skip to content

Commit

Permalink
Rbin ELF plugin r_bin_elf_resize_section was not resizing the elf (#1…
Browse files Browse the repository at this point in the history
…1715)

segment the section resides in.
I beleive this fixes it
  • Loading branch information
wdworks authored and radare committed Oct 3, 2018
1 parent 72ae29d commit 237e6c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libr/bin/format/elf/elf_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ ut64 Elf_(r_bin_elf_resize_section)(struct Elf_(r_bin_elf_obj_t) *bin, const cha
if (phdrp->p_paddr) {
phdrp->p_paddr += delta;
}
}
} else if (phdrp->p_offset + phdrp->p_filesz >= rsz_offset + rsz_osize) {
phdrp->p_filesz += delta;
phdrp->p_memsz += delta;
}
off = ehdr->e_phoff + i * sizeof (Elf_(Phdr));
if (r_buf_write_at (bin->b, off, (ut8 *)phdrp, sizeof (Elf_ (Phdr))) == -1) {
perror ("write (phdr)");
Expand Down

0 comments on commit 237e6c2

Please sign in to comment.