Add clang-format and format code to qemu code style
This commit is contained in:
@ -12,7 +12,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
#pragma warning(disable : 4201)
|
||||
#endif
|
||||
|
||||
//> ARM registers
|
||||
@ -158,7 +158,7 @@ typedef enum uc_arm_reg {
|
||||
UC_ARM_REG_XPSR_NZCVQ,
|
||||
UC_ARM_REG_XPSR_G,
|
||||
UC_ARM_REG_XPSR_NZCVQG,
|
||||
UC_ARM_REG_ENDING, // <-- mark the end of the list or registers
|
||||
UC_ARM_REG_ENDING, // <-- mark the end of the list or registers
|
||||
|
||||
//> alias registers
|
||||
UC_ARM_REG_R13 = UC_ARM_REG_SP,
|
||||
|
@ -12,7 +12,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
#pragma warning(disable : 4201)
|
||||
#endif
|
||||
|
||||
//> ARM64 registers
|
||||
@ -281,7 +281,7 @@ typedef enum uc_arm64_reg {
|
||||
UC_ARM64_REG_V31,
|
||||
|
||||
//> pseudo registers
|
||||
UC_ARM64_REG_PC, // program counter register
|
||||
UC_ARM64_REG_PC, // program counter register
|
||||
|
||||
UC_ARM64_REG_CPACR_EL1,
|
||||
|
||||
@ -327,7 +327,7 @@ typedef enum uc_arm64_reg {
|
||||
UC_ARM64_REG_VBAR_EL2,
|
||||
UC_ARM64_REG_VBAR_EL3,
|
||||
|
||||
UC_ARM64_REG_ENDING, // <-- mark the end of the list of registers
|
||||
UC_ARM64_REG_ENDING, // <-- mark the end of the list of registers
|
||||
|
||||
//> alias registers
|
||||
|
||||
|
@ -12,7 +12,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
#pragma warning(disable : 4201)
|
||||
#endif
|
||||
|
||||
//> M68K registers
|
||||
@ -40,7 +40,7 @@ typedef enum uc_m68k_reg {
|
||||
UC_M68K_REG_SR,
|
||||
UC_M68K_REG_PC,
|
||||
|
||||
UC_M68K_REG_ENDING, // <-- mark the end of the list of registers
|
||||
UC_M68K_REG_ENDING, // <-- mark the end of the list of registers
|
||||
} uc_m68k_reg;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -16,7 +16,7 @@ extern "C" {
|
||||
#undef mips
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
#pragma warning(disable : 4201)
|
||||
#endif
|
||||
|
||||
//> MIPS registers
|
||||
@ -179,7 +179,7 @@ typedef enum UC_MIPS_REG {
|
||||
UC_MIPS_REG_CP0_USERLOCAL,
|
||||
UC_MIPS_REG_CP0_STATUS,
|
||||
|
||||
UC_MIPS_REG_ENDING, // <-- mark the end of the list or registers
|
||||
UC_MIPS_REG_ENDING, // <-- mark the end of the list or registers
|
||||
|
||||
// alias registers
|
||||
UC_MIPS_REG_ZERO = UC_MIPS_REG_0,
|
||||
@ -212,7 +212,8 @@ typedef enum UC_MIPS_REG {
|
||||
UC_MIPS_REG_K1 = UC_MIPS_REG_27,
|
||||
UC_MIPS_REG_GP = UC_MIPS_REG_28,
|
||||
UC_MIPS_REG_SP = UC_MIPS_REG_29,
|
||||
UC_MIPS_REG_FP = UC_MIPS_REG_30, UC_MIPS_REG_S8 = UC_MIPS_REG_30,
|
||||
UC_MIPS_REG_FP = UC_MIPS_REG_30,
|
||||
UC_MIPS_REG_S8 = UC_MIPS_REG_30,
|
||||
UC_MIPS_REG_RA = UC_MIPS_REG_31,
|
||||
|
||||
UC_MIPS_REG_HI0 = UC_MIPS_REG_AC0,
|
||||
|
@ -22,16 +22,17 @@ MSVC++ 7.0 _MSC_VER == 1300
|
||||
MSVC++ 6.0 _MSC_VER == 1200
|
||||
MSVC++ 5.0 _MSC_VER == 1100
|
||||
*/
|
||||
#define MSC_VER_VS2003 1310
|
||||
#define MSC_VER_VS2005 1400
|
||||
#define MSC_VER_VS2008 1500
|
||||
#define MSC_VER_VS2010 1600
|
||||
#define MSC_VER_VS2012 1700
|
||||
#define MSC_VER_VS2013 1800
|
||||
#define MSC_VER_VS2015 1900
|
||||
#define MSC_VER_VS2003 1310
|
||||
#define MSC_VER_VS2005 1400
|
||||
#define MSC_VER_VS2008 1500
|
||||
#define MSC_VER_VS2010 1600
|
||||
#define MSC_VER_VS2012 1700
|
||||
#define MSC_VER_VS2013 1800
|
||||
#define MSC_VER_VS2015 1900
|
||||
|
||||
// handle stdbool.h compatibility
|
||||
#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) && (defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64))
|
||||
#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) && \
|
||||
(defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64))
|
||||
// MSVC
|
||||
|
||||
// stdbool.h
|
||||
@ -41,62 +42,65 @@ MSVC++ 5.0 _MSC_VER == 1100
|
||||
typedef unsigned char bool;
|
||||
#define false 0
|
||||
#define true 1
|
||||
#endif // __cplusplus
|
||||
#endif // __cplusplus
|
||||
|
||||
#else
|
||||
// VisualStudio 2013+ -> C99 is supported
|
||||
#include <stdbool.h>
|
||||
#endif // (_MSC_VER < MSC_VER_VS2013) || defined(_KERNEL_MODE)
|
||||
#endif // (_MSC_VER < MSC_VER_VS2013) || defined(_KERNEL_MODE)
|
||||
|
||||
#else
|
||||
// not MSVC -> C99 is supported
|
||||
#include <stdbool.h>
|
||||
#endif // !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__) && (defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64))
|
||||
#endif // !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__MINGW64__)
|
||||
// && (defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined
|
||||
// (_WIN64))
|
||||
|
||||
#if (defined(_MSC_VER) && (_MSC_VER < MSC_VER_VS2010)) || defined(_KERNEL_MODE)
|
||||
// this system does not have stdint.h
|
||||
typedef signed char int8_t;
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
#ifndef _INTPTR_T_DEFINED
|
||||
#define _INTPTR_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
typedef long long intptr_t;
|
||||
#else /* _WIN64 */
|
||||
typedef _W64 int intptr_t;
|
||||
#endif /* _WIN64 */
|
||||
#define _INTPTR_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
typedef long long intptr_t;
|
||||
#else /* _WIN64 */
|
||||
typedef _W64 int intptr_t;
|
||||
#endif /* _WIN64 */
|
||||
#endif /* _INTPTR_T_DEFINED */
|
||||
|
||||
#ifndef _UINTPTR_T_DEFINED
|
||||
#define _UINTPTR_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
#define _UINTPTR_T_DEFINED
|
||||
#ifdef _WIN64
|
||||
typedef unsigned long long uintptr_t;
|
||||
#else /* _WIN64 */
|
||||
typedef _W64 unsigned int uintptr_t;
|
||||
#endif /* _WIN64 */
|
||||
#else /* _WIN64 */
|
||||
typedef _W64 unsigned int uintptr_t;
|
||||
#endif /* _WIN64 */
|
||||
#endif /* _UINTPTR_T_DEFINED */
|
||||
|
||||
#define INT8_MIN (-127i8 - 1)
|
||||
#define INT16_MIN (-32767i16 - 1)
|
||||
#define INT32_MIN (-2147483647i32 - 1)
|
||||
#define INT64_MIN (-9223372036854775807i64 - 1)
|
||||
#define INT8_MAX 127i8
|
||||
#define INT16_MAX 32767i16
|
||||
#define INT32_MAX 2147483647i32
|
||||
#define INT64_MAX 9223372036854775807i64
|
||||
#define UINT8_MAX 0xffui8
|
||||
#define UINT16_MAX 0xffffui16
|
||||
#define UINT32_MAX 0xffffffffui32
|
||||
#define UINT64_MAX 0xffffffffffffffffui64
|
||||
#define INT8_MIN (-127i8 - 1)
|
||||
#define INT16_MIN (-32767i16 - 1)
|
||||
#define INT32_MIN (-2147483647i32 - 1)
|
||||
#define INT64_MIN (-9223372036854775807i64 - 1)
|
||||
#define INT8_MAX 127i8
|
||||
#define INT16_MAX 32767i16
|
||||
#define INT32_MAX 2147483647i32
|
||||
#define INT64_MAX 9223372036854775807i64
|
||||
#define UINT8_MAX 0xffui8
|
||||
#define UINT16_MAX 0xffffui16
|
||||
#define UINT32_MAX 0xffffffffui32
|
||||
#define UINT64_MAX 0xffffffffffffffffui64
|
||||
#else // this system has stdint.h
|
||||
#include <stdint.h>
|
||||
#endif // (defined(_MSC_VER) && (_MSC_VER < MSC_VER_VS2010)) || defined(_KERNEL_MODE)
|
||||
#endif // (defined(_MSC_VER) && (_MSC_VER < MSC_VER_VS2010)) ||
|
||||
// defined(_KERNEL_MODE)
|
||||
|
||||
// handle inttypes.h compatibility
|
||||
#if (defined(_MSC_VER) && (_MSC_VER < MSC_VER_VS2013)) || defined(_KERNEL_MODE)
|
||||
@ -105,52 +109,53 @@ typedef _W64 unsigned int uintptr_t;
|
||||
#define __PRI_8_LENGTH_MODIFIER__ "hh"
|
||||
#define __PRI_64_LENGTH_MODIFIER__ "ll"
|
||||
|
||||
#define PRId8 __PRI_8_LENGTH_MODIFIER__ "d"
|
||||
#define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i"
|
||||
#define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o"
|
||||
#define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u"
|
||||
#define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x"
|
||||
#define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X"
|
||||
#define PRId8 __PRI_8_LENGTH_MODIFIER__ "d"
|
||||
#define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i"
|
||||
#define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o"
|
||||
#define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u"
|
||||
#define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x"
|
||||
#define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X"
|
||||
|
||||
#define PRId16 "hd"
|
||||
#define PRIi16 "hi"
|
||||
#define PRIo16 "ho"
|
||||
#define PRIu16 "hu"
|
||||
#define PRIx16 "hx"
|
||||
#define PRIX16 "hX"
|
||||
#define PRId16 "hd"
|
||||
#define PRIi16 "hi"
|
||||
#define PRIo16 "ho"
|
||||
#define PRIu16 "hu"
|
||||
#define PRIx16 "hx"
|
||||
#define PRIX16 "hX"
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER <= MSC_VER_VS2012)
|
||||
#define PRId32 "ld"
|
||||
#define PRIi32 "li"
|
||||
#define PRIo32 "lo"
|
||||
#define PRIu32 "lu"
|
||||
#define PRIx32 "lx"
|
||||
#define PRIX32 "lX"
|
||||
#else // OSX
|
||||
#define PRId32 "d"
|
||||
#define PRIi32 "i"
|
||||
#define PRIo32 "o"
|
||||
#define PRIu32 "u"
|
||||
#define PRIx32 "x"
|
||||
#define PRIX32 "X"
|
||||
#endif // defined(_MSC_VER) && (_MSC_VER <= MSC_VER_VS2012)
|
||||
#define PRId32 "ld"
|
||||
#define PRIi32 "li"
|
||||
#define PRIo32 "lo"
|
||||
#define PRIu32 "lu"
|
||||
#define PRIx32 "lx"
|
||||
#define PRIX32 "lX"
|
||||
#else // OSX
|
||||
#define PRId32 "d"
|
||||
#define PRIi32 "i"
|
||||
#define PRIo32 "o"
|
||||
#define PRIu32 "u"
|
||||
#define PRIx32 "x"
|
||||
#define PRIX32 "X"
|
||||
#endif // defined(_MSC_VER) && (_MSC_VER <= MSC_VER_VS2012)
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER <= MSC_VER_VS2012)
|
||||
// redefine functions from inttypes.h used in cstool
|
||||
#define strtoull _strtoui64
|
||||
#endif
|
||||
|
||||
#define PRId64 __PRI_64_LENGTH_MODIFIER__ "d"
|
||||
#define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i"
|
||||
#define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o"
|
||||
#define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u"
|
||||
#define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x"
|
||||
#define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X"
|
||||
#define PRId64 __PRI_64_LENGTH_MODIFIER__ "d"
|
||||
#define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i"
|
||||
#define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o"
|
||||
#define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u"
|
||||
#define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x"
|
||||
#define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X"
|
||||
|
||||
#else
|
||||
// this system has inttypes.h by default
|
||||
#include <inttypes.h>
|
||||
#endif // #if defined(_MSC_VER) && (_MSC_VER < MSC_VER_VS2013) || defined(_KERNEL_MODE)
|
||||
#endif // #if defined(_MSC_VER) && (_MSC_VER < MSC_VER_VS2013) ||
|
||||
// defined(_KERNEL_MODE)
|
||||
|
||||
// sys/time.h compatibility
|
||||
#if defined(_MSC_VER)
|
||||
@ -174,7 +179,7 @@ static int usleep(uint32_t usec)
|
||||
if (!timer)
|
||||
return -1;
|
||||
|
||||
due.QuadPart = (-((int64_t) usec)) * 10LL;
|
||||
due.QuadPart = (-((int64_t)usec)) * 10LL;
|
||||
if (!SetWaitableTimer(timer, &due, 0, NULL, NULL, 0)) {
|
||||
CloseHandle(timer);
|
||||
return -1;
|
||||
@ -191,23 +196,22 @@ static int usleep(uint32_t usec)
|
||||
|
||||
// misc support
|
||||
#if defined(_MSC_VER)
|
||||
#ifdef _WIN64
|
||||
typedef signed __int64 ssize_t;
|
||||
#ifdef _WIN64
|
||||
typedef signed __int64 ssize_t;
|
||||
#else
|
||||
typedef _W64 signed int ssize_t;
|
||||
typedef _W64 signed int ssize_t;
|
||||
#endif
|
||||
|
||||
#ifndef va_copy
|
||||
#define va_copy(d,s) ((d) = (s))
|
||||
#define va_copy(d, s) ((d) = (s))
|
||||
#endif
|
||||
#define strcasecmp _stricmp
|
||||
#define strcasecmp _stricmp
|
||||
#if (_MSC_VER < MSC_VER_VS2015)
|
||||
#define snprintf _snprintf
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#if (_MSC_VER <= MSC_VER_VS2013)
|
||||
#define strtoll _strtoi64
|
||||
#define strtoll _strtoi64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif // UNICORN_PLATFORM_H
|
||||
|
@ -12,7 +12,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
#pragma warning(disable : 4201)
|
||||
#endif
|
||||
|
||||
//> PPC registers
|
||||
|
@ -12,7 +12,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
#pragma warning(disable : 4201)
|
||||
#endif
|
||||
|
||||
//> RISCV registers
|
||||
@ -53,111 +53,111 @@ typedef enum uc_riscv_reg {
|
||||
UC_RISCV_REG_X31,
|
||||
|
||||
//> Floating-point registers
|
||||
UC_RISCV_REG_F0, // "ft0"
|
||||
UC_RISCV_REG_F1, // "ft1"
|
||||
UC_RISCV_REG_F2, // "ft2"
|
||||
UC_RISCV_REG_F3, // "ft3"
|
||||
UC_RISCV_REG_F4, // "ft4"
|
||||
UC_RISCV_REG_F5, // "ft5"
|
||||
UC_RISCV_REG_F6, // "ft6"
|
||||
UC_RISCV_REG_F7, // "ft7"
|
||||
UC_RISCV_REG_F8, // "fs0"
|
||||
UC_RISCV_REG_F9, // "fs1"
|
||||
UC_RISCV_REG_F10, // "fa0"
|
||||
UC_RISCV_REG_F11, // "fa1"
|
||||
UC_RISCV_REG_F12, // "fa2"
|
||||
UC_RISCV_REG_F13, // "fa3"
|
||||
UC_RISCV_REG_F14, // "fa4"
|
||||
UC_RISCV_REG_F15, // "fa5"
|
||||
UC_RISCV_REG_F16, // "fa6"
|
||||
UC_RISCV_REG_F17, // "fa7"
|
||||
UC_RISCV_REG_F18, // "fs2"
|
||||
UC_RISCV_REG_F19, // "fs3"
|
||||
UC_RISCV_REG_F20, // "fs4"
|
||||
UC_RISCV_REG_F21, // "fs5"
|
||||
UC_RISCV_REG_F22, // "fs6"
|
||||
UC_RISCV_REG_F23, // "fs7"
|
||||
UC_RISCV_REG_F24, // "fs8"
|
||||
UC_RISCV_REG_F25, // "fs9"
|
||||
UC_RISCV_REG_F26, // "fs10"
|
||||
UC_RISCV_REG_F27, // "fs11"
|
||||
UC_RISCV_REG_F28, // "ft8"
|
||||
UC_RISCV_REG_F29, // "ft9"
|
||||
UC_RISCV_REG_F30, // "ft10"
|
||||
UC_RISCV_REG_F31, // "ft11"
|
||||
UC_RISCV_REG_F0, // "ft0"
|
||||
UC_RISCV_REG_F1, // "ft1"
|
||||
UC_RISCV_REG_F2, // "ft2"
|
||||
UC_RISCV_REG_F3, // "ft3"
|
||||
UC_RISCV_REG_F4, // "ft4"
|
||||
UC_RISCV_REG_F5, // "ft5"
|
||||
UC_RISCV_REG_F6, // "ft6"
|
||||
UC_RISCV_REG_F7, // "ft7"
|
||||
UC_RISCV_REG_F8, // "fs0"
|
||||
UC_RISCV_REG_F9, // "fs1"
|
||||
UC_RISCV_REG_F10, // "fa0"
|
||||
UC_RISCV_REG_F11, // "fa1"
|
||||
UC_RISCV_REG_F12, // "fa2"
|
||||
UC_RISCV_REG_F13, // "fa3"
|
||||
UC_RISCV_REG_F14, // "fa4"
|
||||
UC_RISCV_REG_F15, // "fa5"
|
||||
UC_RISCV_REG_F16, // "fa6"
|
||||
UC_RISCV_REG_F17, // "fa7"
|
||||
UC_RISCV_REG_F18, // "fs2"
|
||||
UC_RISCV_REG_F19, // "fs3"
|
||||
UC_RISCV_REG_F20, // "fs4"
|
||||
UC_RISCV_REG_F21, // "fs5"
|
||||
UC_RISCV_REG_F22, // "fs6"
|
||||
UC_RISCV_REG_F23, // "fs7"
|
||||
UC_RISCV_REG_F24, // "fs8"
|
||||
UC_RISCV_REG_F25, // "fs9"
|
||||
UC_RISCV_REG_F26, // "fs10"
|
||||
UC_RISCV_REG_F27, // "fs11"
|
||||
UC_RISCV_REG_F28, // "ft8"
|
||||
UC_RISCV_REG_F29, // "ft9"
|
||||
UC_RISCV_REG_F30, // "ft10"
|
||||
UC_RISCV_REG_F31, // "ft11"
|
||||
|
||||
UC_RISCV_REG_PC, // PC register
|
||||
UC_RISCV_REG_PC, // PC register
|
||||
|
||||
UC_RISCV_REG_ENDING, // <-- mark the end of the list or registers
|
||||
UC_RISCV_REG_ENDING, // <-- mark the end of the list or registers
|
||||
|
||||
//> Alias registers
|
||||
UC_RISCV_REG_ZERO = UC_RISCV_REG_X0, // "zero"
|
||||
UC_RISCV_REG_RA = UC_RISCV_REG_X1, // "ra"
|
||||
UC_RISCV_REG_SP = UC_RISCV_REG_X2, // "sp"
|
||||
UC_RISCV_REG_GP = UC_RISCV_REG_X3, // "gp"
|
||||
UC_RISCV_REG_TP = UC_RISCV_REG_X4, // "tp"
|
||||
UC_RISCV_REG_T0 = UC_RISCV_REG_X5, // "t0"
|
||||
UC_RISCV_REG_T1 = UC_RISCV_REG_X6, // "t1"
|
||||
UC_RISCV_REG_T2 = UC_RISCV_REG_X7, // "t2"
|
||||
UC_RISCV_REG_S0 = UC_RISCV_REG_X8, // "s0"
|
||||
UC_RISCV_REG_FP = UC_RISCV_REG_X8, // "fp"
|
||||
UC_RISCV_REG_S1 = UC_RISCV_REG_X9, // "s1"
|
||||
UC_RISCV_REG_A0 = UC_RISCV_REG_X10, // "a0"
|
||||
UC_RISCV_REG_A1 = UC_RISCV_REG_X11, // "a1"
|
||||
UC_RISCV_REG_A2 = UC_RISCV_REG_X12, // "a2"
|
||||
UC_RISCV_REG_A3 = UC_RISCV_REG_X13, // "a3"
|
||||
UC_RISCV_REG_A4 = UC_RISCV_REG_X14, // "a4"
|
||||
UC_RISCV_REG_A5 = UC_RISCV_REG_X15, // "a5"
|
||||
UC_RISCV_REG_A6 = UC_RISCV_REG_X16, // "a6"
|
||||
UC_RISCV_REG_A7 = UC_RISCV_REG_X17, // "a7"
|
||||
UC_RISCV_REG_S2 = UC_RISCV_REG_X18, // "s2"
|
||||
UC_RISCV_REG_S3 = UC_RISCV_REG_X19, // "s3"
|
||||
UC_RISCV_REG_S4 = UC_RISCV_REG_X20, // "s4"
|
||||
UC_RISCV_REG_S5 = UC_RISCV_REG_X21, // "s5"
|
||||
UC_RISCV_REG_S6 = UC_RISCV_REG_X22, // "s6"
|
||||
UC_RISCV_REG_S7 = UC_RISCV_REG_X23, // "s7"
|
||||
UC_RISCV_REG_S8 = UC_RISCV_REG_X24, // "s8"
|
||||
UC_RISCV_REG_S9 = UC_RISCV_REG_X25, // "s9"
|
||||
UC_RISCV_REG_S10 = UC_RISCV_REG_X26, // "s10"
|
||||
UC_RISCV_REG_S11 = UC_RISCV_REG_X27, // "s11"
|
||||
UC_RISCV_REG_T3 = UC_RISCV_REG_X28, // "t3"
|
||||
UC_RISCV_REG_T4 = UC_RISCV_REG_X29, // "t4"
|
||||
UC_RISCV_REG_T5 = UC_RISCV_REG_X30, // "t5"
|
||||
UC_RISCV_REG_T6 = UC_RISCV_REG_X31, // "t6"
|
||||
UC_RISCV_REG_ZERO = UC_RISCV_REG_X0, // "zero"
|
||||
UC_RISCV_REG_RA = UC_RISCV_REG_X1, // "ra"
|
||||
UC_RISCV_REG_SP = UC_RISCV_REG_X2, // "sp"
|
||||
UC_RISCV_REG_GP = UC_RISCV_REG_X3, // "gp"
|
||||
UC_RISCV_REG_TP = UC_RISCV_REG_X4, // "tp"
|
||||
UC_RISCV_REG_T0 = UC_RISCV_REG_X5, // "t0"
|
||||
UC_RISCV_REG_T1 = UC_RISCV_REG_X6, // "t1"
|
||||
UC_RISCV_REG_T2 = UC_RISCV_REG_X7, // "t2"
|
||||
UC_RISCV_REG_S0 = UC_RISCV_REG_X8, // "s0"
|
||||
UC_RISCV_REG_FP = UC_RISCV_REG_X8, // "fp"
|
||||
UC_RISCV_REG_S1 = UC_RISCV_REG_X9, // "s1"
|
||||
UC_RISCV_REG_A0 = UC_RISCV_REG_X10, // "a0"
|
||||
UC_RISCV_REG_A1 = UC_RISCV_REG_X11, // "a1"
|
||||
UC_RISCV_REG_A2 = UC_RISCV_REG_X12, // "a2"
|
||||
UC_RISCV_REG_A3 = UC_RISCV_REG_X13, // "a3"
|
||||
UC_RISCV_REG_A4 = UC_RISCV_REG_X14, // "a4"
|
||||
UC_RISCV_REG_A5 = UC_RISCV_REG_X15, // "a5"
|
||||
UC_RISCV_REG_A6 = UC_RISCV_REG_X16, // "a6"
|
||||
UC_RISCV_REG_A7 = UC_RISCV_REG_X17, // "a7"
|
||||
UC_RISCV_REG_S2 = UC_RISCV_REG_X18, // "s2"
|
||||
UC_RISCV_REG_S3 = UC_RISCV_REG_X19, // "s3"
|
||||
UC_RISCV_REG_S4 = UC_RISCV_REG_X20, // "s4"
|
||||
UC_RISCV_REG_S5 = UC_RISCV_REG_X21, // "s5"
|
||||
UC_RISCV_REG_S6 = UC_RISCV_REG_X22, // "s6"
|
||||
UC_RISCV_REG_S7 = UC_RISCV_REG_X23, // "s7"
|
||||
UC_RISCV_REG_S8 = UC_RISCV_REG_X24, // "s8"
|
||||
UC_RISCV_REG_S9 = UC_RISCV_REG_X25, // "s9"
|
||||
UC_RISCV_REG_S10 = UC_RISCV_REG_X26, // "s10"
|
||||
UC_RISCV_REG_S11 = UC_RISCV_REG_X27, // "s11"
|
||||
UC_RISCV_REG_T3 = UC_RISCV_REG_X28, // "t3"
|
||||
UC_RISCV_REG_T4 = UC_RISCV_REG_X29, // "t4"
|
||||
UC_RISCV_REG_T5 = UC_RISCV_REG_X30, // "t5"
|
||||
UC_RISCV_REG_T6 = UC_RISCV_REG_X31, // "t6"
|
||||
|
||||
UC_RISCV_REG_FT0 = UC_RISCV_REG_F0, // "ft0"
|
||||
UC_RISCV_REG_FT1 = UC_RISCV_REG_F1, // "ft1"
|
||||
UC_RISCV_REG_FT2 = UC_RISCV_REG_F2, // "ft2"
|
||||
UC_RISCV_REG_FT3 = UC_RISCV_REG_F3, // "ft3"
|
||||
UC_RISCV_REG_FT4 = UC_RISCV_REG_F4, // "ft4"
|
||||
UC_RISCV_REG_FT5 = UC_RISCV_REG_F5, // "ft5"
|
||||
UC_RISCV_REG_FT6 = UC_RISCV_REG_F6, // "ft6"
|
||||
UC_RISCV_REG_FT7 = UC_RISCV_REG_F7, // "ft7"
|
||||
UC_RISCV_REG_FS0 = UC_RISCV_REG_F8, // "fs0"
|
||||
UC_RISCV_REG_FS1 = UC_RISCV_REG_F9, // "fs1"
|
||||
UC_RISCV_REG_FT0 = UC_RISCV_REG_F0, // "ft0"
|
||||
UC_RISCV_REG_FT1 = UC_RISCV_REG_F1, // "ft1"
|
||||
UC_RISCV_REG_FT2 = UC_RISCV_REG_F2, // "ft2"
|
||||
UC_RISCV_REG_FT3 = UC_RISCV_REG_F3, // "ft3"
|
||||
UC_RISCV_REG_FT4 = UC_RISCV_REG_F4, // "ft4"
|
||||
UC_RISCV_REG_FT5 = UC_RISCV_REG_F5, // "ft5"
|
||||
UC_RISCV_REG_FT6 = UC_RISCV_REG_F6, // "ft6"
|
||||
UC_RISCV_REG_FT7 = UC_RISCV_REG_F7, // "ft7"
|
||||
UC_RISCV_REG_FS0 = UC_RISCV_REG_F8, // "fs0"
|
||||
UC_RISCV_REG_FS1 = UC_RISCV_REG_F9, // "fs1"
|
||||
|
||||
UC_RISCV_REG_FA0 = UC_RISCV_REG_F10, // "fa0"
|
||||
UC_RISCV_REG_FA1 = UC_RISCV_REG_F11, // "fa1"
|
||||
UC_RISCV_REG_FA2 = UC_RISCV_REG_F12, // "fa2"
|
||||
UC_RISCV_REG_FA3 = UC_RISCV_REG_F13, // "fa3"
|
||||
UC_RISCV_REG_FA4 = UC_RISCV_REG_F14, // "fa4"
|
||||
UC_RISCV_REG_FA5 = UC_RISCV_REG_F15, // "fa5"
|
||||
UC_RISCV_REG_FA6 = UC_RISCV_REG_F16, // "fa6"
|
||||
UC_RISCV_REG_FA7 = UC_RISCV_REG_F17, // "fa7"
|
||||
UC_RISCV_REG_FS2 = UC_RISCV_REG_F18, // "fs2"
|
||||
UC_RISCV_REG_FS3 = UC_RISCV_REG_F19, // "fs3"
|
||||
UC_RISCV_REG_FS4 = UC_RISCV_REG_F20, // "fs4"
|
||||
UC_RISCV_REG_FS5 = UC_RISCV_REG_F21, // "fs5"
|
||||
UC_RISCV_REG_FS6 = UC_RISCV_REG_F22, // "fs6"
|
||||
UC_RISCV_REG_FS7 = UC_RISCV_REG_F23, // "fs7"
|
||||
UC_RISCV_REG_FS8 = UC_RISCV_REG_F24, // "fs8"
|
||||
UC_RISCV_REG_FS9 = UC_RISCV_REG_F25, // "fs9"
|
||||
UC_RISCV_REG_FS10 = UC_RISCV_REG_F26, // "fs10"
|
||||
UC_RISCV_REG_FS11 = UC_RISCV_REG_F27, // "fs11"
|
||||
UC_RISCV_REG_FT8 = UC_RISCV_REG_F28, // "ft8"
|
||||
UC_RISCV_REG_FT9 = UC_RISCV_REG_F29, // "ft9"
|
||||
UC_RISCV_REG_FT10 = UC_RISCV_REG_F30, // "ft10"
|
||||
UC_RISCV_REG_FT11 = UC_RISCV_REG_F31, // "ft11"
|
||||
UC_RISCV_REG_FA0 = UC_RISCV_REG_F10, // "fa0"
|
||||
UC_RISCV_REG_FA1 = UC_RISCV_REG_F11, // "fa1"
|
||||
UC_RISCV_REG_FA2 = UC_RISCV_REG_F12, // "fa2"
|
||||
UC_RISCV_REG_FA3 = UC_RISCV_REG_F13, // "fa3"
|
||||
UC_RISCV_REG_FA4 = UC_RISCV_REG_F14, // "fa4"
|
||||
UC_RISCV_REG_FA5 = UC_RISCV_REG_F15, // "fa5"
|
||||
UC_RISCV_REG_FA6 = UC_RISCV_REG_F16, // "fa6"
|
||||
UC_RISCV_REG_FA7 = UC_RISCV_REG_F17, // "fa7"
|
||||
UC_RISCV_REG_FS2 = UC_RISCV_REG_F18, // "fs2"
|
||||
UC_RISCV_REG_FS3 = UC_RISCV_REG_F19, // "fs3"
|
||||
UC_RISCV_REG_FS4 = UC_RISCV_REG_F20, // "fs4"
|
||||
UC_RISCV_REG_FS5 = UC_RISCV_REG_F21, // "fs5"
|
||||
UC_RISCV_REG_FS6 = UC_RISCV_REG_F22, // "fs6"
|
||||
UC_RISCV_REG_FS7 = UC_RISCV_REG_F23, // "fs7"
|
||||
UC_RISCV_REG_FS8 = UC_RISCV_REG_F24, // "fs8"
|
||||
UC_RISCV_REG_FS9 = UC_RISCV_REG_F25, // "fs9"
|
||||
UC_RISCV_REG_FS10 = UC_RISCV_REG_F26, // "fs10"
|
||||
UC_RISCV_REG_FS11 = UC_RISCV_REG_F27, // "fs11"
|
||||
UC_RISCV_REG_FT8 = UC_RISCV_REG_F28, // "ft8"
|
||||
UC_RISCV_REG_FT9 = UC_RISCV_REG_F29, // "ft9"
|
||||
UC_RISCV_REG_FT10 = UC_RISCV_REG_F30, // "ft10"
|
||||
UC_RISCV_REG_FT11 = UC_RISCV_REG_F31, // "ft11"
|
||||
} uc_riscv_reg;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -16,7 +16,7 @@ extern "C" {
|
||||
#undef sparc
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
#pragma warning(disable : 4201)
|
||||
#endif
|
||||
|
||||
//> SPARC registers
|
||||
@ -71,7 +71,7 @@ typedef enum uc_sparc_reg {
|
||||
UC_SPARC_REG_F58,
|
||||
UC_SPARC_REG_F60,
|
||||
UC_SPARC_REG_F62,
|
||||
UC_SPARC_REG_FCC0, // Floating condition codes
|
||||
UC_SPARC_REG_FCC0, // Floating condition codes
|
||||
UC_SPARC_REG_FCC1,
|
||||
UC_SPARC_REG_FCC2,
|
||||
UC_SPARC_REG_FCC3,
|
||||
@ -91,7 +91,7 @@ typedef enum uc_sparc_reg {
|
||||
UC_SPARC_REG_I5,
|
||||
UC_SPARC_REG_FP,
|
||||
UC_SPARC_REG_I7,
|
||||
UC_SPARC_REG_ICC, // Integer condition codes
|
||||
UC_SPARC_REG_ICC, // Integer condition codes
|
||||
UC_SPARC_REG_L0,
|
||||
UC_SPARC_REG_L1,
|
||||
UC_SPARC_REG_L2,
|
||||
@ -114,9 +114,9 @@ typedef enum uc_sparc_reg {
|
||||
UC_SPARC_REG_XCC,
|
||||
|
||||
// pseudo register
|
||||
UC_SPARC_REG_PC, // program counter register
|
||||
UC_SPARC_REG_PC, // program counter register
|
||||
|
||||
UC_SPARC_REG_ENDING, // <-- mark the end of the list of registers
|
||||
UC_SPARC_REG_ENDING, // <-- mark the end of the list of registers
|
||||
|
||||
// extras
|
||||
UC_SPARC_REG_O6 = UC_SPARC_REG_SP,
|
||||
|
@ -42,11 +42,11 @@ typedef size_t uc_hook;
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
#pragma warning(disable:4100)
|
||||
#pragma warning(disable : 4201)
|
||||
#pragma warning(disable : 4100)
|
||||
#ifdef UNICORN_SHARED
|
||||
#define UNICORN_EXPORT __declspec(dllexport)
|
||||
#else // defined(UNICORN_STATIC)
|
||||
#else // defined(UNICORN_STATIC)
|
||||
#define UNICORN_EXPORT
|
||||
#endif
|
||||
#else
|
||||
@ -62,7 +62,8 @@ typedef size_t uc_hook;
|
||||
#elif defined(_MSC_VER)
|
||||
#define UNICORN_DEPRECATED __declspec(deprecated)
|
||||
#else
|
||||
#pragma message("WARNING: You need to implement UNICORN_DEPRECATED for this compiler")
|
||||
#pragma message( \
|
||||
"WARNING: You need to implement UNICORN_DEPRECATED for this compiler")
|
||||
#define UNICORN_DEPRECATED
|
||||
#endif
|
||||
|
||||
@ -75,7 +76,6 @@ typedef size_t uc_hook;
|
||||
#define UC_VERSION_MINOR UC_API_MINOR
|
||||
#define UC_VERSION_EXTRA 0
|
||||
|
||||
|
||||
/*
|
||||
Macro to create combined version which can be compared to
|
||||
result of uc_version() API.
|
||||
@ -90,14 +90,14 @@ typedef size_t uc_hook;
|
||||
|
||||
// Architecture type
|
||||
typedef enum uc_arch {
|
||||
UC_ARCH_ARM = 1, // ARM architecture (including Thumb, Thumb-2)
|
||||
UC_ARCH_ARM64, // ARM-64, also called AArch64
|
||||
UC_ARCH_MIPS, // Mips architecture
|
||||
UC_ARCH_X86, // X86 architecture (including x86 & x86-64)
|
||||
UC_ARCH_PPC, // PowerPC architecture
|
||||
UC_ARCH_SPARC, // Sparc architecture
|
||||
UC_ARCH_M68K, // M68K architecture
|
||||
UC_ARCH_RISCV, // RISCV architecture
|
||||
UC_ARCH_ARM = 1, // ARM architecture (including Thumb, Thumb-2)
|
||||
UC_ARCH_ARM64, // ARM-64, also called AArch64
|
||||
UC_ARCH_MIPS, // Mips architecture
|
||||
UC_ARCH_X86, // X86 architecture (including x86 & x86-64)
|
||||
UC_ARCH_PPC, // PowerPC architecture
|
||||
UC_ARCH_SPARC, // Sparc architecture
|
||||
UC_ARCH_M68K, // M68K architecture
|
||||
UC_ARCH_RISCV, // RISCV architecture
|
||||
UC_ARCH_MAX,
|
||||
} uc_arch;
|
||||
|
||||
@ -107,41 +107,42 @@ typedef enum uc_mode {
|
||||
UC_MODE_BIG_ENDIAN = 1 << 30, // big-endian mode
|
||||
|
||||
// arm / arm64
|
||||
UC_MODE_ARM = 0, // ARM mode
|
||||
UC_MODE_THUMB = 1 << 4, // THUMB mode (including Thumb-2)
|
||||
UC_MODE_MCLASS = 1 << 5, // ARM's Cortex-M series
|
||||
UC_MODE_V8 = 1 << 6, // ARMv8 A32 encodings for ARM (currently unsupported)
|
||||
UC_MODE_ARM = 0, // ARM mode
|
||||
UC_MODE_THUMB = 1 << 4, // THUMB mode (including Thumb-2)
|
||||
UC_MODE_MCLASS = 1 << 5, // ARM's Cortex-M series
|
||||
UC_MODE_V8 = 1 << 6, // ARMv8 A32 encodings for ARM (currently unsupported)
|
||||
|
||||
// arm (32bit) cpu types
|
||||
UC_MODE_ARM926 = 1 << 7, // ARM926 CPU type
|
||||
UC_MODE_ARM946 = 1 << 8, // ARM946 CPU type
|
||||
UC_MODE_ARM1176 = 1 << 9, // ARM1176 CPU type
|
||||
UC_MODE_ARM926 = 1 << 7, // ARM926 CPU type
|
||||
UC_MODE_ARM946 = 1 << 8, // ARM946 CPU type
|
||||
UC_MODE_ARM1176 = 1 << 9, // ARM1176 CPU type
|
||||
|
||||
// mips
|
||||
UC_MODE_MICRO = 1 << 4, // MicroMips mode (currently unsupported)
|
||||
UC_MODE_MIPS3 = 1 << 5, // Mips III ISA (currently unsupported)
|
||||
UC_MODE_MIPS32R6 = 1 << 6, // Mips32r6 ISA (currently unsupported)
|
||||
UC_MODE_MIPS32 = 1 << 2, // Mips32 ISA
|
||||
UC_MODE_MIPS64 = 1 << 3, // Mips64 ISA
|
||||
UC_MODE_MICRO = 1 << 4, // MicroMips mode (currently unsupported)
|
||||
UC_MODE_MIPS3 = 1 << 5, // Mips III ISA (currently unsupported)
|
||||
UC_MODE_MIPS32R6 = 1 << 6, // Mips32r6 ISA (currently unsupported)
|
||||
UC_MODE_MIPS32 = 1 << 2, // Mips32 ISA
|
||||
UC_MODE_MIPS64 = 1 << 3, // Mips64 ISA
|
||||
|
||||
// x86 / x64
|
||||
UC_MODE_16 = 1 << 1, // 16-bit mode
|
||||
UC_MODE_32 = 1 << 2, // 32-bit mode
|
||||
UC_MODE_64 = 1 << 3, // 64-bit mode
|
||||
UC_MODE_16 = 1 << 1, // 16-bit mode
|
||||
UC_MODE_32 = 1 << 2, // 32-bit mode
|
||||
UC_MODE_64 = 1 << 3, // 64-bit mode
|
||||
|
||||
// ppc
|
||||
UC_MODE_PPC32 = 1 << 2, // 32-bit mode
|
||||
UC_MODE_PPC64 = 1 << 3, // 64-bit mode (currently unsupported)
|
||||
UC_MODE_QPX = 1 << 4, // Quad Processing eXtensions mode (currently unsupported)
|
||||
// ppc
|
||||
UC_MODE_PPC32 = 1 << 2, // 32-bit mode
|
||||
UC_MODE_PPC64 = 1 << 3, // 64-bit mode (currently unsupported)
|
||||
UC_MODE_QPX =
|
||||
1 << 4, // Quad Processing eXtensions mode (currently unsupported)
|
||||
|
||||
// sparc
|
||||
UC_MODE_SPARC32 = 1 << 2, // 32-bit mode
|
||||
UC_MODE_SPARC64 = 1 << 3, // 64-bit mode
|
||||
UC_MODE_V9 = 1 << 4, // SparcV9 mode (currently unsupported)
|
||||
UC_MODE_SPARC32 = 1 << 2, // 32-bit mode
|
||||
UC_MODE_SPARC64 = 1 << 3, // 64-bit mode
|
||||
UC_MODE_V9 = 1 << 4, // SparcV9 mode (currently unsupported)
|
||||
|
||||
// riscv
|
||||
UC_MODE_RISCV32 = 1 << 2, // 32-bit mode
|
||||
UC_MODE_RISCV64 = 1 << 3, // 64-bit mode
|
||||
UC_MODE_RISCV32 = 1 << 2, // 32-bit mode
|
||||
UC_MODE_RISCV64 = 1 << 3, // 64-bit mode
|
||||
|
||||
// m68k
|
||||
} uc_mode;
|
||||
@ -149,39 +150,48 @@ typedef enum uc_mode {
|
||||
// All type of errors encountered by Unicorn API.
|
||||
// These are values returned by uc_errno()
|
||||
typedef enum uc_err {
|
||||
UC_ERR_OK = 0, // No error: everything was fine
|
||||
UC_ERR_NOMEM, // Out-Of-Memory error: uc_open(), uc_emulate()
|
||||
UC_ERR_ARCH, // Unsupported architecture: uc_open()
|
||||
UC_ERR_HANDLE, // Invalid handle
|
||||
UC_ERR_MODE, // Invalid/unsupported mode: uc_open()
|
||||
UC_ERR_VERSION, // Unsupported version (bindings)
|
||||
UC_ERR_READ_UNMAPPED, // Quit emulation due to READ on unmapped memory: uc_emu_start()
|
||||
UC_ERR_WRITE_UNMAPPED, // Quit emulation due to WRITE on unmapped memory: uc_emu_start()
|
||||
UC_ERR_FETCH_UNMAPPED, // Quit emulation due to FETCH on unmapped memory: uc_emu_start()
|
||||
UC_ERR_HOOK, // Invalid hook type: uc_hook_add()
|
||||
UC_ERR_INSN_INVALID, // Quit emulation due to invalid instruction: uc_emu_start()
|
||||
UC_ERR_MAP, // Invalid memory mapping: uc_mem_map()
|
||||
UC_ERR_WRITE_PROT, // Quit emulation due to UC_MEM_WRITE_PROT violation: uc_emu_start()
|
||||
UC_ERR_READ_PROT, // Quit emulation due to UC_MEM_READ_PROT violation: uc_emu_start()
|
||||
UC_ERR_FETCH_PROT, // Quit emulation due to UC_MEM_FETCH_PROT violation: uc_emu_start()
|
||||
UC_ERR_ARG, // Inavalid argument provided to uc_xxx function (See specific function API)
|
||||
UC_ERR_OK = 0, // No error: everything was fine
|
||||
UC_ERR_NOMEM, // Out-Of-Memory error: uc_open(), uc_emulate()
|
||||
UC_ERR_ARCH, // Unsupported architecture: uc_open()
|
||||
UC_ERR_HANDLE, // Invalid handle
|
||||
UC_ERR_MODE, // Invalid/unsupported mode: uc_open()
|
||||
UC_ERR_VERSION, // Unsupported version (bindings)
|
||||
UC_ERR_READ_UNMAPPED, // Quit emulation due to READ on unmapped memory:
|
||||
// uc_emu_start()
|
||||
UC_ERR_WRITE_UNMAPPED, // Quit emulation due to WRITE on unmapped memory:
|
||||
// uc_emu_start()
|
||||
UC_ERR_FETCH_UNMAPPED, // Quit emulation due to FETCH on unmapped memory:
|
||||
// uc_emu_start()
|
||||
UC_ERR_HOOK, // Invalid hook type: uc_hook_add()
|
||||
UC_ERR_INSN_INVALID, // Quit emulation due to invalid instruction:
|
||||
// uc_emu_start()
|
||||
UC_ERR_MAP, // Invalid memory mapping: uc_mem_map()
|
||||
UC_ERR_WRITE_PROT, // Quit emulation due to UC_MEM_WRITE_PROT violation:
|
||||
// uc_emu_start()
|
||||
UC_ERR_READ_PROT, // Quit emulation due to UC_MEM_READ_PROT violation:
|
||||
// uc_emu_start()
|
||||
UC_ERR_FETCH_PROT, // Quit emulation due to UC_MEM_FETCH_PROT violation:
|
||||
// uc_emu_start()
|
||||
UC_ERR_ARG, // Inavalid argument provided to uc_xxx function (See specific
|
||||
// function API)
|
||||
UC_ERR_READ_UNALIGNED, // Unaligned read
|
||||
UC_ERR_WRITE_UNALIGNED, // Unaligned write
|
||||
UC_ERR_FETCH_UNALIGNED, // Unaligned fetch
|
||||
UC_ERR_HOOK_EXIST, // hook for this event already existed
|
||||
UC_ERR_RESOURCE, // Insufficient resource: uc_emu_start()
|
||||
UC_ERR_EXCEPTION, // Unhandled CPU exception
|
||||
UC_ERR_WRITE_UNALIGNED, // Unaligned write
|
||||
UC_ERR_FETCH_UNALIGNED, // Unaligned fetch
|
||||
UC_ERR_HOOK_EXIST, // hook for this event already existed
|
||||
UC_ERR_RESOURCE, // Insufficient resource: uc_emu_start()
|
||||
UC_ERR_EXCEPTION, // Unhandled CPU exception
|
||||
} uc_err;
|
||||
|
||||
|
||||
/*
|
||||
Callback function for tracing code (UC_HOOK_CODE & UC_HOOK_BLOCK)
|
||||
|
||||
@address: address where the code is being executed
|
||||
@size: size of machine instruction(s) being executed, or 0 when size is unknown
|
||||
@size: size of machine instruction(s) being executed, or 0 when size is
|
||||
unknown
|
||||
@user_data: user data passed to tracing APIs.
|
||||
*/
|
||||
typedef void (*uc_cb_hookcode_t)(uc_engine *uc, uint64_t address, uint32_t size, void *user_data);
|
||||
typedef void (*uc_cb_hookcode_t)(uc_engine *uc, uint64_t address, uint32_t size,
|
||||
void *user_data);
|
||||
|
||||
/*
|
||||
Callback function for tracing interrupts (for uc_hook_intr())
|
||||
@ -189,14 +199,16 @@ typedef void (*uc_cb_hookcode_t)(uc_engine *uc, uint64_t address, uint32_t size,
|
||||
@intno: interrupt number
|
||||
@user_data: user data passed to tracing APIs.
|
||||
*/
|
||||
typedef void (*uc_cb_hookintr_t)(uc_engine *uc, uint32_t intno, void *user_data);
|
||||
typedef void (*uc_cb_hookintr_t)(uc_engine *uc, uint32_t intno,
|
||||
void *user_data);
|
||||
|
||||
/*
|
||||
Callback function for tracing invalid instructions
|
||||
|
||||
@user_data: user data passed to tracing APIs.
|
||||
|
||||
@return: return true to continue, or false to stop program (due to invalid instruction).
|
||||
@return: return true to continue, or false to stop program (due to invalid
|
||||
instruction).
|
||||
*/
|
||||
typedef bool (*uc_cb_hookinsn_invalid_t)(uc_engine *uc, void *user_data);
|
||||
|
||||
@ -207,7 +219,8 @@ typedef bool (*uc_cb_hookinsn_invalid_t)(uc_engine *uc, void *user_data);
|
||||
@size: data size (1/2/4) to be read from this port
|
||||
@user_data: user data passed to tracing APIs.
|
||||
*/
|
||||
typedef uint32_t (*uc_cb_insn_in_t)(uc_engine *uc, uint32_t port, int size, void *user_data);
|
||||
typedef uint32_t (*uc_cb_insn_in_t)(uc_engine *uc, uint32_t port, int size,
|
||||
void *user_data);
|
||||
|
||||
/*
|
||||
Callback function for OUT instruction of X86
|
||||
@ -216,7 +229,8 @@ typedef uint32_t (*uc_cb_insn_in_t)(uc_engine *uc, uint32_t port, int size, void
|
||||
@size: data size (1/2/4) to be written to this port
|
||||
@value: data value to be written to this port
|
||||
*/
|
||||
typedef void (*uc_cb_insn_out_t)(uc_engine *uc, uint32_t port, int size, uint32_t value, void *user_data);
|
||||
typedef void (*uc_cb_insn_out_t)(uc_engine *uc, uint32_t port, int size,
|
||||
uint32_t value, void *user_data);
|
||||
|
||||
/*
|
||||
Callback function for MMIO read
|
||||
@ -225,7 +239,8 @@ typedef void (*uc_cb_insn_out_t)(uc_engine *uc, uint32_t port, int size, uint32_
|
||||
@size: data size to read
|
||||
@user_data: user data passed to uc_mmio_map()
|
||||
*/
|
||||
typedef uint64_t (*uc_cb_mmio_read_t)(uc_engine *uc, uint64_t offset, unsigned size, void *user_data);
|
||||
typedef uint64_t (*uc_cb_mmio_read_t)(uc_engine *uc, uint64_t offset,
|
||||
unsigned size, void *user_data);
|
||||
|
||||
/*
|
||||
Callback function for MMIO write
|
||||
@ -235,28 +250,30 @@ typedef uint64_t (*uc_cb_mmio_read_t)(uc_engine *uc, uint64_t offset, unsigned s
|
||||
@value: data value to be written
|
||||
@user_data: user data passed to uc_mmio_map()
|
||||
*/
|
||||
typedef void (*uc_cb_mmio_write_t)(uc_engine *uc, uint64_t offset, unsigned size, uint64_t value, void *user_data);
|
||||
|
||||
typedef void (*uc_cb_mmio_write_t)(uc_engine *uc, uint64_t offset,
|
||||
unsigned size, uint64_t value,
|
||||
void *user_data);
|
||||
|
||||
// All type of memory accesses for UC_HOOK_MEM_*
|
||||
typedef enum uc_mem_type {
|
||||
UC_MEM_READ = 16, // Memory is read from
|
||||
UC_MEM_WRITE, // Memory is written to
|
||||
UC_MEM_FETCH, // Memory is fetched
|
||||
UC_MEM_READ_UNMAPPED, // Unmapped memory is read from
|
||||
UC_MEM_WRITE_UNMAPPED, // Unmapped memory is written to
|
||||
UC_MEM_FETCH_UNMAPPED, // Unmapped memory is fetched
|
||||
UC_MEM_WRITE_PROT, // Write to write protected, but mapped, memory
|
||||
UC_MEM_READ_PROT, // Read from read protected, but mapped, memory
|
||||
UC_MEM_FETCH_PROT, // Fetch from non-executable, but mapped, memory
|
||||
UC_MEM_READ_AFTER, // Memory is read from (successful access)
|
||||
UC_MEM_READ = 16, // Memory is read from
|
||||
UC_MEM_WRITE, // Memory is written to
|
||||
UC_MEM_FETCH, // Memory is fetched
|
||||
UC_MEM_READ_UNMAPPED, // Unmapped memory is read from
|
||||
UC_MEM_WRITE_UNMAPPED, // Unmapped memory is written to
|
||||
UC_MEM_FETCH_UNMAPPED, // Unmapped memory is fetched
|
||||
UC_MEM_WRITE_PROT, // Write to write protected, but mapped, memory
|
||||
UC_MEM_READ_PROT, // Read from read protected, but mapped, memory
|
||||
UC_MEM_FETCH_PROT, // Fetch from non-executable, but mapped, memory
|
||||
UC_MEM_READ_AFTER, // Memory is read from (successful access)
|
||||
} uc_mem_type;
|
||||
|
||||
// All type of hooks for uc_hook_add() API.
|
||||
typedef enum uc_hook_type {
|
||||
// Hook all interrupt/syscall events
|
||||
UC_HOOK_INTR = 1 << 0,
|
||||
// Hook a particular instruction - only a very small subset of instructions supported here
|
||||
// Hook a particular instruction - only a very small subset of instructions
|
||||
// supported here
|
||||
UC_HOOK_INSN = 1 << 1,
|
||||
// Hook a range of code
|
||||
UC_HOOK_CODE = 1 << 2,
|
||||
@ -288,21 +305,29 @@ typedef enum uc_hook_type {
|
||||
} uc_hook_type;
|
||||
|
||||
// Hook type for all events of unmapped memory access
|
||||
#define UC_HOOK_MEM_UNMAPPED (UC_HOOK_MEM_READ_UNMAPPED + UC_HOOK_MEM_WRITE_UNMAPPED + UC_HOOK_MEM_FETCH_UNMAPPED)
|
||||
#define UC_HOOK_MEM_UNMAPPED \
|
||||
(UC_HOOK_MEM_READ_UNMAPPED + UC_HOOK_MEM_WRITE_UNMAPPED + \
|
||||
UC_HOOK_MEM_FETCH_UNMAPPED)
|
||||
// Hook type for all events of illegal protected memory access
|
||||
#define UC_HOOK_MEM_PROT (UC_HOOK_MEM_READ_PROT + UC_HOOK_MEM_WRITE_PROT + UC_HOOK_MEM_FETCH_PROT)
|
||||
#define UC_HOOK_MEM_PROT \
|
||||
(UC_HOOK_MEM_READ_PROT + UC_HOOK_MEM_WRITE_PROT + UC_HOOK_MEM_FETCH_PROT)
|
||||
// Hook type for all events of illegal read memory access
|
||||
#define UC_HOOK_MEM_READ_INVALID (UC_HOOK_MEM_READ_PROT + UC_HOOK_MEM_READ_UNMAPPED)
|
||||
#define UC_HOOK_MEM_READ_INVALID \
|
||||
(UC_HOOK_MEM_READ_PROT + UC_HOOK_MEM_READ_UNMAPPED)
|
||||
// Hook type for all events of illegal write memory access
|
||||
#define UC_HOOK_MEM_WRITE_INVALID (UC_HOOK_MEM_WRITE_PROT + UC_HOOK_MEM_WRITE_UNMAPPED)
|
||||
#define UC_HOOK_MEM_WRITE_INVALID \
|
||||
(UC_HOOK_MEM_WRITE_PROT + UC_HOOK_MEM_WRITE_UNMAPPED)
|
||||
// Hook type for all events of illegal fetch memory access
|
||||
#define UC_HOOK_MEM_FETCH_INVALID (UC_HOOK_MEM_FETCH_PROT + UC_HOOK_MEM_FETCH_UNMAPPED)
|
||||
#define UC_HOOK_MEM_FETCH_INVALID \
|
||||
(UC_HOOK_MEM_FETCH_PROT + UC_HOOK_MEM_FETCH_UNMAPPED)
|
||||
// Hook type for all events of illegal memory access
|
||||
#define UC_HOOK_MEM_INVALID (UC_HOOK_MEM_UNMAPPED + UC_HOOK_MEM_PROT)
|
||||
// Hook type for all events of valid memory access
|
||||
// NOTE: UC_HOOK_MEM_READ is triggered before UC_HOOK_MEM_READ_PROT and UC_HOOK_MEM_READ_UNMAPPED, so
|
||||
// this hook may technically trigger on some invalid reads.
|
||||
#define UC_HOOK_MEM_VALID (UC_HOOK_MEM_READ + UC_HOOK_MEM_WRITE + UC_HOOK_MEM_FETCH)
|
||||
// NOTE: UC_HOOK_MEM_READ is triggered before UC_HOOK_MEM_READ_PROT and
|
||||
// UC_HOOK_MEM_READ_UNMAPPED, so
|
||||
// this hook may technically trigger on some invalid reads.
|
||||
#define UC_HOOK_MEM_VALID \
|
||||
(UC_HOOK_MEM_READ + UC_HOOK_MEM_WRITE + UC_HOOK_MEM_FETCH)
|
||||
|
||||
/*
|
||||
Callback function for hooking memory (READ, WRITE & FETCH)
|
||||
@ -314,7 +339,8 @@ typedef enum uc_hook_type {
|
||||
@user_data: user data passed to tracing APIs
|
||||
*/
|
||||
typedef void (*uc_cb_hookmem_t)(uc_engine *uc, uc_mem_type type,
|
||||
uint64_t address, int size, int64_t value, void *user_data);
|
||||
uint64_t address, int size, int64_t value,
|
||||
void *user_data);
|
||||
|
||||
/*
|
||||
Callback function for handling invalid memory access events (UNMAPPED and
|
||||
@ -326,21 +352,24 @@ typedef void (*uc_cb_hookmem_t)(uc_engine *uc, uc_mem_type type,
|
||||
@value: value of data being written to memory, or irrelevant if type = READ.
|
||||
@user_data: user data passed to tracing APIs
|
||||
|
||||
@return: return true to continue, or false to stop program (due to invalid memory).
|
||||
NOTE: returning true to continue execution will only work if if the accessed
|
||||
memory is made accessible with the correct permissions during the hook.
|
||||
@return: return true to continue, or false to stop program (due to invalid
|
||||
memory). NOTE: returning true to continue execution will only work if if the
|
||||
accessed memory is made accessible with the correct permissions during the
|
||||
hook.
|
||||
|
||||
In the event of a UC_MEM_READ_UNMAPPED or UC_MEM_WRITE_UNMAPPED callback,
|
||||
the memory should be uc_mem_map()-ed with the correct permissions, and the
|
||||
instruction will then read or write to the address as it was supposed to.
|
||||
In the event of a UC_MEM_READ_UNMAPPED or UC_MEM_WRITE_UNMAPPED
|
||||
callback, the memory should be uc_mem_map()-ed with the correct permissions,
|
||||
and the instruction will then read or write to the address as it was supposed
|
||||
to.
|
||||
|
||||
In the event of a UC_MEM_FETCH_UNMAPPED callback, the memory can be mapped
|
||||
in as executable, in which case execution will resume from the fetched address.
|
||||
The instruction pointer may be written to in order to change where execution resumes,
|
||||
but the fetch must succeed if execution is to resume.
|
||||
In the event of a UC_MEM_FETCH_UNMAPPED callback, the memory can be
|
||||
mapped in as executable, in which case execution will resume from the fetched
|
||||
address. The instruction pointer may be written to in order to change where
|
||||
execution resumes, but the fetch must succeed if execution is to resume.
|
||||
*/
|
||||
typedef bool (*uc_cb_eventmem_t)(uc_engine *uc, uc_mem_type type,
|
||||
uint64_t address, int size, int64_t value, void *user_data);
|
||||
uint64_t address, int size, int64_t value,
|
||||
void *user_data);
|
||||
|
||||
/*
|
||||
Memory region mapped by uc_mem_map() and uc_mem_map_ptr()
|
||||
@ -357,8 +386,9 @@ typedef enum uc_query_type {
|
||||
// Dynamically query current hardware mode.
|
||||
UC_QUERY_MODE = 1,
|
||||
UC_QUERY_PAGE_SIZE, // query pagesize of engine
|
||||
UC_QUERY_ARCH, // query architecture of engine (for ARM to query Thumb mode)
|
||||
UC_QUERY_TIMEOUT, // query if emulation stops due to timeout (indicated if result = True)
|
||||
UC_QUERY_ARCH, // query architecture of engine (for ARM to query Thumb mode)
|
||||
UC_QUERY_TIMEOUT, // query if emulation stops due to timeout (indicated if
|
||||
// result = True)
|
||||
} uc_query_type;
|
||||
|
||||
// Opaque storage for CPU context, used with uc_context_*()
|
||||
@ -385,7 +415,6 @@ typedef struct uc_context uc_context;
|
||||
UNICORN_EXPORT
|
||||
unsigned int uc_version(unsigned int *major, unsigned int *minor);
|
||||
|
||||
|
||||
/*
|
||||
Determine if the given architecture is supported by this library.
|
||||
|
||||
@ -396,7 +425,6 @@ unsigned int uc_version(unsigned int *major, unsigned int *minor);
|
||||
UNICORN_EXPORT
|
||||
bool uc_arch_supported(uc_arch arch);
|
||||
|
||||
|
||||
/*
|
||||
Create new instance of unicorn engine.
|
||||
|
||||
@ -499,7 +527,8 @@ uc_err uc_reg_read(uc_engine *uc, int regid, void *value);
|
||||
for detailed error).
|
||||
*/
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_reg_write_batch(uc_engine *uc, int *regs, void *const *vals, int count);
|
||||
uc_err uc_reg_write_batch(uc_engine *uc, int *regs, void *const *vals,
|
||||
int count);
|
||||
|
||||
/*
|
||||
Read multiple register values.
|
||||
@ -529,7 +558,8 @@ uc_err uc_reg_read_batch(uc_engine *uc, int *regs, void **vals, int count);
|
||||
for detailed error).
|
||||
*/
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_mem_write(uc_engine *uc, uint64_t address, const void *bytes, size_t size);
|
||||
uc_err uc_mem_write(uc_engine *uc, uint64_t address, const void *bytes,
|
||||
size_t size);
|
||||
|
||||
/*
|
||||
Read a range of bytes in memory.
|
||||
@ -566,7 +596,8 @@ uc_err uc_mem_read(uc_engine *uc, uint64_t address, void *bytes, size_t size);
|
||||
for detailed error).
|
||||
*/
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until, uint64_t timeout, size_t count);
|
||||
uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until,
|
||||
uint64_t timeout, size_t count);
|
||||
|
||||
/*
|
||||
Stop emulation (which was started by uc_emu_start() API.
|
||||
@ -585,15 +616,17 @@ uc_err uc_emu_stop(uc_engine *uc);
|
||||
The callback will be run when the hook event is hit.
|
||||
|
||||
@uc: handle returned by uc_open()
|
||||
@hh: hook handle returned from this registration. To be used in uc_hook_del() API
|
||||
@hh: hook handle returned from this registration. To be used in uc_hook_del()
|
||||
API
|
||||
@type: hook type
|
||||
@callback: callback to be run when instruction is hit
|
||||
@user_data: user-defined data. This will be passed to callback function in its
|
||||
last argument @user_data
|
||||
@begin: start address of the area where the callback is effect (inclusive)
|
||||
@end: end address of the area where the callback is effect (inclusive)
|
||||
NOTE 1: the callback is called only if related address is in range [@begin, @end]
|
||||
NOTE 2: if @begin > @end, callback is called whenever this hook type is triggered
|
||||
NOTE 1: the callback is called only if related address is in range [@begin,
|
||||
@end] NOTE 2: if @begin > @end, callback is called whenever this hook type is
|
||||
triggered
|
||||
@...: variable arguments (depending on @type)
|
||||
NOTE: if @type = UC_HOOK_INSN, this is the instruction ID.
|
||||
currently, only x86 in, out, syscall, sysenter, cpuid are supported.
|
||||
@ -603,7 +636,7 @@ uc_err uc_emu_stop(uc_engine *uc);
|
||||
*/
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_hook_add(uc_engine *uc, uc_hook *hh, int type, void *callback,
|
||||
void *user_data, uint64_t begin, uint64_t end, ...);
|
||||
void *user_data, uint64_t begin, uint64_t end, ...);
|
||||
|
||||
/*
|
||||
Unregister (remove) a hook callback.
|
||||
@ -621,11 +654,11 @@ UNICORN_EXPORT
|
||||
uc_err uc_hook_del(uc_engine *uc, uc_hook hh);
|
||||
|
||||
typedef enum uc_prot {
|
||||
UC_PROT_NONE = 0,
|
||||
UC_PROT_READ = 1,
|
||||
UC_PROT_WRITE = 2,
|
||||
UC_PROT_EXEC = 4,
|
||||
UC_PROT_ALL = 7,
|
||||
UC_PROT_NONE = 0,
|
||||
UC_PROT_READ = 1,
|
||||
UC_PROT_WRITE = 2,
|
||||
UC_PROT_EXEC = 4,
|
||||
UC_PROT_ALL = 7,
|
||||
} uc_prot;
|
||||
|
||||
/*
|
||||
@ -634,12 +667,14 @@ typedef enum uc_prot {
|
||||
|
||||
@uc: handle returned by uc_open()
|
||||
@address: starting address of the new memory region to be mapped in.
|
||||
This address must be aligned to 4KB, or this will return with UC_ERR_ARG error.
|
||||
This address must be aligned to 4KB, or this will return with UC_ERR_ARG
|
||||
error.
|
||||
@size: size of the new memory region to be mapped in.
|
||||
This size must be multiple of 4KB, or this will return with UC_ERR_ARG error.
|
||||
This size must be multiple of 4KB, or this will return with UC_ERR_ARG
|
||||
error.
|
||||
@perms: Permissions for the newly mapped region.
|
||||
This must be some combination of UC_PROT_READ | UC_PROT_WRITE | UC_PROT_EXEC,
|
||||
or this will return with UC_ERR_ARG error.
|
||||
This must be some combination of UC_PROT_READ | UC_PROT_WRITE |
|
||||
UC_PROT_EXEC, or this will return with UC_ERR_ARG error.
|
||||
|
||||
@return UC_ERR_OK on success, or other value on failure (refer to uc_err enum
|
||||
for detailed error).
|
||||
@ -653,21 +688,25 @@ uc_err uc_mem_map(uc_engine *uc, uint64_t address, size_t size, uint32_t perms);
|
||||
|
||||
@uc: handle returned by uc_open()
|
||||
@address: starting address of the new memory region to be mapped in.
|
||||
This address must be aligned to 4KB, or this will return with UC_ERR_ARG error.
|
||||
This address must be aligned to 4KB, or this will return with UC_ERR_ARG
|
||||
error.
|
||||
@size: size of the new memory region to be mapped in.
|
||||
This size must be multiple of 4KB, or this will return with UC_ERR_ARG error.
|
||||
This size must be multiple of 4KB, or this will return with UC_ERR_ARG
|
||||
error.
|
||||
@perms: Permissions for the newly mapped region.
|
||||
This must be some combination of UC_PROT_READ | UC_PROT_WRITE | UC_PROT_EXEC,
|
||||
or this will return with UC_ERR_ARG error.
|
||||
@ptr: pointer to host memory backing the newly mapped memory. This host memory is
|
||||
expected to be an equal or larger size than provided, and be mapped with at
|
||||
least PROT_READ | PROT_WRITE. If it is not, the resulting behavior is undefined.
|
||||
This must be some combination of UC_PROT_READ | UC_PROT_WRITE |
|
||||
UC_PROT_EXEC, or this will return with UC_ERR_ARG error.
|
||||
@ptr: pointer to host memory backing the newly mapped memory. This host memory
|
||||
is expected to be an equal or larger size than provided, and be mapped with at
|
||||
least PROT_READ | PROT_WRITE. If it is not, the resulting behavior is
|
||||
undefined.
|
||||
|
||||
@return UC_ERR_OK on success, or other value on failure (refer to uc_err enum
|
||||
for detailed error).
|
||||
*/
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_mem_map_ptr(uc_engine *uc, uint64_t address, size_t size, uint32_t perms, void *ptr);
|
||||
uc_err uc_mem_map_ptr(uc_engine *uc, uint64_t address, size_t size,
|
||||
uint32_t perms, void *ptr);
|
||||
|
||||
/*
|
||||
Map MMIO in for emulation.
|
||||
@ -675,15 +714,16 @@ uc_err uc_mem_map_ptr(uc_engine *uc, uint64_t address, size_t size, uint32_t per
|
||||
|
||||
@uc: handle returned by uc_open()
|
||||
@address: starting address of the new MMIO region to be mapped in.
|
||||
This address must be aligned to 4KB, or this will return with UC_ERR_ARG error.
|
||||
This address must be aligned to 4KB, or this will return with UC_ERR_ARG
|
||||
error.
|
||||
@size: size of the new MMIO region to be mapped in.
|
||||
This size must be multiple of 4KB, or this will return with UC_ERR_ARG error.
|
||||
@read_cb: function for handling reads from this MMIO region.
|
||||
@user_data_read: user-defined data. This will be passed to @read_cb function in its
|
||||
last argument @user_data
|
||||
@user_data_read: user-defined data. This will be passed to @read_cb function in
|
||||
its last argument @user_data
|
||||
@write_cb: function for handling writes to this MMIO region.
|
||||
@user_data_write: user-defined data. This will be passed to @write_cb function in its
|
||||
last argument @user_data
|
||||
@user_data_write: user-defined data. This will be passed to @write_cb function
|
||||
in its last argument @user_data
|
||||
@return UC_ERR_OK on success, or other value on failure (refer to uc_err enum
|
||||
for detailed error).
|
||||
*/
|
||||
@ -698,9 +738,11 @@ uc_err uc_mmio_map(uc_engine *uc, uint64_t address, size_t size,
|
||||
|
||||
@uc: handle returned by uc_open()
|
||||
@address: starting address of the memory region to be unmapped.
|
||||
This address must be aligned to 4KB, or this will return with UC_ERR_ARG error.
|
||||
This address must be aligned to 4KB, or this will return with UC_ERR_ARG
|
||||
error.
|
||||
@size: size of the memory region to be modified.
|
||||
This size must be multiple of 4KB, or this will return with UC_ERR_ARG error.
|
||||
This size must be multiple of 4KB, or this will return with UC_ERR_ARG
|
||||
error.
|
||||
|
||||
@return UC_ERR_OK on success, or other value on failure (refer to uc_err enum
|
||||
for detailed error).
|
||||
@ -714,18 +756,21 @@ uc_err uc_mem_unmap(uc_engine *uc, uint64_t address, size_t size);
|
||||
|
||||
@uc: handle returned by uc_open()
|
||||
@address: starting address of the memory region to be modified.
|
||||
This address must be aligned to 4KB, or this will return with UC_ERR_ARG error.
|
||||
This address must be aligned to 4KB, or this will return with UC_ERR_ARG
|
||||
error.
|
||||
@size: size of the memory region to be modified.
|
||||
This size must be multiple of 4KB, or this will return with UC_ERR_ARG error.
|
||||
This size must be multiple of 4KB, or this will return with UC_ERR_ARG
|
||||
error.
|
||||
@perms: New permissions for the mapped region.
|
||||
This must be some combination of UC_PROT_READ | UC_PROT_WRITE | UC_PROT_EXEC,
|
||||
or this will return with UC_ERR_ARG error.
|
||||
This must be some combination of UC_PROT_READ | UC_PROT_WRITE |
|
||||
UC_PROT_EXEC, or this will return with UC_ERR_ARG error.
|
||||
|
||||
@return UC_ERR_OK on success, or other value on failure (refer to uc_err enum
|
||||
for detailed error).
|
||||
*/
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_mem_protect(uc_engine *uc, uint64_t address, size_t size, uint32_t perms);
|
||||
uc_err uc_mem_protect(uc_engine *uc, uint64_t address, size_t size,
|
||||
uint32_t perms);
|
||||
|
||||
/*
|
||||
Retrieve all memory regions mapped by uc_mem_map() and uc_mem_map_ptr()
|
||||
@ -763,9 +808,9 @@ uc_err uc_context_alloc(uc_engine *uc, uc_context **context);
|
||||
|
||||
/*
|
||||
Free the memory allocated by uc_mem_regions.
|
||||
WARNING: After Unicorn 1.0.1rc5, the memory allocated by uc_context_alloc should
|
||||
be free-ed by uc_context_free(). Calling uc_free() may still work, but the result
|
||||
is **undefined**.
|
||||
WARNING: After Unicorn 1.0.1rc5, the memory allocated by uc_context_alloc
|
||||
should be free-ed by uc_context_free(). Calling uc_free() may still work, but
|
||||
the result is **undefined**.
|
||||
|
||||
@mem: memory allocated by uc_mem_regions (returned in *regions).
|
||||
|
||||
@ -827,7 +872,8 @@ uc_err uc_context_reg_read(uc_context *ctx, int regid, void *value);
|
||||
for detailed error).
|
||||
*/
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_context_reg_write_batch(uc_context *ctx, int *regs, void *const *vals, int count);
|
||||
uc_err uc_context_reg_write_batch(uc_context *ctx, int *regs, void *const *vals,
|
||||
int count);
|
||||
|
||||
/*
|
||||
Read multiple register values from a context.
|
||||
@ -841,7 +887,8 @@ uc_err uc_context_reg_write_batch(uc_context *ctx, int *regs, void *const *vals,
|
||||
for detailed error).
|
||||
*/
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_context_reg_read_batch(uc_context *ctx, int *regs, void **vals, int count);
|
||||
uc_err uc_context_reg_read_batch(uc_context *ctx, int *regs, void **vals,
|
||||
int count);
|
||||
|
||||
/*
|
||||
Restore the current CPU context from a saved copy.
|
||||
@ -849,7 +896,8 @@ uc_err uc_context_reg_read_batch(uc_context *ctx, int *regs, void **vals, int co
|
||||
state saved by uc_context_save().
|
||||
|
||||
@uc: handle returned by uc_open()
|
||||
@context: handle returned by uc_context_alloc that has been used with uc_context_save
|
||||
@context: handle returned by uc_context_alloc that has been used with
|
||||
uc_context_save
|
||||
|
||||
@return UC_ERR_OK on success, or other value on failure (refer to uc_err enum
|
||||
for detailed error).
|
||||
@ -857,10 +905,9 @@ uc_err uc_context_reg_read_batch(uc_context *ctx, int *regs, void **vals, int co
|
||||
UNICORN_EXPORT
|
||||
uc_err uc_context_restore(uc_engine *uc, uc_context *context);
|
||||
|
||||
|
||||
/*
|
||||
Return the size needed to store the cpu context. Can be used to allocate a buffer
|
||||
to contain the cpu context and directly call uc_context_save.
|
||||
Return the size needed to store the cpu context. Can be used to allocate a
|
||||
buffer to contain the cpu context and directly call uc_context_save.
|
||||
|
||||
@uc: handle returned by uc_open()
|
||||
|
||||
@ -869,7 +916,6 @@ uc_err uc_context_restore(uc_engine *uc, uc_context *context);
|
||||
UNICORN_EXPORT
|
||||
size_t uc_context_size(uc_engine *uc);
|
||||
|
||||
|
||||
/*
|
||||
Free the context allocated by uc_context_alloc().
|
||||
|
||||
|
@ -16,14 +16,14 @@ extern "C" {
|
||||
// Memory-Management Register for instructions IDTR, GDTR, LDTR, TR.
|
||||
// Borrow from SegmentCache in qemu/target-i386/cpu.h
|
||||
typedef struct uc_x86_mmr {
|
||||
uint16_t selector; /* not used by GDTR and IDTR */
|
||||
uint64_t base; /* handle 32 or 64 bit CPUs */
|
||||
uint16_t selector; /* not used by GDTR and IDTR */
|
||||
uint64_t base; /* handle 32 or 64 bit CPUs */
|
||||
uint32_t limit;
|
||||
uint32_t flags; /* not used by GDTR and IDTR */
|
||||
uint32_t flags; /* not used by GDTR and IDTR */
|
||||
} uc_x86_mmr;
|
||||
|
||||
// Model-Specific Register structure, use this with UC_X86_REG_MSR (as the register ID) in
|
||||
// call to uc_reg_write/uc_reg_read() to manipulate MSRs.
|
||||
// Model-Specific Register structure, use this with UC_X86_REG_MSR (as the
|
||||
// register ID) in call to uc_reg_write/uc_reg_read() to manipulate MSRs.
|
||||
typedef struct uc_x86_msr {
|
||||
uint32_t rid; // MSR id
|
||||
uint64_t value; // MSR value
|
||||
@ -35,62 +35,241 @@ typedef void (*uc_cb_insn_syscall_t)(struct uc_struct *uc, void *user_data);
|
||||
|
||||
//> X86 registers
|
||||
typedef enum uc_x86_reg {
|
||||
UC_X86_REG_INVALID = 0,
|
||||
UC_X86_REG_AH, UC_X86_REG_AL, UC_X86_REG_AX, UC_X86_REG_BH, UC_X86_REG_BL,
|
||||
UC_X86_REG_BP, UC_X86_REG_BPL, UC_X86_REG_BX, UC_X86_REG_CH, UC_X86_REG_CL,
|
||||
UC_X86_REG_CS, UC_X86_REG_CX, UC_X86_REG_DH, UC_X86_REG_DI, UC_X86_REG_DIL,
|
||||
UC_X86_REG_DL, UC_X86_REG_DS, UC_X86_REG_DX, UC_X86_REG_EAX, UC_X86_REG_EBP,
|
||||
UC_X86_REG_EBX, UC_X86_REG_ECX, UC_X86_REG_EDI, UC_X86_REG_EDX, UC_X86_REG_EFLAGS,
|
||||
UC_X86_REG_EIP, UC_X86_REG_ES, UC_X86_REG_ESI, UC_X86_REG_ESP,
|
||||
UC_X86_REG_FPSW, UC_X86_REG_FS, UC_X86_REG_GS, UC_X86_REG_IP, UC_X86_REG_RAX,
|
||||
UC_X86_REG_RBP, UC_X86_REG_RBX, UC_X86_REG_RCX, UC_X86_REG_RDI, UC_X86_REG_RDX,
|
||||
UC_X86_REG_RIP, UC_X86_REG_RSI, UC_X86_REG_RSP, UC_X86_REG_SI,
|
||||
UC_X86_REG_SIL, UC_X86_REG_SP, UC_X86_REG_SPL, UC_X86_REG_SS, UC_X86_REG_CR0,
|
||||
UC_X86_REG_CR1, UC_X86_REG_CR2, UC_X86_REG_CR3, UC_X86_REG_CR4, UC_X86_REG_CR8,
|
||||
UC_X86_REG_DR0, UC_X86_REG_DR1, UC_X86_REG_DR2, UC_X86_REG_DR3, UC_X86_REG_DR4,
|
||||
UC_X86_REG_DR5, UC_X86_REG_DR6, UC_X86_REG_DR7, UC_X86_REG_FP0, UC_X86_REG_FP1,
|
||||
UC_X86_REG_FP2, UC_X86_REG_FP3,
|
||||
UC_X86_REG_FP4, UC_X86_REG_FP5, UC_X86_REG_FP6, UC_X86_REG_FP7,
|
||||
UC_X86_REG_K0, UC_X86_REG_K1, UC_X86_REG_K2, UC_X86_REG_K3, UC_X86_REG_K4,
|
||||
UC_X86_REG_K5, UC_X86_REG_K6, UC_X86_REG_K7, UC_X86_REG_MM0, UC_X86_REG_MM1,
|
||||
UC_X86_REG_MM2, UC_X86_REG_MM3, UC_X86_REG_MM4, UC_X86_REG_MM5, UC_X86_REG_MM6,
|
||||
UC_X86_REG_MM7, UC_X86_REG_R8, UC_X86_REG_R9, UC_X86_REG_R10, UC_X86_REG_R11,
|
||||
UC_X86_REG_R12, UC_X86_REG_R13, UC_X86_REG_R14, UC_X86_REG_R15,
|
||||
UC_X86_REG_ST0, UC_X86_REG_ST1, UC_X86_REG_ST2, UC_X86_REG_ST3,
|
||||
UC_X86_REG_ST4, UC_X86_REG_ST5, UC_X86_REG_ST6, UC_X86_REG_ST7,
|
||||
UC_X86_REG_XMM0, UC_X86_REG_XMM1, UC_X86_REG_XMM2, UC_X86_REG_XMM3, UC_X86_REG_XMM4,
|
||||
UC_X86_REG_XMM5, UC_X86_REG_XMM6, UC_X86_REG_XMM7, UC_X86_REG_XMM8, UC_X86_REG_XMM9,
|
||||
UC_X86_REG_XMM10, UC_X86_REG_XMM11, UC_X86_REG_XMM12, UC_X86_REG_XMM13, UC_X86_REG_XMM14,
|
||||
UC_X86_REG_XMM15, UC_X86_REG_XMM16, UC_X86_REG_XMM17, UC_X86_REG_XMM18, UC_X86_REG_XMM19,
|
||||
UC_X86_REG_XMM20, UC_X86_REG_XMM21, UC_X86_REG_XMM22, UC_X86_REG_XMM23, UC_X86_REG_XMM24,
|
||||
UC_X86_REG_XMM25, UC_X86_REG_XMM26, UC_X86_REG_XMM27, UC_X86_REG_XMM28, UC_X86_REG_XMM29,
|
||||
UC_X86_REG_XMM30, UC_X86_REG_XMM31, UC_X86_REG_YMM0, UC_X86_REG_YMM1, UC_X86_REG_YMM2,
|
||||
UC_X86_REG_YMM3, UC_X86_REG_YMM4, UC_X86_REG_YMM5, UC_X86_REG_YMM6, UC_X86_REG_YMM7,
|
||||
UC_X86_REG_YMM8, UC_X86_REG_YMM9, UC_X86_REG_YMM10, UC_X86_REG_YMM11, UC_X86_REG_YMM12,
|
||||
UC_X86_REG_YMM13, UC_X86_REG_YMM14, UC_X86_REG_YMM15, UC_X86_REG_YMM16, UC_X86_REG_YMM17,
|
||||
UC_X86_REG_YMM18, UC_X86_REG_YMM19, UC_X86_REG_YMM20, UC_X86_REG_YMM21, UC_X86_REG_YMM22,
|
||||
UC_X86_REG_YMM23, UC_X86_REG_YMM24, UC_X86_REG_YMM25, UC_X86_REG_YMM26, UC_X86_REG_YMM27,
|
||||
UC_X86_REG_YMM28, UC_X86_REG_YMM29, UC_X86_REG_YMM30, UC_X86_REG_YMM31, UC_X86_REG_ZMM0,
|
||||
UC_X86_REG_ZMM1, UC_X86_REG_ZMM2, UC_X86_REG_ZMM3, UC_X86_REG_ZMM4, UC_X86_REG_ZMM5,
|
||||
UC_X86_REG_ZMM6, UC_X86_REG_ZMM7, UC_X86_REG_ZMM8, UC_X86_REG_ZMM9, UC_X86_REG_ZMM10,
|
||||
UC_X86_REG_ZMM11, UC_X86_REG_ZMM12, UC_X86_REG_ZMM13, UC_X86_REG_ZMM14, UC_X86_REG_ZMM15,
|
||||
UC_X86_REG_ZMM16, UC_X86_REG_ZMM17, UC_X86_REG_ZMM18, UC_X86_REG_ZMM19, UC_X86_REG_ZMM20,
|
||||
UC_X86_REG_ZMM21, UC_X86_REG_ZMM22, UC_X86_REG_ZMM23, UC_X86_REG_ZMM24, UC_X86_REG_ZMM25,
|
||||
UC_X86_REG_ZMM26, UC_X86_REG_ZMM27, UC_X86_REG_ZMM28, UC_X86_REG_ZMM29, UC_X86_REG_ZMM30,
|
||||
UC_X86_REG_ZMM31, UC_X86_REG_R8B, UC_X86_REG_R9B, UC_X86_REG_R10B, UC_X86_REG_R11B,
|
||||
UC_X86_REG_R12B, UC_X86_REG_R13B, UC_X86_REG_R14B, UC_X86_REG_R15B, UC_X86_REG_R8D,
|
||||
UC_X86_REG_R9D, UC_X86_REG_R10D, UC_X86_REG_R11D, UC_X86_REG_R12D, UC_X86_REG_R13D,
|
||||
UC_X86_REG_R14D, UC_X86_REG_R15D, UC_X86_REG_R8W, UC_X86_REG_R9W, UC_X86_REG_R10W,
|
||||
UC_X86_REG_R11W, UC_X86_REG_R12W, UC_X86_REG_R13W, UC_X86_REG_R14W, UC_X86_REG_R15W,
|
||||
UC_X86_REG_IDTR, UC_X86_REG_GDTR, UC_X86_REG_LDTR, UC_X86_REG_TR, UC_X86_REG_FPCW,
|
||||
UC_X86_REG_FPTAG,
|
||||
UC_X86_REG_INVALID = 0,
|
||||
UC_X86_REG_AH,
|
||||
UC_X86_REG_AL,
|
||||
UC_X86_REG_AX,
|
||||
UC_X86_REG_BH,
|
||||
UC_X86_REG_BL,
|
||||
UC_X86_REG_BP,
|
||||
UC_X86_REG_BPL,
|
||||
UC_X86_REG_BX,
|
||||
UC_X86_REG_CH,
|
||||
UC_X86_REG_CL,
|
||||
UC_X86_REG_CS,
|
||||
UC_X86_REG_CX,
|
||||
UC_X86_REG_DH,
|
||||
UC_X86_REG_DI,
|
||||
UC_X86_REG_DIL,
|
||||
UC_X86_REG_DL,
|
||||
UC_X86_REG_DS,
|
||||
UC_X86_REG_DX,
|
||||
UC_X86_REG_EAX,
|
||||
UC_X86_REG_EBP,
|
||||
UC_X86_REG_EBX,
|
||||
UC_X86_REG_ECX,
|
||||
UC_X86_REG_EDI,
|
||||
UC_X86_REG_EDX,
|
||||
UC_X86_REG_EFLAGS,
|
||||
UC_X86_REG_EIP,
|
||||
UC_X86_REG_ES,
|
||||
UC_X86_REG_ESI,
|
||||
UC_X86_REG_ESP,
|
||||
UC_X86_REG_FPSW,
|
||||
UC_X86_REG_FS,
|
||||
UC_X86_REG_GS,
|
||||
UC_X86_REG_IP,
|
||||
UC_X86_REG_RAX,
|
||||
UC_X86_REG_RBP,
|
||||
UC_X86_REG_RBX,
|
||||
UC_X86_REG_RCX,
|
||||
UC_X86_REG_RDI,
|
||||
UC_X86_REG_RDX,
|
||||
UC_X86_REG_RIP,
|
||||
UC_X86_REG_RSI,
|
||||
UC_X86_REG_RSP,
|
||||
UC_X86_REG_SI,
|
||||
UC_X86_REG_SIL,
|
||||
UC_X86_REG_SP,
|
||||
UC_X86_REG_SPL,
|
||||
UC_X86_REG_SS,
|
||||
UC_X86_REG_CR0,
|
||||
UC_X86_REG_CR1,
|
||||
UC_X86_REG_CR2,
|
||||
UC_X86_REG_CR3,
|
||||
UC_X86_REG_CR4,
|
||||
UC_X86_REG_CR8,
|
||||
UC_X86_REG_DR0,
|
||||
UC_X86_REG_DR1,
|
||||
UC_X86_REG_DR2,
|
||||
UC_X86_REG_DR3,
|
||||
UC_X86_REG_DR4,
|
||||
UC_X86_REG_DR5,
|
||||
UC_X86_REG_DR6,
|
||||
UC_X86_REG_DR7,
|
||||
UC_X86_REG_FP0,
|
||||
UC_X86_REG_FP1,
|
||||
UC_X86_REG_FP2,
|
||||
UC_X86_REG_FP3,
|
||||
UC_X86_REG_FP4,
|
||||
UC_X86_REG_FP5,
|
||||
UC_X86_REG_FP6,
|
||||
UC_X86_REG_FP7,
|
||||
UC_X86_REG_K0,
|
||||
UC_X86_REG_K1,
|
||||
UC_X86_REG_K2,
|
||||
UC_X86_REG_K3,
|
||||
UC_X86_REG_K4,
|
||||
UC_X86_REG_K5,
|
||||
UC_X86_REG_K6,
|
||||
UC_X86_REG_K7,
|
||||
UC_X86_REG_MM0,
|
||||
UC_X86_REG_MM1,
|
||||
UC_X86_REG_MM2,
|
||||
UC_X86_REG_MM3,
|
||||
UC_X86_REG_MM4,
|
||||
UC_X86_REG_MM5,
|
||||
UC_X86_REG_MM6,
|
||||
UC_X86_REG_MM7,
|
||||
UC_X86_REG_R8,
|
||||
UC_X86_REG_R9,
|
||||
UC_X86_REG_R10,
|
||||
UC_X86_REG_R11,
|
||||
UC_X86_REG_R12,
|
||||
UC_X86_REG_R13,
|
||||
UC_X86_REG_R14,
|
||||
UC_X86_REG_R15,
|
||||
UC_X86_REG_ST0,
|
||||
UC_X86_REG_ST1,
|
||||
UC_X86_REG_ST2,
|
||||
UC_X86_REG_ST3,
|
||||
UC_X86_REG_ST4,
|
||||
UC_X86_REG_ST5,
|
||||
UC_X86_REG_ST6,
|
||||
UC_X86_REG_ST7,
|
||||
UC_X86_REG_XMM0,
|
||||
UC_X86_REG_XMM1,
|
||||
UC_X86_REG_XMM2,
|
||||
UC_X86_REG_XMM3,
|
||||
UC_X86_REG_XMM4,
|
||||
UC_X86_REG_XMM5,
|
||||
UC_X86_REG_XMM6,
|
||||
UC_X86_REG_XMM7,
|
||||
UC_X86_REG_XMM8,
|
||||
UC_X86_REG_XMM9,
|
||||
UC_X86_REG_XMM10,
|
||||
UC_X86_REG_XMM11,
|
||||
UC_X86_REG_XMM12,
|
||||
UC_X86_REG_XMM13,
|
||||
UC_X86_REG_XMM14,
|
||||
UC_X86_REG_XMM15,
|
||||
UC_X86_REG_XMM16,
|
||||
UC_X86_REG_XMM17,
|
||||
UC_X86_REG_XMM18,
|
||||
UC_X86_REG_XMM19,
|
||||
UC_X86_REG_XMM20,
|
||||
UC_X86_REG_XMM21,
|
||||
UC_X86_REG_XMM22,
|
||||
UC_X86_REG_XMM23,
|
||||
UC_X86_REG_XMM24,
|
||||
UC_X86_REG_XMM25,
|
||||
UC_X86_REG_XMM26,
|
||||
UC_X86_REG_XMM27,
|
||||
UC_X86_REG_XMM28,
|
||||
UC_X86_REG_XMM29,
|
||||
UC_X86_REG_XMM30,
|
||||
UC_X86_REG_XMM31,
|
||||
UC_X86_REG_YMM0,
|
||||
UC_X86_REG_YMM1,
|
||||
UC_X86_REG_YMM2,
|
||||
UC_X86_REG_YMM3,
|
||||
UC_X86_REG_YMM4,
|
||||
UC_X86_REG_YMM5,
|
||||
UC_X86_REG_YMM6,
|
||||
UC_X86_REG_YMM7,
|
||||
UC_X86_REG_YMM8,
|
||||
UC_X86_REG_YMM9,
|
||||
UC_X86_REG_YMM10,
|
||||
UC_X86_REG_YMM11,
|
||||
UC_X86_REG_YMM12,
|
||||
UC_X86_REG_YMM13,
|
||||
UC_X86_REG_YMM14,
|
||||
UC_X86_REG_YMM15,
|
||||
UC_X86_REG_YMM16,
|
||||
UC_X86_REG_YMM17,
|
||||
UC_X86_REG_YMM18,
|
||||
UC_X86_REG_YMM19,
|
||||
UC_X86_REG_YMM20,
|
||||
UC_X86_REG_YMM21,
|
||||
UC_X86_REG_YMM22,
|
||||
UC_X86_REG_YMM23,
|
||||
UC_X86_REG_YMM24,
|
||||
UC_X86_REG_YMM25,
|
||||
UC_X86_REG_YMM26,
|
||||
UC_X86_REG_YMM27,
|
||||
UC_X86_REG_YMM28,
|
||||
UC_X86_REG_YMM29,
|
||||
UC_X86_REG_YMM30,
|
||||
UC_X86_REG_YMM31,
|
||||
UC_X86_REG_ZMM0,
|
||||
UC_X86_REG_ZMM1,
|
||||
UC_X86_REG_ZMM2,
|
||||
UC_X86_REG_ZMM3,
|
||||
UC_X86_REG_ZMM4,
|
||||
UC_X86_REG_ZMM5,
|
||||
UC_X86_REG_ZMM6,
|
||||
UC_X86_REG_ZMM7,
|
||||
UC_X86_REG_ZMM8,
|
||||
UC_X86_REG_ZMM9,
|
||||
UC_X86_REG_ZMM10,
|
||||
UC_X86_REG_ZMM11,
|
||||
UC_X86_REG_ZMM12,
|
||||
UC_X86_REG_ZMM13,
|
||||
UC_X86_REG_ZMM14,
|
||||
UC_X86_REG_ZMM15,
|
||||
UC_X86_REG_ZMM16,
|
||||
UC_X86_REG_ZMM17,
|
||||
UC_X86_REG_ZMM18,
|
||||
UC_X86_REG_ZMM19,
|
||||
UC_X86_REG_ZMM20,
|
||||
UC_X86_REG_ZMM21,
|
||||
UC_X86_REG_ZMM22,
|
||||
UC_X86_REG_ZMM23,
|
||||
UC_X86_REG_ZMM24,
|
||||
UC_X86_REG_ZMM25,
|
||||
UC_X86_REG_ZMM26,
|
||||
UC_X86_REG_ZMM27,
|
||||
UC_X86_REG_ZMM28,
|
||||
UC_X86_REG_ZMM29,
|
||||
UC_X86_REG_ZMM30,
|
||||
UC_X86_REG_ZMM31,
|
||||
UC_X86_REG_R8B,
|
||||
UC_X86_REG_R9B,
|
||||
UC_X86_REG_R10B,
|
||||
UC_X86_REG_R11B,
|
||||
UC_X86_REG_R12B,
|
||||
UC_X86_REG_R13B,
|
||||
UC_X86_REG_R14B,
|
||||
UC_X86_REG_R15B,
|
||||
UC_X86_REG_R8D,
|
||||
UC_X86_REG_R9D,
|
||||
UC_X86_REG_R10D,
|
||||
UC_X86_REG_R11D,
|
||||
UC_X86_REG_R12D,
|
||||
UC_X86_REG_R13D,
|
||||
UC_X86_REG_R14D,
|
||||
UC_X86_REG_R15D,
|
||||
UC_X86_REG_R8W,
|
||||
UC_X86_REG_R9W,
|
||||
UC_X86_REG_R10W,
|
||||
UC_X86_REG_R11W,
|
||||
UC_X86_REG_R12W,
|
||||
UC_X86_REG_R13W,
|
||||
UC_X86_REG_R14W,
|
||||
UC_X86_REG_R15W,
|
||||
UC_X86_REG_IDTR,
|
||||
UC_X86_REG_GDTR,
|
||||
UC_X86_REG_LDTR,
|
||||
UC_X86_REG_TR,
|
||||
UC_X86_REG_FPCW,
|
||||
UC_X86_REG_FPTAG,
|
||||
UC_X86_REG_MSR, // Model-Specific Register
|
||||
UC_X86_REG_MXCSR,
|
||||
UC_X86_REG_FS_BASE, // Base regs for x86_64
|
||||
UC_X86_REG_GS_BASE,
|
||||
UC_X86_REG_FLAGS,
|
||||
UC_X86_REG_RFLAGS,
|
||||
UC_X86_REG_ENDING // <-- mark the end of the list of registers
|
||||
UC_X86_REG_ENDING // <-- mark the end of the list of registers
|
||||
} uc_x86_reg;
|
||||
|
||||
//> X86 instructions
|
||||
|
Reference in New Issue
Block a user