microsoft / Detours

Detours is a software package for monitoring and instrumenting API calls on Windows. It is distributed in source code form.
MIT License
5k stars 978 forks source link

`detour_skip_jmp` for x64 doesn't support `rex.w` prefix #293

Open ww898 opened 11 months ago

ww898 commented 11 months ago

Hi, I found that DetourCodeFromPointer doesn't work propely for OutputDebugStringA on x64 platform because detour_skip_jmp doesn't handle rex.w (0x48) prefix before jmp [+imm32] (0xFF, 0x25, 0xXX, 0xXX, 0xXX, 0xXX). Could you please fix it? https://github.com/microsoft/Detours/blob/734ac64899c44933151c1335f6ef54a590219221/src/detours.cpp#L380