Skip to content

Commit

Permalink
Bug 1392485: Add REX.R mov to the disassembler. r=handyman
Browse files Browse the repository at this point in the history
To mitigate risk for beta uplift, the logic here is limited to what we need for QueryDosDeviceW on Win7x64. A better long-term fix would be to combine this with the more general mov logic in the REX.W section.

MozReview-Commit-ID: BykQSYY61Ua
  • Loading branch information
David Major committed Aug 29, 2017
1 parent 33090b1 commit 301ac12
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion xpcom/build/nsWindowsDllInterceptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,25 @@ class WindowsDllDetourPatcher
MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");
return;
}
} else if (origBytes[nOrigBytes] == 0x45) {
} else if (origBytes[nOrigBytes] == 0x44) {
// REX.R
COPY_CODES(1);

// TODO: Combine with the "0x89" case below in the REX.W section
if (origBytes[nOrigBytes] == 0x89) {
// mov r/m32, r32
COPY_CODES(1);
int len = CountModRmSib(origBytes + nOrigBytes);
if (len < 0) {
MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");
return;
}
COPY_CODES(len);
} else {
MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");
return;
}
} else if (origBytes[nOrigBytes] == 0x45) {
// REX.R & REX.B
COPY_CODES(1);

Expand Down

0 comments on commit 301ac12

Please sign in to comment.