'vaddr_to_offset(address) -> int
Translates the specified virtual address to a file offset
Arguments:
address(int): Virtual address to translate
Returns:
int: Offset within the ELF file which corresponds to the address,
or :const:`None`.
Examples:
>>> bash = ELF(which(\'bash\'))
>>> bash.vaddr_to_offset(bash.address)
0
>>> bash.address += 0x123456
>>> bash.vaddr_to_offset(bash.address)
0
>>> bash.vaddr_to_offset(0) is None
True'

def vaddr_to_offset(self, address):

    for interval in self.memory[address]:
        segment = interval.data
        address = ((address - self.address) + self.load_addr)
        offset = (address - segment.header.p_vaddr)
        return (segment.header.p_offset + offset)
