Bug 1367899: Add handling for call reg opcode; r?dmajor draft
authorCarl Corcoran <carlco@gmail.com>
Thu, 25 May 2017 19:39:43 +0200
changeset 584762 8e9788191ef8924289badaa55411c3525b8f7a44
parent 584761 4d708e5f9ae1a4cdf5565637b65004c9a82dafee
child 630511 7eb78aba0c8ae55bc5243c7942866ad7c179b8ff
push id60877
push userbmo:ccorcoran@mozilla.com
push dateThu, 25 May 2017 23:58:02 +0000
reviewersdmajor
bugs1367899
milestone55.0a1
Bug 1367899: Add handling for call reg opcode; r?dmajor MozReview-Commit-ID: 2ncXsGf2H95
xpcom/build/nsWindowsDllInterceptor.h
--- a/xpcom/build/nsWindowsDllInterceptor.h
+++ b/xpcom/build/nsWindowsDllInterceptor.h
@@ -1177,16 +1177,19 @@ protected:
           // jmp absolute indirect m32
           foundJmp = true;
           int32_t offset = *(reinterpret_cast<int32_t*>(origBytes + nOrigBytes + 2));
           int64_t* ptrToJmpDest = reinterpret_cast<int64_t*>(origBytes + nOrigBytes + 6 + offset);
           intptr_t jmpDest = static_cast<intptr_t>(*ptrToJmpDest);
           JumpPatch jump(nTrampBytes, jmpDest, JumpType::Jmp);
           nTrampBytes = jump.GenerateJump(tramp);
           nOrigBytes += 6;
+        } else if ((origBytes[nOrigBytes + 1] & (kMaskMod|kMaskReg)) == BuildModRmByte(kModReg, 2, 0)) {
+          // CALL reg (ff nn)
+          COPY_CODES(2);
         } else {
           MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");
           return;
         }
       } else {
         MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");
         return;
       }