Zydis  v3.1.0
Register.h File Reference

Utility functions and constants for registers. More...

#include <Zycore/Defines.h>
#include <Zycore/Types.h>
#include <Zydis/SharedTypes.h>
#include <Zydis/ShortString.h>
#include <Zydis/Generated/EnumRegister.h>
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.

Data Structures

struct  ZydisRegisterContext_
 Defines the ZydisRegisterContext struct. More...
 

Typedefs

typedef enum ZydisRegisterClass_ ZydisRegisterClass
 Defines the ZydisRegisterClass enum. More...
 
typedef ZyanU16 ZydisRegisterWidth
 Defines the ZydisRegisterWidth data-type. More...
 
typedef struct ZydisRegisterContext_ ZydisRegisterContext
 Defines the ZydisRegisterContext struct. More...
 

Enumerations

enum  ZydisRegisterClass_ {
  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 , ZYDIS_REGCLASS_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_REGCLASS_MAX_VALUE)
}
 Defines the ZydisRegisterClass enum. More...
 

Functions

ZYDIS_EXPORT ZydisRegister ZydisRegisterEncode (ZydisRegisterClass register_class, ZyanU8 id)
 Returns the register specified by the register_class and id tuple. More...
 
ZYDIS_EXPORT ZyanI8 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 (ZydisMachineMode mode, ZydisRegister reg)
 Returns the width of the specified register. More...
 
ZYDIS_EXPORT ZydisRegister ZydisRegisterGetLargestEnclosing (ZydisMachineMode mode, ZydisRegister reg)
 Returns the largest enclosing register of the given register. More...
 
ZYDIS_EXPORT const char * ZydisRegisterGetString (ZydisRegister reg)
 Returns the specified register string. More...
 
ZYDIS_EXPORT const ZydisShortStringZydisRegisterGetStringWrapped (ZydisRegister reg)
 Returns the specified register string as ZydisShortString. More...
 
ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterClassGetWidth (ZydisMachineMode mode, ZydisRegisterClass register_class)
 Returns the width of the specified register-class. More...
 

Detailed Description

Utility functions and constants for registers.

Typedef Documentation

◆ ZydisRegisterClass

Defines the ZydisRegisterClass enum.

Please note that this enum does not contain a matching entry for all values of the ZydisRegister enum, but only for those registers where it makes sense to logically group them for decoding/encoding purposes.

These are mainly the registers that can be identified by an id within their corresponding register-class. The IP and FLAGS values are exceptions to this rule.

◆ ZydisRegisterContext

Defines the ZydisRegisterContext struct.

◆ ZydisRegisterWidth

typedef ZyanU16 ZydisRegisterWidth

Defines the ZydisRegisterWidth data-type.

Enumeration Type Documentation

◆ ZydisRegisterClass_

Defines the ZydisRegisterClass enum.

Please note that this enum does not contain a matching entry for all values of the ZydisRegister enum, but only for those registers where it makes sense to logically group them for decoding/encoding purposes.

These are mainly the registers that can be identified by an id within their corresponding register-class. The IP and FLAGS values are exceptions to this rule.

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.

ZYDIS_REGCLASS_REQUIRED_BITS 

The minimum number of bits required to represent all values of this enum.