bool target_patch_entry_addr(Target* t)
{
  unsigned char* self_entry_code = (unsigned char*)SELF->e_entry;
  unsigned char* target_entry_code = t->target_entry_code;
  int* patch_point = (int*)(target_entry_code + 0x18);

  TRACE(stderr, "target_patch_entry_addr\n");

  CHECK_EQ(memcmp(self_entry_code, target_entry_code, 0xc), 0);

  /* check for last "push" */
  CHECK_EQ(self_entry_code[0x17], target_entry_code[0x17]);

  /* check for "call" */
  CHECK_EQ(self_entry_code[0x1c], target_entry_code[0x1c]);

  /* check for "hlt" */
  CHECK_EQ(self_entry_code[0x21], target_entry_code[0x21]);

  t->original_entry = *patch_point;
  TRACE(stderr, "old *patch_point=%08x\n", *patch_point);
  *patch_point = target_new_entry_addr(t);
  TRACE(stderr, "new *patch_point=%08x\n", *patch_point);

  return true;
}
