Zydis  v2.0.0-alpha2
Status.h File Reference

Status code definitions and check macros. More...

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

Go to the source code of this file.

Macros

#define ZYDIS_SUCCESS(status)   (status == ZYDIS_STATUS_SUCCESS)
 Checks if a zydis operation was successfull. More...
 
#define ZYDIS_CHECK(status)
 Checks if a zydis operation was successfull and returns the status-code, if not. More...
 

Typedefs

typedef uint32_t ZydisStatus
 Defines the ZydisStatus datatype. More...
 

Enumerations

enum  ZydisStatusCode {
  ZYDIS_STATUS_SUCCESS = 0x00000000 , ZYDIS_STATUS_INVALID_PARAMETER , ZYDIS_STATUS_INVALID_OPERATION , ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE ,
  ZYDIS_STATUS_NO_MORE_DATA , ZYDIS_STATUS_DECODING_ERROR , ZYDIS_STATUS_INSTRUCTION_TOO_LONG , ZYDIS_STATUS_BAD_REGISTER ,
  ZYDIS_STATUS_ILLEGAL_LOCK , ZYDIS_STATUS_ILLEGAL_LEGACY_PFX , ZYDIS_STATUS_ILLEGAL_REX , ZYDIS_STATUS_INVALID_MAP ,
  ZYDIS_STATUS_MALFORMED_EVEX , ZYDIS_STATUS_MALFORMED_MVEX , ZYDIS_STATUS_INVALID_MASK , ZYDIS_STATUS_IMPOSSIBLE_INSTRUCTION ,
  ZYDIS_STATUS_USER = 0x10000000
}
 Values that represent a zydis status-codes. More...
 

Detailed Description

Status code definitions and check macros.

Macro Definition Documentation

◆ ZYDIS_CHECK

#define ZYDIS_CHECK (   status)
Value:
do \
{ \
ZydisStatus s = status; \
if (!ZYDIS_SUCCESS(s)) \
{ \
return s; \
} \
} while (0)
#define ZYDIS_SUCCESS(status)
Checks if a zydis operation was successfull.
Definition: Status.h:157

Checks if a zydis operation was successfull and returns the status-code, if not.

Parameters
statusThe zydis status-code to check.

◆ ZYDIS_SUCCESS

#define ZYDIS_SUCCESS (   status)    (status == ZYDIS_STATUS_SUCCESS)

Checks if a zydis operation was successfull.

Parameters
statusThe zydis status-code to check.

Typedef Documentation

◆ ZydisStatus

typedef uint32_t ZydisStatus

Defines the ZydisStatus datatype.

Enumeration Type Documentation

◆ ZydisStatusCode

Values that represent a zydis status-codes.

Enumerator
ZYDIS_STATUS_SUCCESS 

The operation completed successfully.

ZYDIS_STATUS_INVALID_PARAMETER 

An invalid parameter was passed to a function.

ZYDIS_STATUS_INVALID_OPERATION 

An attempt was made to perform an invalid operation.

ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE 

A buffer passed to a function was too small to complete the requested operation.

ZYDIS_STATUS_NO_MORE_DATA 

An attempt was made to read data from an input data-source that has no more data available.

ZYDIS_STATUS_DECODING_ERROR 

An general error occured while decoding the current instruction.

The instruction might be undefined.

ZYDIS_STATUS_INSTRUCTION_TOO_LONG 

The instruction exceeded the maximum length of 15 bytes.

ZYDIS_STATUS_BAD_REGISTER 

The instruction encoded an invalid register.

ZYDIS_STATUS_ILLEGAL_LOCK 

A lock-prefix (F0) was found while decoding an instruction that does not support locking.

ZYDIS_STATUS_ILLEGAL_LEGACY_PFX 

A legacy-prefix (F2, F3, 66) was found while decoding a XOP/VEX/EVEX/MVEX instruction.

ZYDIS_STATUS_ILLEGAL_REX 

A rex-prefix was found while decoding a XOP/VEX/EVEX/MVEX instruction.

ZYDIS_STATUS_INVALID_MAP 

An invalid opcode-map value was found while decoding a XOP/VEX/EVEX/MVEX-prefix.


ZYDIS_STATUS_MALFORMED_EVEX 

An error occured while decoding the EVEX-prefix.


ZYDIS_STATUS_MALFORMED_MVEX 

An error occured while decoding the MVEX-prefix.


ZYDIS_STATUS_INVALID_MASK 

An invalid write-mask was specified for an EVEX/MVEX instruction.


ZYDIS_STATUS_IMPOSSIBLE_INSTRUCTION 
ZYDIS_STATUS_USER 

The base value for user-defined status codes.