Zydis  v2.0.1
Register.h
Go to the documentation of this file.
1 /***************************************************************************************************
2 
3  Zyan Disassembler Library (Zydis)
4 
5  Original Author : Florian Bernd
6 
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in all
15  * copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24 
25 ***************************************************************************************************/
26 
32 #ifndef ZYDIS_REGISTER_H
33 #define ZYDIS_REGISTER_H
34 
35 #include <Zydis/Defines.h>
36 #include <Zydis/CommonTypes.h>
37 #include <Zydis/String.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /* ============================================================================================== */
44 /* Enums and types */
45 /* ============================================================================================== */
46 
47 /* ---------------------------------------------------------------------------------------------- */
48 /* Registers */
49 /* ---------------------------------------------------------------------------------------------- */
50 
52 
53 /* ---------------------------------------------------------------------------------------------- */
54 /* Register classes */
55 /* ---------------------------------------------------------------------------------------------- */
56 
61 
66 {
136 
141 };
142 
143 /* ---------------------------------------------------------------------------------------------- */
144 /* Register width */
145 /* ---------------------------------------------------------------------------------------------- */
146 
151 
152 /* ---------------------------------------------------------------------------------------------- */
153 
154 /* ============================================================================================== */
155 /* Exported functions */
156 /* ============================================================================================== */
157 
168 
177 
186 
195 
204 
212 ZYDIS_EXPORT const char* ZydisRegisterGetString(ZydisRegister reg);
213 
224 
225 /* ============================================================================================== */
226 
227 #ifdef __cplusplus
228 }
229 #endif
230 
231 #endif /* ZYDIS_REGISTER_H */
Includes and defines some default datatypes.
uint8_t ZydisU8
Definition: CommonTypes.h:45
int16_t ZydisI16
Definition: CommonTypes.h:50
uint16_t ZydisU16
Definition: CommonTypes.h:46
General helper and platform detection macros.
ZydisU8 ZydisRegister
Defines the ZydisRegister datatype.
Definition: EnumRegister.h:4
ZYDIS_EXPORT ZydisI16 ZydisRegisterGetId(ZydisRegister reg)
Returns the id of the specified register.
ZydisU8 ZydisRegisterClass
Defines the ZydisRegisterClass datatype.
Definition: Register.h:60
ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterGetWidth64(ZydisRegister reg)
Returns the width of the specified register in 64-bit mode.
ZYDIS_EXPORT const char * ZydisRegisterGetString(ZydisRegister reg)
Returns the specified register string.
ZYDIS_EXPORT ZydisRegister ZydisRegisterEncode(ZydisRegisterClass registerClass, ZydisU8 id)
Returns the register specified by the registerClass and the id.
ZYDIS_EXPORT const ZydisStaticString * ZydisRegisterGetStaticString(ZydisRegister reg)
Returns the specified register string as ZydisStaticString.
ZydisRegisterClasses
Values that represent zydis register-classes.
Definition: Register.h:66
@ ZYDIS_REGCLASS_MMX
Floating point multimedia registers.
Definition: Register.h:91
@ ZYDIS_REGCLASS_IP
Instruction-pointer registers.
Definition: Register.h:111
@ ZYDIS_REGCLASS_CONTROL
Control registers.
Definition: Register.h:123
@ ZYDIS_REGCLASS_GPR8
8-bit general-purpose registers.
Definition: Register.h:71
@ ZYDIS_REGCLASS_SEGMENT
Segment registers.
Definition: Register.h:115
@ ZYDIS_REGCLASS_TEST
Test registers.
Definition: Register.h:119
@ ZYDIS_REGCLASS_X87
Floating point legacy registers.
Definition: Register.h:87
@ ZYDIS_REGCLASS_MAX_VALUE
Maximum value of this enum.
Definition: Register.h:140
@ ZYDIS_REGCLASS_YMM
256-bit vector registers.
Definition: Register.h:99
@ ZYDIS_REGCLASS_GPR64
64-bit general-purpose registers.
Definition: Register.h:83
@ ZYDIS_REGCLASS_BOUND
Bound registers.
Definition: Register.h:135
@ ZYDIS_REGCLASS_GPR32
32-bit general-purpose registers.
Definition: Register.h:79
@ ZYDIS_REGCLASS_INVALID
Definition: Register.h:67
@ ZYDIS_REGCLASS_DEBUG
Debug registers.
Definition: Register.h:127
@ ZYDIS_REGCLASS_FLAGS
Flags registers.
Definition: Register.h:107
@ ZYDIS_REGCLASS_ZMM
512-bit vector registers.
Definition: Register.h:103
@ ZYDIS_REGCLASS_MASK
Mask registers.
Definition: Register.h:131
@ ZYDIS_REGCLASS_GPR16
16-bit general-purpose registers.
Definition: Register.h:75
@ ZYDIS_REGCLASS_XMM
128-bit vector registers.
Definition: Register.h:95
ZydisU16 ZydisRegisterWidth
Defines the ZydisRegisterWidth datatype.
Definition: Register.h:150
ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterGetWidth(ZydisRegister reg)
Returns the width of the specified register.
ZYDIS_EXPORT ZydisRegisterClass ZydisRegisterGetClass(ZydisRegister reg)
Returns the register-class of the specified register.
Defines the ZydisStaticString struct.
Definition: String.h:77