Bug 951827 - Part 2: Decode more instructions so that we can use longer jumps. r=ehsan

This commit is contained in:
David Major 2014-02-14 14:55:26 -08:00
parent e559c6fba4
commit 3c56751296

View File

@ -413,10 +413,22 @@ protected:
} else if (origBytes[nBytes] == 0x6A) {
// PUSH imm8
nBytes += 2;
} else if (origBytes[nBytes] == 0xa1) {
// MOV EAX, dword ptr [m32]
nBytes += 5;
} else if (origBytes[nBytes] == 0xe9) {
pJmp32 = nBytes;
// jmp 32bit offset
nBytes += 5;
} else if (origBytes[nBytes] == 0xf6 &&
origBytes[nBytes+1] == 0x05) {
// TEST byte ptr [m32], imm8
nBytes += 7;
} else if (origBytes[nBytes] == 0xff &&
origBytes[nBytes+1] == 0x25) {
// JMP dword ptr [m32]
// This is an indirect absolute jump; don't set pJmp32
nBytes += 6;
} else {
//printf ("Unknown x86 instruction byte 0x%02x, aborting trampoline\n", origBytes[nBytes]);
return;