Bug 900436 - WindowsDllNopSpacePatcher doesn't work on Windows 8. r=ehsan

This commit is contained in:
Makoto Kato 2013-08-02 10:35:25 +09:00
Родитель 0a7b766b43
Коммит f56ed41f01
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -159,14 +159,14 @@ public:
bool WriteHook(byteptr_t fn, intptr_t hookDest, void **origFunc)
{
// Check that the 5 bytes before fn are NOP's, and that the 2 bytes after
// fn are mov(edi, edi).
// Check that the 5 bytes before fn are NOP's or INT 3's,
// and that the 2 bytes after fn are mov(edi, edi).
//
// It's safe to read fn[-5] because we set it to PAGE_EXECUTE_READWRITE
// before calling WriteHook.
for (int i = -5; i <= -1; i++) {
if (fn[i] != 0x90) // nop
if (fn[i] != 0x90 && fn[i] != 0xcc) // nop or int 3
return false;
}