Zydis  v2.0.1
Register.h File Reference

Utility functions and constants for registers. More...

Include dependency graph for Register.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef ZydisU8 ZydisRegisterClass
 Defines the ZydisRegisterClass datatype. More...
 
typedef ZydisU16 ZydisRegisterWidth
 Defines the ZydisRegisterWidth datatype. More...
 

Enumerations

enum  ZydisRegisterClasses {
  ZYDIS_REGCLASS_INVALID , ZYDIS_REGCLASS_GPR8 , ZYDIS_REGCLASS_GPR16 , ZYDIS_REGCLASS_GPR32 ,
  ZYDIS_REGCLASS_GPR64 , ZYDIS_REGCLASS_X87 , ZYDIS_REGCLASS_MMX , ZYDIS_REGCLASS_XMM ,
  ZYDIS_REGCLASS_YMM , ZYDIS_REGCLASS_ZMM , ZYDIS_REGCLASS_FLAGS , ZYDIS_REGCLASS_IP ,
  ZYDIS_REGCLASS_SEGMENT , ZYDIS_REGCLASS_TEST , ZYDIS_REGCLASS_CONTROL , ZYDIS_REGCLASS_DEBUG ,
  ZYDIS_REGCLASS_MASK , ZYDIS_REGCLASS_BOUND , ZYDIS_REGCLASS_MAX_VALUE = ZYDIS_REGCLASS_BOUND
}
 Values that represent zydis register-classes. More...
 

Functions

ZYDIS_EXPORT ZydisRegister ZydisRegisterEncode (ZydisRegisterClass registerClass, ZydisU8 id)
 Returns the register specified by the registerClass and the id. More...
 
ZYDIS_EXPORT ZydisI16 ZydisRegisterGetId (ZydisRegister reg)
 Returns the id of the specified register. More...
 
ZYDIS_EXPORT ZydisRegisterClass ZydisRegisterGetClass (ZydisRegister reg)
 Returns the register-class of the specified register. More...
 
ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterGetWidth (ZydisRegister reg)
 Returns the width of the specified register. More...
 
ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterGetWidth64 (ZydisRegister reg)
 Returns the width of the specified register in 64-bit mode. More...
 
ZYDIS_EXPORT const char * ZydisRegisterGetString (ZydisRegister reg)
 Returns the specified register string. More...
 
ZYDIS_EXPORT const ZydisStaticStringZydisRegisterGetStaticString (ZydisRegister reg)
 Returns the specified register string as ZydisStaticString. More...
 

Detailed Description

Utility functions and constants for registers.

Typedef Documentation

◆ ZydisRegisterClass

Defines the ZydisRegisterClass datatype.

◆ ZydisRegisterWidth

Defines the ZydisRegisterWidth datatype.

Enumeration Type Documentation

◆ ZydisRegisterClasses

Values that represent zydis register-classes.

Enumerator
ZYDIS_REGCLASS_INVALID 
ZYDIS_REGCLASS_GPR8 

8-bit general-purpose registers.

ZYDIS_REGCLASS_GPR16 

16-bit general-purpose registers.

ZYDIS_REGCLASS_GPR32 

32-bit general-purpose registers.

ZYDIS_REGCLASS_GPR64 

64-bit general-purpose registers.

ZYDIS_REGCLASS_X87 

Floating point legacy registers.

ZYDIS_REGCLASS_MMX 

Floating point multimedia registers.

ZYDIS_REGCLASS_XMM 

128-bit vector registers.

ZYDIS_REGCLASS_YMM 

256-bit vector registers.

ZYDIS_REGCLASS_ZMM 

512-bit vector registers.

ZYDIS_REGCLASS_FLAGS 

Flags registers.

ZYDIS_REGCLASS_IP 

Instruction-pointer registers.

ZYDIS_REGCLASS_SEGMENT 

Segment registers.

ZYDIS_REGCLASS_TEST 

Test registers.

ZYDIS_REGCLASS_CONTROL 

Control registers.

ZYDIS_REGCLASS_DEBUG 

Debug registers.

ZYDIS_REGCLASS_MASK 

Mask registers.

ZYDIS_REGCLASS_BOUND 

Bound registers.

ZYDIS_REGCLASS_MAX_VALUE 

Maximum value of this enum.

Function Documentation

◆ ZydisRegisterEncode()

ZYDIS_EXPORT ZydisRegister ZydisRegisterEncode ( ZydisRegisterClass  registerClass,
ZydisU8  id 
)

Returns the register specified by the registerClass and the id.

Parameters
registerClassThe register class.
idThe register id.
Returns
The register specified by the registerClass and the id or ZYDIS_REGISTER_NONE, if an invalid parameter was passed.

◆ ZydisRegisterGetClass()

ZYDIS_EXPORT ZydisRegisterClass ZydisRegisterGetClass ( ZydisRegister  reg)

Returns the register-class of the specified register.

Parameters
regThe register.
Returns
The register-class of the specified register.

◆ ZydisRegisterGetId()

ZYDIS_EXPORT ZydisI16 ZydisRegisterGetId ( ZydisRegister  reg)

Returns the id of the specified register.

Parameters
regThe register.
Returns
The id of the specified register, or -1 if an invalid parameter was passed.

◆ ZydisRegisterGetStaticString()

ZYDIS_EXPORT const ZydisStaticString* ZydisRegisterGetStaticString ( ZydisRegister  reg)

Returns the specified register string as ZydisStaticString.

Parameters
regThe register.
Returns
The register string or NULL, if an invalid register was passed.

The buffer of the returned struct is guaranteed to be zero-terminated in this special case.

◆ ZydisRegisterGetString()

ZYDIS_EXPORT const char* ZydisRegisterGetString ( ZydisRegister  reg)

Returns the specified register string.

Parameters
regThe register.
Returns
The register string or NULL, if an invalid register was passed.

◆ ZydisRegisterGetWidth()

ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterGetWidth ( ZydisRegister  reg)

Returns the width of the specified register.

Parameters
regThe register.
Returns
The width of the specified register.

◆ ZydisRegisterGetWidth64()

ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterGetWidth64 ( ZydisRegister  reg)

Returns the width of the specified register in 64-bit mode.

Parameters
regThe register.
Returns
The width of the specified register.