1 | /* $Id: DisasmInternal.h 41668 2012-06-12 13:15:51Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox disassembler - Internal header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2012 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ___DisasmInternal_h___
|
---|
19 | #define ___DisasmInternal_h___
|
---|
20 |
|
---|
21 | #include <VBox/types.h>
|
---|
22 | #include <VBox/dis.h>
|
---|
23 |
|
---|
24 | #define ExceptionMemRead 0x666
|
---|
25 | #define ExceptionInvalidModRM 0x667
|
---|
26 | #define ExceptionInvalidParameter 0x668
|
---|
27 |
|
---|
28 | #define IDX_ParseNop 0
|
---|
29 | #define IDX_ParseModRM 1
|
---|
30 | #define IDX_UseModRM 2
|
---|
31 | #define IDX_ParseImmByte 3
|
---|
32 | #define IDX_ParseImmBRel 4
|
---|
33 | #define IDX_ParseImmUshort 5
|
---|
34 | #define IDX_ParseImmV 6
|
---|
35 | #define IDX_ParseImmVRel 7
|
---|
36 | #define IDX_ParseImmAddr 8
|
---|
37 | #define IDX_ParseFixedReg 9
|
---|
38 | #define IDX_ParseImmUlong 10
|
---|
39 | #define IDX_ParseImmQword 11
|
---|
40 | #define IDX_ParseTwoByteEsc 12
|
---|
41 | #define IDX_ParseImmGrpl 13
|
---|
42 | #define IDX_ParseShiftGrp2 14
|
---|
43 | #define IDX_ParseGrp3 15
|
---|
44 | #define IDX_ParseGrp4 16
|
---|
45 | #define IDX_ParseGrp5 17
|
---|
46 | #define IDX_Parse3DNow 18
|
---|
47 | #define IDX_ParseGrp6 19
|
---|
48 | #define IDX_ParseGrp7 20
|
---|
49 | #define IDX_ParseGrp8 21
|
---|
50 | #define IDX_ParseGrp9 22
|
---|
51 | #define IDX_ParseGrp10 23
|
---|
52 | #define IDX_ParseGrp12 24
|
---|
53 | #define IDX_ParseGrp13 25
|
---|
54 | #define IDX_ParseGrp14 26
|
---|
55 | #define IDX_ParseGrp15 27
|
---|
56 | #define IDX_ParseGrp16 28
|
---|
57 | #define IDX_ParseModFence 29
|
---|
58 | #define IDX_ParseYv 30
|
---|
59 | #define IDX_ParseYb 31
|
---|
60 | #define IDX_ParseXv 32
|
---|
61 | #define IDX_ParseXb 33
|
---|
62 | #define IDX_ParseEscFP 34
|
---|
63 | #define IDX_ParseNopPause 35
|
---|
64 | #define IDX_ParseImmByteSX 36
|
---|
65 | #define IDX_ParseImmZ 37
|
---|
66 | #define IDX_ParseThreeByteEsc4 38
|
---|
67 | #define IDX_ParseThreeByteEsc5 39
|
---|
68 | #define IDX_ParseImmAddrF 40
|
---|
69 | #define IDX_ParseMax (IDX_ParseImmAddrF+1)
|
---|
70 |
|
---|
71 |
|
---|
72 | extern PFNDISPARSE g_apfnFullDisasm[IDX_ParseMax];
|
---|
73 | extern PFNDISPARSE g_apfnCalcSize[IDX_ParseMax];
|
---|
74 |
|
---|
75 | unsigned ParseInstruction(RTUINTPTR pu8CodeBlock, PCOPCODE pOp, PDISCPUSTATE pCpu);
|
---|
76 | void disValidateLockSequence(PDISCPUSTATE pCpu);
|
---|
77 |
|
---|
78 | /* Read functions */
|
---|
79 | DECLCALLBACK(int) disReadBytesDefault(PDISCPUSTATE pCpu, uint8_t *pbDst, RTUINTPTR uSrcAddr, uint32_t cbToRead);
|
---|
80 | uint8_t DISReadByte(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
|
---|
81 | uint16_t DISReadWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
|
---|
82 | uint32_t DISReadDWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
|
---|
83 | uint64_t DISReadQWord(PDISCPUSTATE pCpu, RTUINTPTR pAddress);
|
---|
84 |
|
---|
85 | size_t disFormatBytes(PCDISCPUSTATE pCpu, char *pszDst, size_t cchDst, uint32_t fFlags);
|
---|
86 |
|
---|
87 | #endif
|
---|
88 |
|
---|