Skip to content

Commit 76d1f10

Browse files
committed
A solution to REX-prefixed EIP-based jump instructions on x64 as suggested by Andrey Kubyshev (2013-09-24)
1 parent dfd6dc2 commit 76d1f10

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mhook-lib/mhook.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ static PBYTE SkipJumps(PBYTE pbCode) {
197197
INT32 lOffset = *(INT32 *)&pbCode[2];
198198
// ... that shows us an absolute pointer
199199
return SkipJumps(*(PBYTE*)(pbCode + 6 + lOffset));
200+
} else if (pbCode[0] == 0x48 && pbCode[1] == 0xff && pbCode[2] == 0x25) {
201+
// or we can have the same with a REX prefix
202+
INT32 lOffset = *(INT32 *)&pbCode[3];
203+
// ... that shows us an absolute pointer
204+
return SkipJumps(*(PBYTE*)(pbCode + 7 + lOffset));
200205
#endif
201206
} else if (pbCode[0] == 0xe9) {
202207
// here the behavior is identical, we have...

0 commit comments

Comments
 (0)