Fix follow_jmp for 64-bit code - skip REX prefix if found

develop
Quietust 2016-09-25 18:29:57 -05:00
parent 869e705549
commit 27d2229665
1 changed files with 5 additions and 4 deletions

@ -96,12 +96,13 @@ static uint32_t *follow_jmp(void *ptr)
{ {
switch (*p) switch (*p)
{ {
case 0xE9: // jmp near rel32
#ifdef DFHACK64 #ifdef DFHACK64
p += 5 + *(int32_t*)(p+1) + 1; case 0x48: // REX prefix
#else p++;
p += 5 + *(int32_t*)(p+1); break;
#endif #endif
case 0xE9: // jmp near rel32
p += 5 + *(int32_t*)(p+1);
break; break;
case 0xEB: // jmp short rel8 case 0xEB: // jmp short rel8
p += 2 + *(int8_t*)(p+1); p += 2 + *(int8_t*)(p+1);