Rizin
unix-like reverse engineering framework and cli tools
rz_reg.h
Go to the documentation of this file.
1 #ifndef RZ_REG_H
2 #define RZ_REG_H
3 
4 #include <rz_types.h>
5 #include <rz_list.h>
6 #include <rz_util/rz_hex.h>
7 #include <rz_util/rz_bitvector.h>
8 #include <rz_util/rz_assert.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
15 
16 /*
17  * various CPUs have registers within various types/classes
18  * this enum aims to cover them all.
19  */
20 typedef enum {
21  RZ_REG_TYPE_GPR, //< General purpose
23  RZ_REG_TYPE_FPU, //< Floating point
29  RZ_REG_TYPE_SYS, //< System
31  RZ_REG_TYPE_VC, //< Vector
32  RZ_REG_TYPE_VCC, //< Vector control
33  RZ_REG_TYPE_CTR, //< Control
35  RZ_REG_TYPE_ANY = -1
37 
38 /*
39  * pretty much all CPUs share some common registers
40  * this enum aims to create an abstraction to ease cross-arch handling.
41  */
42 typedef enum {
43  RZ_REG_NAME_PC, // program counter
44  RZ_REG_NAME_SP, // stack pointer
45  RZ_REG_NAME_SR, // status register
46  RZ_REG_NAME_BP, // base pointer
47  RZ_REG_NAME_LR, // link register
48  /* args */
49  RZ_REG_NAME_A0, // arguments
59  /* retval */
60  RZ_REG_NAME_R0, // return registers
64  /* flags */
69  /* syscall number (orig_eax,rax,r0,x0) */
72 } RzRegisterId;
73 
74 // TODO: use enum here?
75 #define RZ_REG_COND_EQ 0
76 #define RZ_REG_COND_NE 1
77 #define RZ_REG_COND_CF 2
78 #define RZ_REG_COND_CARRY 2
79 #define RZ_REG_COND_NEG 3
80 #define RZ_REG_COND_NEGATIVE 3
81 #define RZ_REG_COND_OF 4
82 #define RZ_REG_COND_OVERFLOW 4
83 // unsigned
84 #define RZ_REG_COND_HI 5
85 #define RZ_REG_COND_HE 6
86 #define RZ_REG_COND_LO 7
87 #define RZ_REG_COND_LOE 8
88 // signed
89 #define RZ_REG_COND_GE 9
90 #define RZ_REG_COND_GT 10
91 #define RZ_REG_COND_LT 11
92 #define RZ_REG_COND_LE 12
93 #define RZ_REG_COND_LAST 13
94 
95 typedef struct {
97  char *alias;
98  char *reg_name;
100 
101 typedef struct {
104  char *name;
108  char *comment;
109  char *flags;
111 
112 typedef struct {
113  RzList /* RzRegProfileAlias */ *alias;
114  RzList /* RzRegProfileDef */ *defs;
115 } RzRegProfile;
116 
117 typedef struct rz_reg_item_t {
118  char *name;
120  int size;
121  int offset;
123  bool is_float;
124  char *flags;
125  char *comment;
126  int index;
127  int arena;
129 
130 typedef struct rz_reg_arena_t {
132  int size;
134 
135 typedef struct rz_reg_set_t {
139  HtPP *ht_regs;
143 
144 typedef struct rz_reg_t {
145  char *profile;
149  char *name[RZ_REG_NAME_LAST]; // aliases
151  RzList /*<RzRegItem *>*/ *allregs;
152  RzList /*<char *>*/ *roregs;
153  int iters;
154  int arch;
155  int bits;
156  int size;
157  bool is_thumb;
160 
161 typedef struct rz_reg_flags_t {
162  bool s; // sign, negative number (msb)
163  bool z; // zero
164  bool a; // half-carry adjust (if carry happens at nibble level)
165  bool c; // carry
166  bool o; // overflow
167  bool p; // parity (lsb)
169 
170 #ifdef RZ_API
171 RZ_API void rz_reg_free(RzReg *reg);
173 RZ_API RzReg *rz_reg_new(void);
175 RZ_API bool rz_reg_set_profile_string(RZ_NONNULL RzReg *reg, RZ_NONNULL const char *profile);
178 RZ_API bool rz_reg_set_profile(RzReg *reg, const char *profile);
179 RZ_API char *rz_reg_parse_gdb_profile(const char *profile);
181 
183 RZ_API ut64 rz_reg_getv(RzReg *reg, const char *name);
185 RZ_API ut64 rz_reg_setv(RzReg *reg, const char *name, ut64 val);
186 RZ_API const char *rz_reg_32_to_64(RzReg *reg, const char *rreg32);
187 RZ_API const char *rz_reg_64_to_32(RzReg *reg, const char *rreg64);
188 RZ_API const char *rz_reg_get_name_by_type(RzReg *reg, const char *name);
189 RZ_API const char *rz_reg_get_type(int idx);
190 RZ_API const char *rz_reg_get_name(RzReg *reg, int kind);
192 RZ_API const char *rz_reg_get_role(int role);
193 RZ_API int rz_reg_role_by_name(RZ_NONNULL const char *str);
194 RZ_API RzRegItem *rz_reg_get(RzReg *reg, const char *name, int type);
196 RZ_API const RzList /*<RzRegItem *>*/ *rz_reg_get_list(RzReg *reg, int type);
197 RZ_API RzRegItem *rz_reg_get_at(RzReg *reg, int type, int regsize, int delta);
198 RZ_API RzRegItem *rz_reg_next_diff(RzReg *reg, int type, const ut8 *buf, int buflen, RzRegItem *prev_ri, int regsize);
199 
202 
203 /* Item */
204 RZ_API void rz_reg_item_free(RzRegItem *item);
205 
206 /* XXX: dupped ?? */
207 RZ_API int rz_reg_type_by_name(const char *str);
208 RZ_API int rz_reg_get_name_idx(const char *type);
209 
210 RZ_API RzRegItem *rz_reg_cond_get(RzReg *reg, const char *name);
212 RZ_API bool rz_reg_cond_set(RzReg *reg, const char *name, bool val);
213 RZ_API int rz_reg_cond_get_value(RzReg *r, const char *name);
214 RZ_API bool rz_reg_cond_bits_set(RzReg *r, int type, RzRegFlags *f, bool v);
217 RZ_API int rz_reg_cond(RzReg *r, int type);
218 
219 /* bitvector, for everything */
222 
223 /* integer value 8-64 bits */
229 
230 /* float */
231 RZ_API float rz_reg_get_float(RzReg *reg, RzRegItem *item);
232 RZ_API bool rz_reg_set_float(RzReg *reg, RzRegItem *item, float value);
233 
234 /* double */
235 RZ_API double rz_reg_get_double(RzReg *reg, RzRegItem *item);
236 RZ_API bool rz_reg_set_double(RzReg *reg, RzRegItem *item, double value);
237 
238 /* long double */
239 RZ_API long double rz_reg_get_longdouble(RzReg *reg, RzRegItem *item);
240 RZ_API bool rz_reg_set_longdouble(RzReg *reg, RzRegItem *item, long double value);
241 
242 /* boolean */
244 RZ_API ut64 rz_reg_set_bvalue(RzReg *reg, RzRegItem *item, const char *str);
245 
246 /* packed registers */
247 RZ_API int rz_reg_set_pack(RzReg *reg, RzRegItem *item, int packidx, int packbits, ut64 val);
248 RZ_API ut64 rz_reg_get_pack(RzReg *reg, RzRegItem *item, int packidx, int packbits);
249 
250 /* byte arena */
252 RZ_API bool rz_reg_set_bytes(RzReg *reg, int type, const ut8 *buf, const int len);
253 RZ_API bool rz_reg_read_regs(RzReg *reg, ut8 *buf, const int len);
254 RZ_API int rz_reg_arena_set_bytes(RzReg *reg, const char *str);
258 RZ_API void rz_reg_arena_swap(RzReg *reg, int copy);
262 
264 RZ_API void rz_reg_arena_poke(RzReg *reg, const ut8 *buf);
266 RZ_API const char *rz_reg_cond_to_string(int n);
267 RZ_API int rz_reg_cond_from_string(const char *str);
269 
270 RZ_API RZ_OWN RzList /*<RzRegItem *>*/ *rz_reg_filter_items_covered(RZ_BORROW RZ_NONNULL const RzList /*<RzRegItem *>*/ *regs);
271 
272 #ifdef __cplusplus
273 }
274 #endif
275 
276 #endif
277 #endif
size_t len
Definition: 6502dis.c:15
static char * regs[]
Definition: analysis_sh.c:203
RZ_API bool rz_reg_set_bytes(RzReg *reg, int type, const ut8 *buf, const int len)
Definition: arena.c:92
RZ_API ut8 * rz_reg_arena_dup(RzReg *reg, const ut8 *source)
Definition: arena.c:301
RZ_API bool rz_reg_read_regs(RzReg *reg, ut8 *buf, const int len)
Definition: arena.c:58
RZ_API int rz_reg_fit_arena(RzReg *reg)
Definition: arena.c:135
RZ_API ut8 * rz_reg_arena_peek(RzReg *reg)
Definition: arena.c:280
RZ_API int rz_reg_arena_push(RzReg *reg)
Definition: arena.c:236
RZ_API ut8 * rz_reg_get_bytes(RzReg *reg, int type, int *size)
Definition: arena.c:8
RZ_API void rz_reg_arena_pop(RzReg *reg)
Definition: arena.c:216
RZ_API void rz_reg_arena_shrink(RzReg *reg)
Definition: arena.c:345
RZ_API void rz_reg_arena_zero(RzReg *reg, RzRegisterType type)
Definition: arena.c:261
RZ_API void rz_reg_arena_swap(RzReg *reg, int copy)
Definition: arena.c:196
RZ_API RzRegArena * rz_reg_arena_new(size_t size)
Definition: arena.c:170
RZ_API void rz_reg_arena_poke(RzReg *reg, const ut8 *ret)
Definition: arena.c:293
RZ_API void rz_reg_arena_free(RzRegArena *ra)
Definition: arena.c:189
RZ_API int rz_reg_arena_set_bytes(RzReg *reg, const char *str)
Definition: arena.c:314
ut16 val
Definition: armass64_const.h:6
static int value
Definition: cmd_api.c:93
#define RZ_API
#define r
Definition: crypto_rc6.c:12
uint32_t ut32
RZ_API bool rz_reg_set_longdouble(RzReg *reg, RzRegItem *item, long double value)
Definition: double.c:94
RZ_API bool rz_reg_set_double(RzReg *reg, RzRegItem *item, double value)
Definition: double.c:40
RZ_API long double rz_reg_get_longdouble(RzReg *reg, RzRegItem *item)
Definition: double.c:67
RZ_API float rz_reg_get_float(RzReg *reg, RzRegItem *item)
Definition: double.c:124
RZ_API bool rz_reg_set_float(RzReg *reg, RzRegItem *item, float value)
Definition: double.c:129
RZ_API double rz_reg_get_double(RzReg *reg, RzRegItem *item)
Definition: double.c:16
const char * v
Definition: dsignal.c:12
voidpf void uLong size
Definition: ioapi.h:138
voidpf void * buf
Definition: ioapi.h:138
#define reg(n)
uint8_t ut8
Definition: lh5801.h:11
const char * source
Definition: lz4.h:699
int n
Definition: mipsasm.c:19
int type
Definition: mipsasm.c:17
int idx
Definition: setup.py:197
RZ_API bool rz_reg_set_profile_string(RZ_NONNULL RzReg *reg, RZ_NONNULL const char *profile_str)
Parses a register profile string and sets up all registers accordingly in reg.
Definition: profile.c:431
RZ_API bool rz_reg_set_reg_profile(RZ_BORROW RzReg *reg)
Fills reg->regset with the definitions and alias of the register profile.
Definition: profile.c:376
RZ_API char * rz_reg_parse_gdb_profile(const char *profile_file)
Definition: profile.c:631
RZ_API bool rz_reg_set_profile(RzReg *reg, const char *profile)
Definition: profile.c:486
RZ_API char * rz_reg_profile_to_cc(RzReg *reg)
Definition: profile.c:652
RZ_API bool rz_reg_cond_set(RzReg *r, const char *name, bool val)
Definition: rcond.c:39
RZ_API bool rz_reg_cond_bits_set(RzReg *r, int type, RzRegFlags *f, bool v)
Definition: rcond.c:125
RZ_API int rz_reg_cond_bits(RzReg *r, int type, RzRegFlags *f)
Definition: rcond.c:102
RZ_API void rz_reg_cond_apply(RzReg *r, RzRegFlags *f)
Definition: rcond.c:234
RZ_API int rz_reg_cond_from_string(const char *str)
Definition: rcond.c:59
RZ_API int rz_reg_cond_get_value(RzReg *r, const char *name)
Definition: rcond.c:31
RZ_API RzRegFlags * rz_reg_cond_retrieve(RzReg *r, RzRegFlags *f)
Definition: rcond.c:219
RZ_API RzRegItem * rz_reg_cond_get(RzReg *reg, const char *name)
Definition: rcond.c:17
RZ_API const char * rz_reg_cond_to_string(int n)
Definition: rcond.c:48
RZ_API int rz_reg_cond(RzReg *r, int type)
Definition: rcond.c:213
RZ_API void rz_reg_reindex(RzReg *reg)
Definition: reg.c:243
RZ_API ut64 rz_reg_getv(RzReg *reg, const char *name)
Definition: reg.c:332
RZ_API RzRegItem * rz_reg_get_at(RzReg *reg, int type, int regsize, int delta)
Definition: reg.c:414
RZ_API RzRegItem * rz_reg_get(RzReg *reg, const char *name, int type)
Definition: reg.c:344
RZ_API const char * rz_reg_64_to_32(RzReg *reg, const char *rreg64)
Definition: reg.c:44
RZ_API const char * rz_reg_get_name_by_type(RzReg *reg, const char *alias_name)
Definition: reg.c:72
RZ_API const char * rz_reg_get_name(RzReg *reg, int role)
Definition: reg.c:147
RZ_API int rz_reg_get_name_idx(const char *type)
Definition: reg.c:102
RZ_API RzRegItem * rz_reg_get_by_role(RzReg *reg, RzRegisterId role)
Definition: reg.c:154
RZ_API bool rz_reg_is_readonly(RzReg *reg, RzRegItem *item)
Definition: reg.c:311
RZ_API void rz_reg_free(RzReg *reg)
Definition: reg.c:279
RZ_API int rz_reg_role_by_name(RZ_NONNULL const char *str)
Get the RzRegisterId with the given name or -1.
Definition: reg.c:180
RZ_API RzRegItem * rz_reg_index_get(RzReg *reg, int idx)
Definition: reg.c:262
RZ_API RzReg * rz_reg_new(void)
Definition: reg.c:286
RZ_API ut64 rz_reg_setv(RzReg *reg, const char *name, ut64 val)
Definition: reg.c:326
RZ_API RzRegItem * rz_reg_get_by_role_or_name(RzReg *reg, const char *name)
Definition: reg.c:378
RZ_API RzRegSet * rz_reg_regset_get(RzReg *r, int type)
Definition: reg.c:452
RZ_API int rz_reg_type_by_name(const char *str)
Returns the register type for the given type abbreviation.
Definition: reg.c:83
RZ_API void rz_reg_free_internal(RzReg *reg, bool init)
Definition: reg.c:191
RZ_API const char * rz_reg_get_type(int idx)
Definition: reg.c:68
RZ_API void rz_reg_item_free(RzRegItem *item)
Definition: reg.c:96
RZ_API const RzList * rz_reg_get_list(RzReg *reg, int type)
Definition: reg.c:389
RZ_API RzRegItem * rz_reg_next_diff(RzReg *reg, int type, const ut8 *buf, int buflen, RzRegItem *prev_ri, int regsize)
Definition: reg.c:430
RZ_API bool rz_reg_set_name(RZ_NONNULL RzReg *reg, RzRegisterId role, RZ_NONNULL const char *name)
Definition: reg.c:138
RZ_API const char * rz_reg_get_role(int role)
Definition: reg.c:172
RZ_API ut64 rz_reg_getv_by_role_or_name(RzReg *reg, const char *name)
Definition: reg.c:338
RZ_API RZ_OWN RzList * rz_reg_filter_items_covered(RZ_BORROW RZ_NONNULL const RzList *regs)
Filter out all register items that are smaller than but covered entirely by some other register.
Definition: reg.c:489
RZ_API const char * rz_reg_32_to_64(RzReg *reg, const char *rreg32)
Definition: reg.c:17
RZ_API bool rz_reg_set_value_by_role(RzReg *reg, RzRegisterId role, ut64 val)
Definition: rvalue.c:269
RZ_API bool rz_reg_set_bv(RZ_NONNULL RzReg *reg, RZ_NONNULL RzRegItem *item, RZ_NONNULL const RzBitVector *bv)
Definition: rvalue.c:26
RZ_API ut64 rz_reg_get_value_big(RzReg *reg, RzRegItem *item, utX *val)
Definition: rvalue.c:60
RZ_API ut64 rz_reg_set_bvalue(RzReg *reg, RzRegItem *item, const char *str)
Definition: rvalue.c:279
RZ_API int rz_reg_set_pack(RzReg *reg, RzRegItem *item, int packidx, int packbits, ut64 val)
Definition: rvalue.c:346
RZ_API ut64 rz_reg_get_pack(RzReg *reg, RzRegItem *item, int packidx, int packbits)
Definition: rvalue.c:308
RZ_API RzBitVector * rz_reg_get_bv(RZ_NONNULL RzReg *reg, RZ_NONNULL RzRegItem *item)
Definition: rvalue.c:11
RZ_API ut64 rz_reg_get_value_by_role(RzReg *reg, RzRegisterId role)
Definition: rvalue.c:181
RZ_API RZ_HEAP char * rz_reg_get_bvalue(RzReg *reg, RzRegItem *item)
Definition: rvalue.c:291
RZ_API bool rz_reg_set_value(RzReg *reg, RzRegItem *item, ut64 value)
Definition: rvalue.c:186
RZ_API ut64 rz_reg_get_value(RzReg *reg, RzRegItem *item)
Definition: rvalue.c:114
RzRegisterType
Definition: rz_reg.h:20
@ RZ_REG_TYPE_SEG
Definition: rz_reg.h:28
@ RZ_REG_TYPE_SYS
Definition: rz_reg.h:29
@ RZ_REG_TYPE_SEC
Definition: rz_reg.h:30
@ RZ_REG_TYPE_MMX
Definition: rz_reg.h:24
@ RZ_REG_TYPE_GPR
Definition: rz_reg.h:21
@ RZ_REG_TYPE_YMM
Definition: rz_reg.h:26
@ RZ_REG_TYPE_LAST
Definition: rz_reg.h:34
@ RZ_REG_TYPE_FLG
Definition: rz_reg.h:27
@ RZ_REG_TYPE_VC
Definition: rz_reg.h:31
@ RZ_REG_TYPE_VCC
Definition: rz_reg.h:32
@ RZ_REG_TYPE_ANY
Definition: rz_reg.h:35
@ RZ_REG_TYPE_FPU
Definition: rz_reg.h:23
@ RZ_REG_TYPE_DRX
Definition: rz_reg.h:22
@ RZ_REG_TYPE_CTR
Definition: rz_reg.h:33
@ RZ_REG_TYPE_XMM
Definition: rz_reg.h:25
struct rz_reg_item_t RzRegItem
struct rz_reg_flags_t RzRegFlags
RZ_LIB_VERSION_HEADER(rz_reg)
struct rz_reg_arena_t RzRegArena
struct rz_reg_set_t RzRegSet
struct rz_reg_t RzReg
RzRegisterId
Definition: rz_reg.h:42
@ RZ_REG_NAME_SP
Definition: rz_reg.h:44
@ RZ_REG_NAME_A4
Definition: rz_reg.h:53
@ RZ_REG_NAME_SN
Definition: rz_reg.h:70
@ RZ_REG_NAME_A9
Definition: rz_reg.h:58
@ RZ_REG_NAME_A5
Definition: rz_reg.h:54
@ RZ_REG_NAME_A6
Definition: rz_reg.h:55
@ RZ_REG_NAME_A3
Definition: rz_reg.h:52
@ RZ_REG_NAME_A2
Definition: rz_reg.h:51
@ RZ_REG_NAME_BP
Definition: rz_reg.h:46
@ RZ_REG_NAME_ZF
Definition: rz_reg.h:65
@ RZ_REG_NAME_OF
Definition: rz_reg.h:68
@ RZ_REG_NAME_R2
Definition: rz_reg.h:62
@ RZ_REG_NAME_LAST
Definition: rz_reg.h:71
@ RZ_REG_NAME_PC
Definition: rz_reg.h:43
@ RZ_REG_NAME_R1
Definition: rz_reg.h:61
@ RZ_REG_NAME_A1
Definition: rz_reg.h:50
@ RZ_REG_NAME_CF
Definition: rz_reg.h:67
@ RZ_REG_NAME_SF
Definition: rz_reg.h:66
@ RZ_REG_NAME_A7
Definition: rz_reg.h:56
@ RZ_REG_NAME_SR
Definition: rz_reg.h:45
@ RZ_REG_NAME_LR
Definition: rz_reg.h:47
@ RZ_REG_NAME_A8
Definition: rz_reg.h:57
@ RZ_REG_NAME_A0
Definition: rz_reg.h:49
@ RZ_REG_NAME_R0
Definition: rz_reg.h:60
@ RZ_REG_NAME_R3
Definition: rz_reg.h:63
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NONNULL
Definition: rz_types.h:64
#define RZ_BORROW
Definition: rz_types.h:63
#define f(i)
Definition: sha256.c:46
RzRegisterId role
Register role (PC, Argument etc.)
Definition: rz_reg.h:96
char * reg_name
Real register name of alias.
Definition: rz_reg.h:98
char * alias
Alias of register.
Definition: rz_reg.h:97
ut32 size
Register size in bits.
Definition: rz_reg.h:105
char * comment
Comment about register.
Definition: rz_reg.h:108
char * name
Register name.
Definition: rz_reg.h:104
RzRegisterType arena_type
The arena the register belongs to (e.g. flags belong to gpr; xmm into fpu).
Definition: rz_reg.h:103
char * flags
String describing the flags of the register.
Definition: rz_reg.h:109
RzRegisterType type
Reg type.
Definition: rz_reg.h:102
ut32 packed
Packet size of register in tes.
Definition: rz_reg.h:106
ut32 offset
Offset into profile in bits.
Definition: rz_reg.h:107
RzList * alias
Definition: rz_reg.h:113
RzList * defs
Definition: rz_reg.h:114
structure for bitvector
Definition: rz_bitvector.h:19
Definition: z80asm.h:102
ut8 * bytes
Definition: rz_reg.h:131
RzRegisterType type
Register type.
Definition: rz_reg.h:119
int size
in bits> 8,16,32,64 ... 128/256
Definition: rz_reg.h:120
int index
Index in register profile.
Definition: rz_reg.h:126
int arena
In which arena is this reg living. Usually equals type.
Definition: rz_reg.h:127
char * flags
Definition: rz_reg.h:124
int packed_size
0 means no packed register, 1byte pack, 2b pack...
Definition: rz_reg.h:122
int offset
Offset into register profile in bits.
Definition: rz_reg.h:121
bool is_float
Flag for float registers.
Definition: rz_reg.h:123
char * comment
Comment to register.
Definition: rz_reg.h:125
char * name
Definition: rz_reg.h:118
ut32 maskregstype
which type of regs has this register set (logic mask with 1 << RZ_REG_TYPE_XXX)
Definition: rz_reg.h:141
RzList * regs
RzRegItem.
Definition: rz_reg.h:138
HtPP * ht_regs
name:RzRegItem
Definition: rz_reg.h:139
RzListIter * cur
Definition: rz_reg.h:140
RzList * pool
RzRegArena.
Definition: rz_reg.h:137
RzRegArena * arena
Definition: rz_reg.h:136
char * reg_profile_str
Definition: rz_reg.h:147
bool big_endian
Definition: rz_reg.h:158
int size
Definition: rz_reg.h:156
char * reg_profile_cmt
Definition: rz_reg.h:146
int bits
Definition: rz_reg.h:155
RzRegSet regset[RZ_REG_TYPE_LAST]
Definition: rz_reg.h:150
char * profile
Definition: rz_reg.h:145
int arch
Definition: rz_reg.h:154
RzList * roregs
Definition: rz_reg.h:152
RzList * allregs
Definition: rz_reg.h:151
bool is_thumb
Definition: rz_reg.h:157
RzRegProfile reg_profile
Definition: rz_reg.h:148
int iters
Definition: rz_reg.h:153
bool init
Definition: core.c:77
ut64 buflen
Definition: core.c:76
static st64 delta
Definition: vmenus.c:2425
ut64(WINAPI *w32_GetEnabledXStateFeatures)()