parent
9b2a12bd12
commit
51b61d400b
@ -1,21 +1,19 @@
|
||||
.CODE
|
||||
|
||||
;Machine structure
|
||||
;REGISTER = Register file(32 8 byte registers)
|
||||
;REGISTER = Instruction Pointer
|
||||
;REGISTER = Handler Table
|
||||
;
|
||||
|
||||
RetNum PROC
|
||||
XOR EAX,EAX
|
||||
ContinueLoop:
|
||||
ADD RAX,1
|
||||
SUB RCX,1
|
||||
ADD RCX,1
|
||||
ADD RAX,2
|
||||
SUB RAX,2
|
||||
SUB RCX,1
|
||||
JNZ ContinueLoop
|
||||
ret
|
||||
RetNum ENDP
|
||||
|
||||
NextFunction PROC
|
||||
ret
|
||||
NextFunction ENDP
|
||||
|
||||
ViSx0 proc
|
||||
|
||||
ViSx0 endp
|
||||
|
||||
|
||||
ViZx0 proc
|
||||
|
||||
ViZx0 endp
|
||||
|
||||
END
|
@ -0,0 +1,50 @@
|
||||
#include "Jit2.h"
|
||||
|
||||
|
||||
PNATIVE_CODE_LINK JitEmitDwordOp();
|
||||
|
||||
BOOL JitMutateInstruction(PNATIVE_CODE_LINK Link, PUCHAR ToMutate, PJIT_MUTATE_DATA JitData)
|
||||
{
|
||||
ULONG FourByte = Link->RawDataSize / 4;
|
||||
ULONG TwoByte = (Link->RawDataSize - (FourByte * 4)) / 2;
|
||||
ULONG OneByte = (Link->RawDataSize - (FourByte * 4) - (TwoByte * 2));
|
||||
|
||||
switch (JitData->Operation)
|
||||
{
|
||||
case JIT_XOR:
|
||||
{
|
||||
|
||||
break;
|
||||
}
|
||||
case JIT_OR:
|
||||
{
|
||||
|
||||
break;
|
||||
}
|
||||
case JIT_AND:
|
||||
{
|
||||
|
||||
break;
|
||||
}
|
||||
case JIT_MOV:
|
||||
{
|
||||
for (ULONG i = 0; i < Link->RawDataSize; i++)
|
||||
ToMutate[i] = (rand() % 255);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPreOp(PNATIVE_CODE_LINK Link, PJIT_MUTATE_DATA Data, UCHAR OpType, BOOL SaveFlags, INT32 Delta)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPostOp(PNATIVE_CODE_LINK Link, PJIT_MUTATE_DATA Data, UCHAR OpType, BOOL SaveFlags, INT32 Delta)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,28 @@
|
||||
#ifndef __JIT2_H
|
||||
#define __JIT2_H
|
||||
|
||||
#include "Windas.h"
|
||||
#include "XedWrap.h"
|
||||
#include "NativeCode.h"
|
||||
|
||||
#define JIT_XOR 0
|
||||
#define JIT_OR 1
|
||||
#define JIT_AND 2
|
||||
#define JIT_MOV 3
|
||||
|
||||
typedef struct _JIT_MUTATE_DATA
|
||||
{
|
||||
ULONG Part1[3];
|
||||
USHORT Part2;
|
||||
UCHAR Part3;
|
||||
UCHAR Operation;
|
||||
}JIT_MUTATE_DATA, *PJIT_MUTATE_DATA;
|
||||
|
||||
|
||||
BOOL JitMutateInstruction(PNATIVE_CODE_LINK Link, PUCHAR ToMutate, PJIT_MUTATE_DATA JitData);
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPreOp(PNATIVE_CODE_LINK Link, PJIT_MUTATE_DATA Data, UCHAR OpType, BOOL SaveFlags = FALSE, INT32 Delta = 0);
|
||||
|
||||
PNATIVE_CODE_BLOCK JitEmitPostOp(PNATIVE_CODE_LINK Link, PJIT_MUTATE_DATA Data, UCHAR OpType, BOOL SaveFlags = FALSE, INT32 Delta = 0);
|
||||
|
||||
#endif
|
@ -0,0 +1,18 @@
|
||||
#ifndef __VMDEFS_H
|
||||
#define __VMDEFS_H
|
||||
|
||||
|
||||
enum VM_ICLASS_ENUM : UCHAR
|
||||
{
|
||||
VM_ICLASS_ENTER,
|
||||
VM_ICLASS_EXIT,
|
||||
VM_ICLASS_MOV,
|
||||
VM_ICLASS_SX,
|
||||
VM_ICLASS_ZX,
|
||||
VM_ICLASS_ADD,
|
||||
VM_ICLASS_SUB,
|
||||
VM_ICLASS_MUL,
|
||||
VM_ICLASS_DIV,
|
||||
};
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue