|
|
|
#ifndef __JIT_H
|
|
|
|
#define __JIT_H
|
|
|
|
|
|
|
|
#include "Windas.h"
|
|
|
|
#include "XedWrap.h"
|
|
|
|
#include "NativeCode.h"
|
|
|
|
|
|
|
|
#define DWORD_RIP_INST_LENGTH 10
|
|
|
|
#define WORD_RIP_INST_LENGTH 9
|
|
|
|
#define BYTE_RIP_INST_LENGTH 7
|
|
|
|
|
|
|
|
#define DWORD_MOV_INST_LENGTH 10
|
|
|
|
#define WORD_MOV_INST_LENGTH 9
|
|
|
|
#define BYTE_MOV_INST_LENGTH 7
|
|
|
|
|
|
|
|
#define JIT_BITWISE_XOR 0
|
|
|
|
#define JIT_BITWISE_AND 1
|
|
|
|
#define JIT_BITWISE_OR 2
|
|
|
|
|
|
|
|
typedef struct _JIT_BITWISE_DATA
|
|
|
|
{
|
|
|
|
ULONG Data[5];
|
|
|
|
}JIT_BITWISE_DATA, *PJIT_BITWISE_DATA;
|
|
|
|
|
|
|
|
BOOL JitEmitPushfqInst(PNATIVE_CODE_BLOCK Block);
|
|
|
|
|
|
|
|
BOOL JitEmitPopfqInst(PNATIVE_CODE_BLOCK Block);
|
|
|
|
|
|
|
|
BOOL JitCheckFlagCollisions(CONST XED_FLAG_SET* FlagsRead, XED_FLAG_SET Ledger);
|
|
|
|
|
|
|
|
VOID JitUpdateConFlagsLedger(CONST XED_FLAG_SET* FlagsWritten, XED_FLAG_SET* Ledger);
|
|
|
|
|
|
|
|
BOOL JitDoesInstOverriteConditionFlags(PNATIVE_CODE_LINK Link);
|
|
|
|
|
|
|
|
BOOL JitAreFlagsClobberedBeforeUse(PNATIVE_CODE_LINK Link);
|
|
|
|
|
|
|
|
VOID JitMutateInstForXor(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData);
|
|
|
|
|
|
|
|
VOID JitMutateInstForOr(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData);
|
|
|
|
|
|
|
|
VOID JitMutateInstForAnd(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData);
|
|
|
|
|
|
|
|
PNATIVE_CODE_BLOCK JitEmitPreRipMov(PNATIVE_CODE_LINK Link, INT32 Delta = 0);
|
|
|
|
|
|
|
|
PNATIVE_CODE_BLOCK JitEmitPostRipMov(PNATIVE_CODE_LINK Link, INT32 Delta = 0);
|
|
|
|
|
|
|
|
PNATIVE_CODE_BLOCK JitEmitPreRipBitwiseOp(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData, ULONG OpType, BOOL SaveFlags = TRUE, INT32 Delta = 0);
|
|
|
|
|
|
|
|
PNATIVE_CODE_BLOCK JitEmitPostRipBitwiseOp(PNATIVE_CODE_LINK Link, PJIT_BITWISE_DATA JitData, ULONG OpType, BOOL SaveFlags = TRUE, INT32 Delta = 0);
|
|
|
|
|
|
|
|
#endif
|