Gallopsled/pwntools — pull request #99 by zachriggle (2014-09-10 07:14:34+00:00)
Title: Fix calculations based on header.p_vaddr

`elf.segments` and is a wrapper for `itertools.ELFFile.iter_segments`, which generates the `segment` object on the fly each call (same with `sections`). Because of this, any *change* to the `segment` or `section` object is effectively lost outside of the local scope/iteration.

We need to account for this, and fix up any calculations based on `header.p_vaddr` since we may have changed the base address via setting `elf.address`.