Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

dis.h File Reference


Detailed Description

DIS - The VirtualBox Disassembler.

Definition in file dis.h.

#include <VBox/cdefs.h>
#include <VBox/types.h>
#include <VBox/disopcode.h>

Go to the source code of this file.

Classes

struct  _DISCPUSTATE
struct  _OP_PARAMETER
struct  _OPCODE
struct  OP_PARAMVAL
#define PARAM_VAL16   RT_BIT(1)
#define PARAM_VAL32   RT_BIT(2)
#define PARAM_VAL64   RT_BIT(3)
#define PARAM_VAL8   RT_BIT(0)
#define PARAM_VALFARPTR16   RT_BIT(4)
#define PARAM_VALFARPTR32   RT_BIT(5)
#define PARMTYPE_ADDRESS   2
#define PARMTYPE_IMMEDIATE   3
#define PARMTYPE_REGISTER   1
enum  PARAM_TYPE { PARAM_DEST, PARAM_SOURCE }
typedef OP_PARAMVAL * POP_PARAMVAL

Defines

#define DIS_FMT_SEL_FROM_REG(uReg)   ( ((uReg) << 16) | RT_BIT(31) | 0xffff )
#define DIS_FMT_SEL_FROM_VALUE(Sel)   ( (Sel) & 0xffff )
#define DIS_FMT_SEL_GET_REG(u32Sel)   ( ((u32Sel) >> 16) & 0xf )
#define DIS_FMT_SEL_GET_VALUE(u32Sel)   ( (RTSEL)(u32Sel) )
#define DIS_FMT_SEL_IS_REG(u32Sel)   ( !!((u32Sel) & RT_BIT(31)) )
#define DISCPUSTATE_PADDING_SIZE   (HC_ARCH_BITS == 64 ? 0x1a0 : 0x180)
#define OPTYPE_ALL   (0xffffffff)
#define OPTYPE_COND_CONTROLFLOW   RT_BIT(10)
#define OPTYPE_CONTROLFLOW   RT_BIT(2)
#define OPTYPE_DANGEROUS   RT_BIT(4)
#define OPTYPE_DEFAULT_64_OP_SIZE   RT_BIT(21)
#define OPTYPE_FORCED_32_OP_SIZE_X86   RT_BIT(25)
#define OPTYPE_FORCED_64_OP_SIZE   RT_BIT(22)
#define OPTYPE_HARMLESS   RT_BIT(1)
#define OPTYPE_ILLEGAL   RT_BIT(12)
#define OPTYPE_INHIBIT_IRQS   RT_BIT(16)
#define OPTYPE_INTERRUPT   RT_BIT(11)
#define OPTYPE_INVALID   RT_BIT(0)
#define OPTYPE_INVALID_64   RT_BIT(19)
#define OPTYPE_MOD_FIXED_11   RT_BIT(24)
#define OPTYPE_ONLY_64   RT_BIT(20)
#define OPTYPE_PORTIO   RT_BIT(5)
#define OPTYPE_PORTIO_READ   RT_BIT(17)
#define OPTYPE_PORTIO_WRITE   RT_BIT(18)
#define OPTYPE_POTENTIALLY_DANGEROUS   RT_BIT(3)
#define OPTYPE_PRIVILEGED   RT_BIT(6)
#define OPTYPE_PRIVILEGED_NOTRAP   RT_BIT(7)
#define OPTYPE_RELATIVE_CONTROLFLOW   RT_BIT(9)
#define OPTYPE_REXB_EXTENDS_OPREG   RT_BIT(23)
#define OPTYPE_RRM_DANGEROUS   RT_BIT(14)
#define OPTYPE_RRM_DANGEROUS_16   RT_BIT(15)
#define OPTYPE_RRM_MASK   (OPTYPE_RRM_DANGEROUS | OPTYPE_RRM_DANGEROUS_16)
#define OPTYPE_UNCOND_CONTROLFLOW   RT_BIT(8)
#define USE_REG_CR0   0
#define USE_REG_CR1   1
#define USE_REG_CR2   2
#define USE_REG_CR3   3
#define USE_REG_CR4   4
#define USE_REG_CR8   8
#define USE_REG_DR0   0
#define USE_REG_DR1   1
#define USE_REG_DR2   2
#define USE_REG_DR3   3
#define USE_REG_DR4   4
#define USE_REG_DR5   5
#define USE_REG_DR6   6
#define USE_REG_DR7   7
#define USE_REG_FP0   0
#define USE_REG_FP1   1
#define USE_REG_FP2   2
#define USE_REG_FP3   3
#define USE_REG_FP4   4
#define USE_REG_FP5   5
#define USE_REG_FP6   6
#define USE_REG_FP7   7
#define USE_REG_MMX0   0
#define USE_REG_MMX1   1
#define USE_REG_MMX2   2
#define USE_REG_MMX3   3
#define USE_REG_MMX4   4
#define USE_REG_MMX5   5
#define USE_REG_MMX6   6
#define USE_REG_MMX7   7
#define USE_REG_XMM0   0
#define USE_REG_XMM1   1
#define USE_REG_XMM2   2
#define USE_REG_XMM3   3
#define USE_REG_XMM4   4
#define USE_REG_XMM5   5
#define USE_REG_XMM6   6
#define USE_REG_XMM7   7
Flags for use with DISFormatYasmEx(), DISFormatMasmEx() and DISFormatGasEx().
#define DIS_FMT_FLAGS_ADDR_COMMENT   RT_BIT_32(2)
#define DIS_FMT_FLAGS_ADDR_LEFT   RT_BIT_32(1)
#define DIS_FMT_FLAGS_ADDR_RIGHT   RT_BIT_32(0)
#define DIS_FMT_FLAGS_BYTES_BRACKETS   RT_BIT_32(6)
#define DIS_FMT_FLAGS_BYTES_COMMENT   RT_BIT_32(5)
#define DIS_FMT_FLAGS_BYTES_LEFT   RT_BIT_32(4)
#define DIS_FMT_FLAGS_BYTES_RIGHT   RT_BIT_32(3)
#define DIS_FMT_FLAGS_BYTES_SPACED   RT_BIT_32(7)
#define DIS_FMT_FLAGS_IS_VALID(fFlags)
#define DIS_FMT_FLAGS_RELATIVE_BRANCH   RT_BIT_32(8)
#define DIS_FMT_FLAGS_STRICT   RT_BIT_32(9)
#define DIS_IS_EFFECTIVE_ADDR(flags)   !!((flags) & (USE_BASE|USE_INDEX|USE_DISPLACEMENT32|USE_DISPLACEMENT64|USE_DISPLACEMENT16|USE_DISPLACEMENT8|USE_RIPDISPLACEMENT32))
#define USE_BASE   RT_BIT_64(0)
#define USE_DISPLACEMENT16   RT_BIT_64(15)
#define USE_DISPLACEMENT32   RT_BIT_64(16)
#define USE_DISPLACEMENT64   RT_BIT_64(17)
#define USE_DISPLACEMENT8   RT_BIT_64(14)
#define USE_IMMEDIATE   (USE_IMMEDIATE8|USE_IMMEDIATE16|USE_IMMEDIATE32|USE_IMMEDIATE64|USE_IMMEDIATE8_REL|USE_IMMEDIATE16_REL|USE_IMMEDIATE32_REL|USE_IMMEDIATE64_REL|USE_IMMEDIATE_ADDR_0_32|USE_IMMEDIATE_ADDR_16_32|USE_IMMEDIATE_ADDR_0_16|USE_IMMEDIATE_ADDR_16_16|USE_IMMEDIATE16_SX8|USE_IMMEDIATE32_SX8|USE_IMMEDIATE64_SX8)
#define USE_IMMEDIATE16   RT_BIT_64(21)
#define USE_IMMEDIATE16_REL   RT_BIT_64(22)
#define USE_IMMEDIATE16_SX8   RT_BIT_64(33)
#define USE_IMMEDIATE32   RT_BIT_64(23)
#define USE_IMMEDIATE32_REL   RT_BIT_64(24)
#define USE_IMMEDIATE32_SX8   RT_BIT_64(34)
#define USE_IMMEDIATE64   RT_BIT_64(25)
#define USE_IMMEDIATE64_REL   RT_BIT_64(26)
#define USE_IMMEDIATE64_SX8   RT_BIT_64(36)
#define USE_IMMEDIATE8   RT_BIT_64(19)
#define USE_IMMEDIATE8_REL   RT_BIT_64(20)
#define USE_IMMEDIATE_ADDR_0_16   RT_BIT_64(29)
#define USE_IMMEDIATE_ADDR_0_32   RT_BIT_64(27)
#define USE_IMMEDIATE_ADDR_16_16   RT_BIT_64(30)
#define USE_IMMEDIATE_ADDR_16_32   RT_BIT_64(28)
#define USE_INDEX   RT_BIT_64(1)
#define USE_POINTER_DS_BASED   RT_BIT_64(31)
#define USE_POINTER_ES_BASED   RT_BIT_64(32)
#define USE_REG_CR   RT_BIT_64(10)
#define USE_REG_DBG   RT_BIT_64(11)
#define USE_REG_FP   RT_BIT_64(7)
#define USE_REG_GEN16   RT_BIT_64(4)
#define USE_REG_GEN32   RT_BIT_64(5)
#define USE_REG_GEN64   RT_BIT_64(6)
#define USE_REG_GEN8   RT_BIT_64(3)
#define USE_REG_MMX   RT_BIT_64(8)
#define USE_REG_SEG   RT_BIT_64(12)
#define USE_REG_TEST   RT_BIT_64(13)
#define USE_REG_XMM   RT_BIT_64(9)
#define USE_RIPDISPLACEMENT32   RT_BIT_64(18)
#define USE_SCALE   RT_BIT_64(2)
#define PREFIX_ADDRSIZE   RT_BIT(0)
#define PREFIX_LOCK   RT_BIT(2)
#define PREFIX_NONE   0
#define PREFIX_OPSIZE   RT_BIT(1)
#define PREFIX_REP   RT_BIT(4)
#define PREFIX_REPNE   RT_BIT(5)
#define PREFIX_REX   RT_BIT(6)
#define PREFIX_SEG   RT_BIT(3)
#define PREFIX_REX_FLAGS   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX)
#define PREFIX_REX_FLAGS_B   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_B)
#define PREFIX_REX_FLAGS_R   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_R)
#define PREFIX_REX_FLAGS_RB   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_RB)
#define PREFIX_REX_FLAGS_RX   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_RX)
#define PREFIX_REX_FLAGS_RXB   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_RXB)
#define PREFIX_REX_FLAGS_W   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_W)
#define PREFIX_REX_FLAGS_WB   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_WB)
#define PREFIX_REX_FLAGS_WR   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_WR)
#define PREFIX_REX_FLAGS_WRB   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_WRB)
#define PREFIX_REX_FLAGS_WRX   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_WRX)
#define PREFIX_REX_FLAGS_WRXB   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_WRXB)
#define PREFIX_REX_FLAGS_WX   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_WX)
#define PREFIX_REX_FLAGS_WXB   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_WXB)
#define PREFIX_REX_FLAGS_X   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_X)
#define PREFIX_REX_FLAGS_XB   PREFIX_REX_OP_2_FLAGS(OP_PARM_REX_XB)
#define PREFIX_REX_OP_2_FLAGS(a)   (a - OP_PARM_REX_START)
#define USE_REG_AH   4
#define USE_REG_AL   0
#define USE_REG_BH   7
#define USE_REG_BL   3
#define USE_REG_BPL   17
#define USE_REG_CH   5
#define USE_REG_CL   1
#define USE_REG_DH   6
#define USE_REG_DIL   19
#define USE_REG_DL   2
#define USE_REG_R10B   10
#define USE_REG_R11B   11
#define USE_REG_R12B   12
#define USE_REG_R13B   13
#define USE_REG_R14B   14
#define USE_REG_R15B   15
#define USE_REG_R8B   8
#define USE_REG_R9B   9
#define USE_REG_SIL   18
#define USE_REG_SPL   16
#define USE_REG_AX   0
#define USE_REG_BP   5
#define USE_REG_BX   3
#define USE_REG_CX   1
#define USE_REG_DI   7
#define USE_REG_DX   2
#define USE_REG_R10W   10
#define USE_REG_R11W   11
#define USE_REG_R12W   12
#define USE_REG_R13W   13
#define USE_REG_R14W   14
#define USE_REG_R15W   15
#define USE_REG_R8W   8
#define USE_REG_R9W   9
#define USE_REG_SI   6
#define USE_REG_SP   4
#define USE_REG_EAX   0
#define USE_REG_EBP   5
#define USE_REG_EBX   3
#define USE_REG_ECX   1
#define USE_REG_EDI   7
#define USE_REG_EDX   2
#define USE_REG_ESI   6
#define USE_REG_ESP   4
#define USE_REG_R10D   10
#define USE_REG_R11D   11
#define USE_REG_R12D   12
#define USE_REG_R13D   13
#define USE_REG_R14D   14
#define USE_REG_R15D   15
#define USE_REG_R8D   8
#define USE_REG_R9D   9
#define USE_REG_R10   10
#define USE_REG_R11   11
#define USE_REG_R12   12
#define USE_REG_R13   13
#define USE_REG_R14   14
#define USE_REG_R15   15
#define USE_REG_R8   8
#define USE_REG_R9   9
#define USE_REG_RAX   0
#define USE_REG_RBP   5
#define USE_REG_RBX   3
#define USE_REG_RCX   1
#define USE_REG_RDI   7
#define USE_REG_RDX   2
#define USE_REG_RSI   6
#define USE_REG_RSP   4

Typedefs

typedef uint32_t RTUINTPTR
char size_t 
cchBuf
typedef struct _DISCPUSTATE DISCPUSTATE
typedef unsigned FNDISPARSE (RTUINTPTR pu8CodeBlock, PCOPCODE pOp, POP_PARAMETER pParam, PDISCPUSTATE pCpu)
typedef struct _OP_PARAMETER OP_PARAMETER
typedef struct _OPCODE OPCODE
typedef DISCPUSTATE const * PCDISCPUSTATE
typedef const OP_PARAMETERPCOP_PARAMETER
typedef struct _OPCODEPCOPCODE
typedef uint8_t * pDest
typedef struct _DISCPUSTATE * PDISCPUSTATE
typedef FN_DIS_READBYTES * PFN_DIS_READBYTES
typedef FNDISGETSYMBOL * PFNDISGETSYMBOL
typedef FNDISPARSEPFNDISPARSE
typedef uint32_t RTUINTPTR
char size_t RTINTPTR * 
poff
typedef OP_PARAMETERPOP_PARAMETER
typedef struct _OPCODEPOPCODE
typedef uint32_t RTUINTPTR char * pszBuf
typedef uint8_t unsigned void * pvUserdata
typedef uint8_t unsigned size
typedef uint32_t u32Sel
typedef uint32_t RTUINTPTR uAddress

Enumerations

enum  DIS_SELREG {
  DIS_SELREG_ES = 0, DIS_SELREG_CS = 1, DIS_SELREG_SS = 2, DIS_SELREG_DS = 3,
  DIS_SELREG_FS = 4, DIS_SELREG_GS = 5, DIS_SEGREG_32BIT_HACK = 0x7fffffff
}
enum  DISCPUMODE { CPUMODE_16BIT = 1, CPUMODE_32BIT = 2, CPUMODE_64BIT = 3, CPUMODE_MAKE_32BIT_HACK = 0x7fffffff }

Functions

typedef DECLCALLBACK (int) FN_DIS_READBYTES(RTUINTPTR pSrc
 DISDECL (size_t) DISFormatYasm(PCDISCPUSTATE pCpu
 DISDECL (uint8_t) DISQuerySegPrefixByte(PDISCPUSTATE pCpu)
 DISDECL (DIS_SELREG) DISDetectSegReg(PDISCPUSTATE pCpu
 DISDECL (int) DISBlock(PDISCPUSTATE pCpu

Variables

RTUINTPTR unsigned cbMax
DISCPUMODE enmCpuMode
char size_t uint32_t fFlags
RTUINTPTR InstructionAddr
PDISCPUSTATE POP_PARAMETER
POP_PARAMVAL PARAM_TYPE 
parmtype
RTUINTPTR unsigned * pcbInstruction
RTUINTPTR unsigned unsigned * pcbSize
DISCPUMODE PFN_DIS_READBYTES
void PDISCPUSTATE 
pCpu
char size_t uint32_t
PFNDISGETSYMBOL 
pfnGetSymbol
DISCPUMODE PFN_DIS_READBYTES pfnReadBytes
POP_PARAMETER pParam
PDISCPUSTATE POP_PARAMETER
POP_PARAMVAL 
pParamVal
PDISCPUSTATE POP_PARAMETER void ** ppReg
DIS_SELREG RTSEL PCPUMSELREGHIDppSelHidReg
RTUINTPTR unsigned unsigned * pSize
RTUINTPTR unsigned unsigned char * pszOutput
RTUINTPTR pu8Instruction
unsigned uint8_t * pVal
RTUINTPTR pvCodeBlock
DISCPUMODE PFN_DIS_READBYTES void * pvUser
unsigned reg16
unsigned reg32
unsigned reg64
unsigned reg8
DIS_SELREG sel
RTUINTPTR unsigned u32EipOffset
RTUINTPTR uint32_t uint32_t
char unsigned 
uFilter
DIS_SELREG RTSEL val
unsigned uint16_t val16
unsigned uint32_t val32
unsigned uint64_t val64
unsigned uint8_t val8


Generated by  Doxygen 1.6.0   Back to index