2016-08-23 21:58:40 +08:00
|
|
|
/***************************************************************************************************
|
|
|
|
|
2016-12-05 09:24:01 +08:00
|
|
|
Zyan Disassembler Library (Zydis)
|
2016-08-23 21:58:40 +08:00
|
|
|
|
2017-07-29 04:25:20 +08:00
|
|
|
Original Author : Florian Bernd, Joel Höner
|
2016-08-23 21:58:40 +08:00
|
|
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
|
|
|
|
***************************************************************************************************/
|
|
|
|
|
2016-12-05 09:24:01 +08:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Includes and defines some default datatypes.
|
|
|
|
*/
|
|
|
|
|
2017-07-06 06:34:36 +08:00
|
|
|
#ifndef ZYDIS_COMMONTYPES_H
|
|
|
|
#define ZYDIS_COMMONTYPES_H
|
2016-08-23 21:58:40 +08:00
|
|
|
|
2017-07-29 04:25:20 +08:00
|
|
|
#include <Zydis/Defines.h>
|
|
|
|
|
2016-08-23 21:58:40 +08:00
|
|
|
/* ============================================================================================== */
|
2016-12-05 09:24:01 +08:00
|
|
|
/* Integral types */
|
2016-08-23 21:58:40 +08:00
|
|
|
/* ============================================================================================== */
|
|
|
|
|
2017-07-29 04:25:20 +08:00
|
|
|
// Fixed width integer types.
|
|
|
|
#if defined(ZYDIS_WINKERNEL)
|
|
|
|
# if !defined(ZYDIS_MSVC)
|
|
|
|
# error "Windows kernel drivers are only supported with MSVC"
|
|
|
|
# endif
|
|
|
|
typedef unsigned __int8 uint8_t;
|
|
|
|
typedef unsigned __int16 uint16_t;
|
|
|
|
typedef unsigned __int32 uint32_t;
|
|
|
|
typedef unsigned __int64 uint64_t;
|
|
|
|
typedef __int8 int8_t;
|
|
|
|
typedef __int16 int16_t;
|
|
|
|
typedef __int32 int32_t;
|
|
|
|
typedef __int64 int64_t;
|
|
|
|
# define UINT8_MAX (255)
|
|
|
|
# define UINT16_MAX (65535U)
|
|
|
|
# define UINT32_MAX (4294967295UL)
|
|
|
|
# define UINT64_MAX (18446744073709551615ULL)
|
|
|
|
# define INT8_MAX (127)
|
|
|
|
# define INT8_MIN (-128)
|
|
|
|
# define INT16_MAX (32767)
|
|
|
|
# define INT16_MIN (-32767-1)
|
|
|
|
# define INT32_MIN (-2147483647L-1)
|
|
|
|
# define INT32_MAX (2147483647L)
|
|
|
|
# define INT64_MIN (-9223372036854775807LL-1)
|
|
|
|
# define INT64_MAX (9223372036854775807LL)
|
|
|
|
# define PRIX8 "hhX"
|
|
|
|
# define PRIX16 "hX"
|
|
|
|
# define PRIX32 "X"
|
|
|
|
# define PRIX64 "llX"
|
|
|
|
#else
|
|
|
|
# include <stdint.h>
|
|
|
|
# include <inttypes.h>
|
|
|
|
#endif
|
2016-08-23 21:58:40 +08:00
|
|
|
|
2017-07-29 04:25:20 +08:00
|
|
|
// size_t, ptrdiff_t
|
2016-12-05 09:24:01 +08:00
|
|
|
#include <stddef.h>
|
2016-08-23 21:58:40 +08:00
|
|
|
|
2017-01-06 09:06:08 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-12-05 09:24:01 +08:00
|
|
|
/* ============================================================================================== */
|
|
|
|
/* Boolean */
|
|
|
|
/* ============================================================================================== */
|
2016-08-23 21:58:40 +08:00
|
|
|
|
2016-12-05 09:24:01 +08:00
|
|
|
#define ZYDIS_FALSE 0
|
|
|
|
#define ZYDIS_TRUE 1
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @briefs Defines the @c ZydisBool datatype.
|
|
|
|
*/
|
|
|
|
typedef uint8_t ZydisBool;
|
2016-08-23 21:58:40 +08:00
|
|
|
|
|
|
|
/* ============================================================================================== */
|
2016-12-05 09:24:01 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-07-06 06:34:36 +08:00
|
|
|
#endif /* ZYDIS_COMMONTYPES_H */
|