1 |
/* Copyright 2006-2009, BeatriX |
2 |
* File coded by BeatriX |
3 |
* |
4 |
* This file is part of BeaEngine. |
5 |
* |
6 |
* BeaEngine is free software: you can redistribute it and/or modify |
7 |
* it under the terms of the GNU Lesser General Public License as published by |
8 |
* the Free Software Foundation, either version 3 of the License, or |
9 |
* (at your option) any later version. |
10 |
* |
11 |
* BeaEngine is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
* GNU Lesser General Public License for more details. |
15 |
* |
16 |
* You should have received a copy of the GNU Lesser General Public License |
17 |
* along with BeaEngine. If not, see <http://www.gnu.org/licenses/>. */ |
18 |
|
19 |
/* ==================================================================== |
20 |
* 0x 0f 38 db |
21 |
* ==================================================================== */ |
22 |
void __bea_callspec__ aesimc(PDISASM pMyDisasm) |
23 |
{ |
24 |
/* ========== 0x66 */ |
25 |
if (GV.OperandSize == 16) { |
26 |
GV.OperandSize = GV.OriginalOperandSize; |
27 |
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; |
28 |
GV.MemDecoration = Arg2dqword; |
29 |
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION; |
30 |
#ifndef BEA_LIGHT_DISASSEMBLY |
31 |
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesimc "); |
32 |
#endif |
33 |
GV.SSE_ = 1; |
34 |
GxEx(pMyDisasm); |
35 |
GV.SSE_ = 0; |
36 |
} |
37 |
else { |
38 |
FailDecode(pMyDisasm); |
39 |
} |
40 |
} |
41 |
|
42 |
/* ==================================================================== |
43 |
* 0x 0f 38 dc |
44 |
* ==================================================================== */ |
45 |
void __bea_callspec__ aesenc(PDISASM pMyDisasm) |
46 |
{ |
47 |
/* ========== 0x66 */ |
48 |
if (GV.OperandSize == 16) { |
49 |
GV.OperandSize = GV.OriginalOperandSize; |
50 |
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; |
51 |
GV.MemDecoration = Arg2dqword; |
52 |
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION; |
53 |
#ifndef BEA_LIGHT_DISASSEMBLY |
54 |
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesenc "); |
55 |
#endif |
56 |
GV.SSE_ = 1; |
57 |
GxEx(pMyDisasm); |
58 |
GV.SSE_ = 0; |
59 |
} |
60 |
else { |
61 |
FailDecode(pMyDisasm); |
62 |
} |
63 |
} |
64 |
|
65 |
/* ==================================================================== |
66 |
* 0x 0f 38 dd |
67 |
* ==================================================================== */ |
68 |
void __bea_callspec__ aesenclast(PDISASM pMyDisasm) |
69 |
{ |
70 |
/* ========== 0x66 */ |
71 |
if (GV.OperandSize == 16) { |
72 |
GV.OperandSize = GV.OriginalOperandSize; |
73 |
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; |
74 |
GV.MemDecoration = Arg2dqword; |
75 |
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION; |
76 |
#ifndef BEA_LIGHT_DISASSEMBLY |
77 |
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesenclast "); |
78 |
#endif |
79 |
GV.SSE_ = 1; |
80 |
GxEx(pMyDisasm); |
81 |
GV.SSE_ = 0; |
82 |
} |
83 |
else { |
84 |
FailDecode(pMyDisasm); |
85 |
} |
86 |
} |
87 |
|
88 |
/* ==================================================================== |
89 |
* 0x 0f 38 de |
90 |
* ==================================================================== */ |
91 |
void __bea_callspec__ aesdec(PDISASM pMyDisasm) |
92 |
{ |
93 |
/* ========== 0x66 */ |
94 |
if (GV.OperandSize == 16) { |
95 |
GV.OperandSize = GV.OriginalOperandSize; |
96 |
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; |
97 |
GV.MemDecoration = Arg2dqword; |
98 |
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION; |
99 |
#ifndef BEA_LIGHT_DISASSEMBLY |
100 |
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesdec "); |
101 |
#endif |
102 |
GV.SSE_ = 1; |
103 |
GxEx(pMyDisasm); |
104 |
GV.SSE_ = 0; |
105 |
} |
106 |
else { |
107 |
FailDecode(pMyDisasm); |
108 |
} |
109 |
} |
110 |
|
111 |
/* ==================================================================== |
112 |
* 0x 0f 38 df |
113 |
* ==================================================================== */ |
114 |
void __bea_callspec__ aesdeclast(PDISASM pMyDisasm) |
115 |
{ |
116 |
/* ========== 0x66 */ |
117 |
if (GV.OperandSize == 16) { |
118 |
GV.OperandSize = GV.OriginalOperandSize; |
119 |
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; |
120 |
GV.MemDecoration = Arg2dqword; |
121 |
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION; |
122 |
#ifndef BEA_LIGHT_DISASSEMBLY |
123 |
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aesdeclast "); |
124 |
#endif |
125 |
GV.SSE_ = 1; |
126 |
GxEx(pMyDisasm); |
127 |
GV.SSE_ = 0; |
128 |
} |
129 |
else { |
130 |
FailDecode(pMyDisasm); |
131 |
} |
132 |
} |
133 |
|
134 |
/* ==================================================================== |
135 |
* 0x 0f 3a df |
136 |
* ==================================================================== */ |
137 |
void __bea_callspec__ aeskeygen(PDISASM pMyDisasm) |
138 |
{ |
139 |
/* ========== 0x66 */ |
140 |
if (GV.OperandSize == 16) { |
141 |
GV.OperandSize = GV.OriginalOperandSize; |
142 |
(*pMyDisasm).Prefix.OperandSize = MandatoryPrefix; |
143 |
GV.MemDecoration = Arg2dqword; |
144 |
(*pMyDisasm).Instruction.Category = AES_INSTRUCTION; |
145 |
#ifndef BEA_LIGHT_DISASSEMBLY |
146 |
(void) strcpy ((*pMyDisasm).Instruction.Mnemonic, "aeskeygenassist "); |
147 |
#endif |
148 |
GV.ImmediatSize = 8; |
149 |
GV.SSE_ = 1; |
150 |
GxEx(pMyDisasm); |
151 |
GV.SSE_ = 0; |
152 |
GV.EIP_++; |
153 |
if (!Security(0, pMyDisasm)) return; |
154 |
GV.third_arg = 1; |
155 |
(*pMyDisasm).Instruction.Immediat = *((UInt8*)(UIntPtr) (GV.EIP_- 1)); |
156 |
#ifndef BEA_LIGHT_DISASSEMBLY |
157 |
(void) CopyFormattedNumber(pMyDisasm, (char*) (*pMyDisasm).Argument3.ArgMnemonic, "%.2X",(Int64) *((UInt8*)(UIntPtr) (GV.EIP_- 1))); |
158 |
#endif |
159 |
(*pMyDisasm).Argument3.ArgType = CONSTANT_TYPE+ABSOLUTE_; |
160 |
(*pMyDisasm).Argument3.ArgSize = 8; |
161 |
|
162 |
|
163 |
} |
164 |
else { |
165 |
FailDecode(pMyDisasm); |
166 |
} |
167 |
|
168 |
} |