Zydis: include/Zydis/Register.h File Reference

Zydis v4.1.0

Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations | Functions
Register.h File Reference

Utility functions and constants for registers. More...

`#include <Zycore/Defines.h>`
`#include <Zycore/Types.h>`
`#include <Zydis/Defines.h>`
`#include <Zydis/SharedTypes.h>`
`#include <Zydis/ShortString.h>`
`#include <Zydis/Generated/EnumRegister.h>`

Go to the source code of this file.

## Data Structures
struct | ZydisRegisterContext_
| Defines the `ZydisRegisterContext` struct. More...

## Typedefs
typedef enum ZydisRegisterKind_ | ZydisRegisterKind
| Defines the `ZydisRegisterKind` enum.
typedef enum ZydisRegisterClass_ | ZydisRegisterClass
| Defines the `ZydisRegisterClass` enum.
typedef ZyanU16 | ZydisRegisterWidth
| Defines the `ZydisRegisterWidth` data-type.
typedef struct ZydisRegisterContext_ | ZydisRegisterContext
| Defines the `ZydisRegisterContext` struct.

## Enumerations
enum | ZydisRegisterKind_ { ZYDIS_REGKIND_INVALID , ZYDIS_REGKIND_GPR , ZYDIS_REGKIND_X87 , ZYDIS_REGKIND_MMX , ZYDIS_REGKIND_VR , ZYDIS_REGKIND_TMM , ZYDIS_REGKIND_SEGMENT , ZYDIS_REGKIND_TEST , ZYDIS_REGKIND_CONTROL , ZYDIS_REGKIND_DEBUG , ZYDIS_REGKIND_MASK , ZYDIS_REGKIND_BOUND , ZYDIS_REGKIND_MAX_VALUE = ZYDIS_REGKIND_BOUND , ZYDIS_REGKIND_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_REGKIND_MAX_VALUE) }
| Defines the `ZydisRegisterKind` enum. More...
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_TMM , ZYDIS_REGCLASS_FLAGS , ZYDIS_REGCLASS_IP , ZYDIS_REGCLASS_SEGMENT , ZYDIS_REGCLASS_TABLE , 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.
ZYDIS_EXPORT ZyanI8 | ZydisRegisterGetId (ZydisRegister reg)
| Returns the id of the specified register.
ZYDIS_EXPORT ZydisRegisterClass | ZydisRegisterGetClass (ZydisRegister reg)
| Returns the register-class of the specified register.
ZYDIS_EXPORT ZydisRegisterWidth | ZydisRegisterGetWidth (ZydisMachineMode mode, ZydisRegister reg)
| Returns the width of the specified register.
ZYDIS_EXPORT ZydisRegister | ZydisRegisterGetLargestEnclosing (ZydisMachineMode mode, ZydisRegister reg)
| Returns the largest enclosing register of the given register.
ZYDIS_EXPORT const char * | ZydisRegisterGetString (ZydisRegister reg)
| Returns the specified register string.
ZYDIS_EXPORT const ZydisShortString * | ZydisRegisterGetStringWrapped (ZydisRegister reg)
| Returns the specified register string as `ZydisShortString`.
ZYDIS_EXPORT ZydisRegisterWidth | ZydisRegisterClassGetWidth (ZydisMachineMode mode, ZydisRegisterClass register_class)
| Returns the width of the specified register-class.

## Detailed Description

Utility functions and constants for registers.

## Typedef Documentation

## ◆ ZydisRegisterClass

typedef enum ZydisRegisterClass_ 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

typedef struct ZydisRegisterContext_ ZydisRegisterContext

Defines the `ZydisRegisterContext` struct.

## ◆ ZydisRegisterKind

typedef enum ZydisRegisterKind_ ZydisRegisterKind

Defines the `ZydisRegisterKind` 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.

## ◆ ZydisRegisterWidth

typedef ZyanU16 ZydisRegisterWidth

Defines the `ZydisRegisterWidth` data-type.

## Enumeration Type Documentation

## ◆ ZydisRegisterClass_

enum 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_TMM | Matrix registers.
ZYDIS_REGCLASS_FLAGS |
ZYDIS_REGCLASS_IP | Instruction-pointer registers.
ZYDIS_REGCLASS_SEGMENT | Segment registers.
ZYDIS_REGCLASS_TABLE | Table 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.

## ◆ ZydisRegisterKind_

enum ZydisRegisterKind_

Defines the `ZydisRegisterKind` 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.

Enumerator
ZYDIS_REGKIND_INVALID |
ZYDIS_REGKIND_GPR |
ZYDIS_REGKIND_X87 |
ZYDIS_REGKIND_MMX |
ZYDIS_REGKIND_VR |
ZYDIS_REGKIND_TMM |
ZYDIS_REGKIND_SEGMENT |
ZYDIS_REGKIND_TEST |
ZYDIS_REGKIND_CONTROL |
ZYDIS_REGKIND_DEBUG |
ZYDIS_REGKIND_MASK |
ZYDIS_REGKIND_BOUND |
ZYDIS_REGKIND_MAX_VALUE | Maximum value of this enum.
ZYDIS_REGKIND_REQUIRED_BITS | The minimum number of bits required to represent all values of this enum.