You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1021 B
56 lines
1021 B
#ifndef __VM_CODE_H
|
|
#define __VM_CODE_H
|
|
|
|
#include "Windas.h"
|
|
#include "Code.h"
|
|
#include "VMDefs.h"
|
|
|
|
|
|
#define CODE_FLAG_IREG_OPERATION DefineSpecificFlag(0)
|
|
#define CODE_FLAG_NATIVE_OPERATION DefineSpecificFlag(1)
|
|
|
|
typedef struct _VM_CODE_LINK
|
|
{
|
|
_VM_CODE_LINK* Next;
|
|
_VM_CODE_LINK* Prev;
|
|
|
|
UINT Flags;
|
|
UINT Label;
|
|
|
|
USHORT HandlerId;
|
|
union
|
|
{
|
|
struct
|
|
{
|
|
VM_REG_ENUM Base;
|
|
VM_REG_ENUM Index;
|
|
UINT8 Scale;
|
|
INT32 Displacement;
|
|
}Mem;
|
|
struct
|
|
{
|
|
VM_REG_ENUM Register;
|
|
}Reg;
|
|
struct
|
|
{
|
|
VM_IMM Immediate;
|
|
VM_OPERAND_SIZE_ENUM ImmSize;
|
|
}Imm;
|
|
};
|
|
|
|
_VM_CODE_LINK();
|
|
_VM_CODE_LINK(UINT LabelId);
|
|
}VM_CODE_LINK, *PVM_CODE_LINK;
|
|
|
|
typedef struct _VM_CODE_BLOCK
|
|
{
|
|
PVM_CODE_LINK Start;
|
|
PVM_CODE_LINK End;
|
|
_VM_CODE_BLOCK(PVM_CODE_LINK S = NULL, PVM_CODE_LINK E = NULL);
|
|
}VM_CODE_BLOCK, *PVM_CODE_BLOCK;
|
|
|
|
VOID VcAppendToBlock(PVM_CODE_BLOCK Block, PVM_CODE_LINK Link);
|
|
VOID VcPrint(PVM_CODE_LINK Link);
|
|
BOOL VcEmitCodeLink(PVM_CODE_LINK Link, PUCHAR Buffer, USHORT OpCode);
|
|
|
|
#endif |