Skip to content

Commit

Permalink
Fix follow_jmp for 64-bit code - skip REX prefix if found
Browse files Browse the repository at this point in the history
  • Loading branch information
quietust committed Sep 25, 2016
1 parent 869e705 commit 27d2229
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions library/VTableInterpose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ static uint32_t *follow_jmp(void *ptr)
{
switch (*p)
{
case 0xE9: // jmp near rel32
#ifdef DFHACK64
p += 5 + *(int32_t*)(p+1) + 1;
#else
p += 5 + *(int32_t*)(p+1);
case 0x48: // REX prefix
p++;
break;
#endif
case 0xE9: // jmp near rel32
p += 5 + *(int32_t*)(p+1);
break;
case 0xEB: // jmp short rel8
p += 2 + *(int8_t*)(p+1);
Expand Down

0 comments on commit 27d2229

Please sign in to comment.