|
|
|
#include "RipXorInst.h"
|
|
|
|
|
|
|
|
BOOL JitEmitRipRelativeXorD(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
|
|
|
{
|
|
|
|
UCHAR RawData[] = { 0x81, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
|
|
|
|
|
|
|
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
|
|
|
*(PINT32)&Link->RawData[2] = RipDelta;
|
|
|
|
*(PULONG)&Link->RawData[6] = Value;
|
|
|
|
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
|
|
|
NcAppendToBlock(Block, Link);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL JitEmitRipRelativeXorW(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
|
|
|
{
|
|
|
|
UCHAR RawData[] = { 0x66, 0x81, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
|
|
|
|
|
|
|
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
|
|
|
*(PINT32)&Link->RawData[3] = RipDelta;
|
|
|
|
*(PUSHORT)&Link->RawData[7] = (USHORT)Value;
|
|
|
|
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
|
|
|
NcAppendToBlock(Block, Link);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL JitEmitRipRelativeXorB(PNATIVE_CODE_BLOCK Block, INT32 RipDelta, ULONG Value)
|
|
|
|
{
|
|
|
|
UCHAR RawData[] = { 0x80, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
|
|
|
|
|
|
|
PNATIVE_CODE_LINK Link = new NATIVE_CODE_LINK(CODE_FLAG_IS_INST | CODE_FLAG_DO_NOT_DIVIDE, RawData, sizeof(RawData));
|
|
|
|
*(PINT32)&Link->RawData[2] = RipDelta;
|
|
|
|
*(PUCHAR)&Link->RawData[6] = (UCHAR)Value;
|
|
|
|
XedDecode(&Link->XedInstruction, Link->RawData, Link->RawDataSize);
|
|
|
|
NcAppendToBlock(Block, Link);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|