|
|
|
@ -23,7 +23,7 @@ XED_REG_ENUM VmGetRegOfSize(XED_REG_ENUM Reg, VM_OPERAND_SIZE_ENUM OperandSize)
|
|
|
|
|
{
|
|
|
|
|
return (XED_REG_ENUM)(VmOperandSizeToRegEnumBase(OperandSize) + (Reg - XED_REG_GPR16_FIRST));
|
|
|
|
|
}
|
|
|
|
|
if (Reg >= XED_REG_GPR32_FIRST && Reg <= XED_REG_GPR32_LAST)
|
|
|
|
|
else if (Reg >= XED_REG_GPR32_FIRST && Reg <= XED_REG_GPR32_LAST)
|
|
|
|
|
{
|
|
|
|
|
return (XED_REG_ENUM)(VmOperandSizeToRegEnumBase(OperandSize) + (Reg - XED_REG_GPR32_FIRST));
|
|
|
|
|
}
|
|
|
|
@ -212,30 +212,4 @@ PUCHAR VmHandlerEncode3(XED_ICLASS_ENUM IClass, VM_OPERAND_SIZE_ENUM OperandSize
|
|
|
|
|
XED_ENCODER_INSTRUCTION InstList;
|
|
|
|
|
XedInst3(&InstList, XedGlobalMachineState, IClass, VmOpSizeToBits(OperandSize1), XedReg(VmIRegToXReg(VM_IREG_1, OperandSize1)), XedReg(VmIRegToXReg(VM_IREG_2, OperandSize2)), XedReg(VmIRegToXReg(VM_IREG_3, OperandSize3)));
|
|
|
|
|
return XedEncodeInstructions(&InstList, 1, OutSize);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
//PUCHAR VmHandlerMov(VM_OPERAND_SIZE_ENUM OperandSize, PUINT OutSize)
|
|
|
|
|
//{
|
|
|
|
|
// XED_ENCODER_INSTRUCTION InstList;
|
|
|
|
|
// XedInst2(&InstList, XedGlobalMachineState, XED_ICLASS_MOV, VmOpSizeToBits(OperandSize), XedReg(VmIRegToXReg(VM_IREG_1, OperandSize)), XedReg(VmIRegToXReg(VM_IREG_2, OperandSize)));
|
|
|
|
|
// return XedEncodeInstructions(&InstList, 1, OutSize);
|
|
|
|
|
//}
|
|
|
|
|
//PUCHAR VmHandlerMovsx(VM_OPERAND_SIZE_ENUM NewOpSize, VM_OPERAND_SIZE_ENUM OriginalOpSize, PUINT OutSize)
|
|
|
|
|
//{
|
|
|
|
|
// XED_ENCODER_INSTRUCTION InstList;
|
|
|
|
|
// XedInst2(&InstList, XedGlobalMachineState, XED_ICLASS_MOVSX, VmOpSizeToBits(NewOpSize), XedReg(VmIRegToXReg(VM_IREG_1, NewOpSize)), XedReg(VmIRegToXReg(VM_IREG_2, OriginalOpSize)));
|
|
|
|
|
// return XedEncodeInstructions(&InstList, 1, OutSize);
|
|
|
|
|
//}
|
|
|
|
|
//PUCHAR VmHandlerMovsxd(VM_OPERAND_SIZE_ENUM NewOpSize, VM_OPERAND_SIZE_ENUM OriginalOpSize, PUINT OutSize)
|
|
|
|
|
//{
|
|
|
|
|
// XED_ENCODER_INSTRUCTION InstList;
|
|
|
|
|
// XedInst2(&InstList, XedGlobalMachineState, XED_ICLASS_MOVSXD, VmOpSizeToBits(NewOpSize), XedReg(VmIRegToXReg(VM_IREG_1, NewOpSize)), XedReg(VmIRegToXReg(VM_IREG_2, OriginalOpSize)));
|
|
|
|
|
// return XedEncodeInstructions(&InstList, 1, OutSize);
|
|
|
|
|
//}
|
|
|
|
|
//PUCHAR VmHandlerMovzx(VM_OPERAND_SIZE_ENUM NewOpSize, VM_OPERAND_SIZE_ENUM OriginalOpSize, PUINT OutSize)
|
|
|
|
|
//{
|
|
|
|
|
// XED_ENCODER_INSTRUCTION InstList;
|
|
|
|
|
// XedInst2(&InstList, XedGlobalMachineState, XED_ICLASS_MOVZX, VmOpSizeToBits(NewOpSize), XedReg(VmIRegToXReg(VM_IREG_1, NewOpSize)), XedReg(VmIRegToXReg(VM_IREG_2, OriginalOpSize)));
|
|
|
|
|
// return XedEncodeInstructions(&InstList, 1, OutSize);
|
|
|
|
|
//}
|
|
|
|
|
}
|