Bug 1447742: Understand movups in 32-bit DLL interceptor. r=handyman

This commit is contained in:
David Major 2018-03-22 14:20:36 -04:00
Родитель d421a4b0b5
Коммит 608b569690
1 изменённых файлов: 20 добавлений и 8 удалений

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

@ -777,6 +777,18 @@ protected:
return;
}
nOrigBytes += len;
} else if (origBytes[nOrigBytes] == 0x0f &&
(origBytes[nOrigBytes + 1] == 0x10 ||
origBytes[nOrigBytes + 1] == 0x11)) {
// SSE: movups xmm, xmm/m128
// movups xmm/m128, xmm
nOrigBytes += 2;
int len = CountModRmSib(origBytes + nOrigBytes);
if (len < 0) {
MOZ_ASSERT_UNREACHABLE("Unrecognized MOV opcode sequence");
return;
}
nOrigBytes += len;
} else if (origBytes[nOrigBytes] == 0xA1) {
// MOV eax, [seg:offset]
nOrigBytes += 5;
@ -1262,14 +1274,14 @@ protected:
(origBytes[nOrigBytes + 1] & 0xf8) == 0x60) {
// and [r+d], imm8
COPY_CODES(5);
} else if (origBytes[nOrigBytes] == 0xc6) {
// mov [r+d], imm8
int len = CountModRmSib(&origBytes[nOrigBytes + 1]);
if (len < 0) {
// RIP-relative not yet supported
MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");
return;
}
} else if (origBytes[nOrigBytes] == 0xc6) {
// mov [r+d], imm8
int len = CountModRmSib(&origBytes[nOrigBytes + 1]);
if (len < 0) {
// RIP-relative not yet supported
MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");
return;
}
COPY_CODES(len + 1);
} else {
MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");