Rizin
unix-like reverse engineering framework and cli tools
reg.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009-2020 pancake <pancake@nopcode.org>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #include <rz_list.h>
5 #include <rz_reg.h>
6 #include <rz_util.h>
7 
8 RZ_LIB_VERSION(rz_reg);
9 
10 static const char *types[RZ_REG_TYPE_LAST + 1] = {
11  "gpr", "drx", "fpu", "mmx", "xmm", "ymm", "flg", "seg", "sys", "sec", "vc", "vcc", "ctr", NULL
12 };
13 
14 // Take the 32bits name of a register, and return the 64 bit name of it.
15 // If there is no equivalent 64 bit register return NULL.
16 // SLOW
17 RZ_API const char *rz_reg_32_to_64(RzReg *reg, const char *rreg32) {
18  int i, j = -1;
20  RzRegItem *item;
21  for (i = 0; i < RZ_REG_TYPE_LAST; i++) {
22  rz_list_foreach (reg->regset[i].regs, iter, item) {
23  if (item->size == 32 && !rz_str_casecmp(rreg32, item->name)) {
24  j = item->offset;
25  break;
26  }
27  }
28  }
29  if (j != -1) {
30  for (i = 0; i < RZ_REG_TYPE_LAST; i++) {
31  rz_list_foreach (reg->regset[i].regs, iter, item) {
32  if (item->offset == j && item->size == 64) {
33  return item->name;
34  }
35  }
36  }
37  }
38  return NULL;
39 }
40 
41 // Take the 64 bits name of a register, and return the 32 bit name of it.
42 // If there is no equivalent 32 bit register return NULL.
43 // SLOW
44 RZ_API const char *rz_reg_64_to_32(RzReg *reg, const char *rreg64) {
45  int i, j = -1;
47  RzRegItem *item;
48  for (i = 0; i < RZ_REG_TYPE_LAST; i++) {
49  rz_list_foreach (reg->regset[i].regs, iter, item) {
50  if (item->size == 64 && !rz_str_casecmp(rreg64, item->name)) {
51  j = item->offset;
52  break;
53  }
54  }
55  }
56  if (j != -1) {
57  for (i = 0; i < RZ_REG_TYPE_LAST; i++) {
58  rz_list_foreach (reg->regset[i].regs, iter, item) {
59  if (item->offset == j && item->size == 32) {
60  return item->name;
61  }
62  }
63  }
64  }
65  return NULL;
66 }
67 
68 RZ_API const char *rz_reg_get_type(int idx) {
69  return (idx >= 0 && idx < RZ_REG_TYPE_LAST) ? types[idx] : NULL;
70 }
71 
72 RZ_API const char *rz_reg_get_name_by_type(RzReg *reg, const char *alias_name) {
73  const int n = rz_reg_get_name_idx(alias_name);
74  return (n != -1) ? rz_reg_get_name(reg, n) : NULL;
75 }
76 
83 RZ_API int rz_reg_type_by_name(const char *str) {
85  for (ut32 i = 0; i < RZ_REG_TYPE_LAST && types[i]; i++) {
86  if (!strcmp(types[i], str)) {
87  return i;
88  }
89  }
90  if (!strcmp(str, "all")) {
91  return RZ_REG_TYPE_ANY;
92  }
93  return -1;
94 }
95 
97  free(item->name);
98  free(item->flags);
99  free(item);
100 }
101 
102 RZ_API int rz_reg_get_name_idx(const char *type) {
104  if (type[0] && type[1] && !type[2])
105  switch (*type | (type[1] << 8)) {
106  /* flags */
107  case 'Z' + ('F' << 8): return RZ_REG_NAME_ZF;
108  case 'S' + ('F' << 8): return RZ_REG_NAME_SF;
109  case 'C' + ('F' << 8): return RZ_REG_NAME_CF;
110  case 'O' + ('F' << 8): return RZ_REG_NAME_OF;
111  /* gpr */
112  case 'P' + ('C' << 8): return RZ_REG_NAME_PC;
113  case 'S' + ('R' << 8): return RZ_REG_NAME_SR;
114  case 'L' + ('R' << 8): return RZ_REG_NAME_LR;
115  case 'S' + ('P' << 8): return RZ_REG_NAME_SP;
116  case 'B' + ('P' << 8): return RZ_REG_NAME_BP;
117  case 'S' + ('N' << 8): return RZ_REG_NAME_SN;
118  /* args */
119  case 'A' + ('0' << 8): return RZ_REG_NAME_A0;
120  case 'A' + ('1' << 8): return RZ_REG_NAME_A1;
121  case 'A' + ('2' << 8): return RZ_REG_NAME_A2;
122  case 'A' + ('3' << 8): return RZ_REG_NAME_A3;
123  case 'A' + ('4' << 8): return RZ_REG_NAME_A4;
124  case 'A' + ('5' << 8): return RZ_REG_NAME_A5;
125  case 'A' + ('6' << 8): return RZ_REG_NAME_A6;
126  case 'A' + ('7' << 8): return RZ_REG_NAME_A7;
127  case 'A' + ('8' << 8): return RZ_REG_NAME_A8;
128  case 'A' + ('9' << 8): return RZ_REG_NAME_A9;
129  /* return values */
130  case 'R' + ('0' << 8): return RZ_REG_NAME_R0;
131  case 'R' + ('1' << 8): return RZ_REG_NAME_R1;
132  case 'R' + ('2' << 8): return RZ_REG_NAME_R2;
133  case 'R' + ('3' << 8): return RZ_REG_NAME_R3;
134  }
135  return -1;
136 }
137 
139  rz_return_val_if_fail(reg && name, false);
140  if (role >= 0 && role < RZ_REG_NAME_LAST) {
141  reg->name[role] = rz_str_dup(reg->name[role], name);
142  return true;
143  }
144  return false;
145 }
146 
147 RZ_API const char *rz_reg_get_name(RzReg *reg, int role) {
148  if (reg && role >= 0 && role < RZ_REG_NAME_LAST) {
149  return reg->name[role];
150  }
151  return NULL;
152 }
153 
156  const char *name = rz_reg_get_name(reg, role);
157  if (!name) {
158  return NULL;
159  }
161 }
162 
163 static const char *roles[RZ_REG_NAME_LAST + 1] = {
164  "PC", "SP", "SR", "BP", "LR",
165  "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9",
166  "R0", "R1", "R2", "R3",
167  "ZF", "SF", "CF", "OF",
168  "SN",
169  NULL
170 };
171 
172 RZ_API const char *rz_reg_get_role(int role) {
173  if (role >= 0 && role < RZ_REG_NAME_LAST) {
174  return roles[role];
175  }
176  return NULL;
177 }
178 
182  int i;
183  for (i = 0; i < RZ_REG_NAME_LAST && roles[i]; i++) {
184  if (!strcmp(roles[i], str)) {
185  return i;
186  }
187  }
188  return -1;
189 }
190 
193  ut32 i;
194 
195  rz_list_free(reg->roregs);
196  reg->roregs = NULL;
197  RZ_FREE(reg->reg_profile_str);
198  RZ_FREE(reg->reg_profile_cmt);
199  rz_list_free(reg->reg_profile.alias);
200  rz_list_free(reg->reg_profile.defs);
201  reg->reg_profile.alias = 0;
202  reg->reg_profile.defs = 0;
203 
204  for (i = 0; i < RZ_REG_NAME_LAST; i++) {
205  if (reg->name[i]) {
206  RZ_FREE(reg->name[i]);
207  }
208  }
209  for (i = 0; i < RZ_REG_TYPE_LAST; i++) {
210  ht_pp_free(reg->regset[i].ht_regs);
211  reg->regset[i].ht_regs = NULL;
212  if (!reg->regset[i].pool) {
213  continue;
214  }
215  if (init) {
216  rz_list_free(reg->regset[i].regs);
217  reg->regset[i].regs = rz_list_newf((RzListFree)rz_reg_item_free);
218  } else {
219  rz_list_free(reg->regset[i].regs);
220  reg->regset[i].regs = NULL;
221  // Ensure arena is freed and its registered in the pool
222  if (!rz_list_delete_data(reg->regset[i].pool, reg->regset[i].arena)) {
223  rz_reg_arena_free(reg->regset[i].arena);
224  }
225  reg->regset[i].arena = NULL;
226  rz_list_free(reg->regset[i].pool);
227  reg->regset[i].pool = NULL;
228  }
229  }
230  if (!init) {
231  rz_list_free(reg->allregs);
232  reg->allregs = NULL;
233  }
234  reg->size = 0;
235 }
236 
237 static int regcmp(RzRegItem *a, RzRegItem *b) {
238  int offa = (a->offset * 16) + a->size;
239  int offb = (b->offset * 16) + b->size;
240  return (offa > offb) - (offa < offb);
241 }
242 
244  int i, index;
245  RzListIter *iter;
246  RzRegItem *r;
248  for (i = 0; i < RZ_REG_TYPE_LAST; i++) {
249  rz_list_foreach (reg->regset[i].regs, iter, r) {
250  rz_list_append(all, r);
251  }
252  }
254  index = 0;
255  rz_list_foreach (all, iter, r) {
256  r->index = index++;
257  }
258  rz_list_free(reg->allregs);
259  reg->allregs = all;
260 }
261 
263  RzRegItem *r;
264  RzListIter *iter;
265  if (idx < 0) {
266  return NULL;
267  }
268  if (!reg->allregs) {
270  }
271  rz_list_foreach (reg->allregs, iter, r) {
272  if (r->index == idx) {
273  return r;
274  }
275  }
276  return NULL;
277 }
278 
280  if (reg) {
281  rz_reg_free_internal(reg, false);
282  free(reg);
283  }
284 }
285 
287  RzRegArena *arena;
288  RzReg *reg = RZ_NEW0(RzReg);
289  int i;
290  if (!reg) {
291  return NULL;
292  }
293  for (i = 0; i < RZ_REG_TYPE_LAST; i++) {
294  arena = rz_reg_arena_new(0);
295  if (!arena) {
296  free(reg);
297  return NULL;
298  }
299  reg->regset[i].pool = rz_list_newf((RzListFree)rz_reg_arena_free);
300  reg->regset[i].regs = rz_list_newf((RzListFree)rz_reg_item_free);
301  rz_list_push(reg->regset[i].pool, arena);
302  reg->regset[i].arena = arena;
303  }
305  for (i = 0; i < RZ_REG_TYPE_LAST; i++) {
306  reg->regset[i].cur = rz_list_tail(reg->regset[i].pool);
307  }
308  return reg;
309 }
310 
312  const char *name;
313  RzListIter *iter;
314  if (!reg->roregs) {
315  return false;
316  }
317  // XXX O(n)
318  rz_list_foreach (reg->roregs, iter, name) {
319  if (!strcmp(item->name, name)) {
320  return true;
321  }
322  }
323  return false;
324 }
325 
328  RzRegItem *ri = rz_reg_get(reg, name, -1);
329  return ri ? rz_reg_set_value(reg, ri, val) : UT64_MAX;
330 }
331 
334  RzRegItem *ri = rz_reg_get(reg, name, -1);
335  return ri ? rz_reg_get_value(reg, ri) : UT64_MAX;
336 }
337 
341  return ri ? rz_reg_get_value(reg, ri) : UT64_MAX;
342 }
343 
344 RZ_API RzRegItem *rz_reg_get(RzReg *reg, const char *name, int type) {
345  int i, e;
347  // TODO: define flag register as RZ_REG_TYPE_FLG
348  if (type == RZ_REG_TYPE_FLG) {
350  }
351  if (type == -1) {
352  i = 0;
354  int alias = rz_reg_get_name_idx(name);
355  if (alias != -1) {
356  const char *nname = rz_reg_get_name(reg, alias);
357  if (nname) {
358  name = nname;
359  }
360  }
361  } else {
362  i = type;
363  e = type + 1;
364  }
365  for (; i < e; i++) {
366  HtPP *pp = reg->regset[i].ht_regs;
367  if (pp) {
368  bool found = false;
369  RzRegItem *item = ht_pp_find(pp, name, &found);
370  if (found) {
371  return item;
372  }
373  }
374  }
375  return NULL;
376 }
377 
379  int role = rz_reg_get_name_idx(name);
380  if (role != -1) {
381  RzRegItem *r = rz_reg_get_by_role(reg, role);
382  if (r) {
383  return r;
384  }
385  }
387 }
388 
389 RZ_API const RzList /*<RzRegItem *>*/ *rz_reg_get_list(RzReg *reg, int type) {
390  if (type == RZ_REG_TYPE_ANY) {
391  return reg->allregs;
392  }
393 
394  RzList *regs;
395  int i, mask;
396  if (type < 0 || type > (RZ_REG_TYPE_LAST - 1)) {
397  return NULL;
398  }
399 
400  regs = reg->regset[type].regs;
401  if (rz_list_length(regs) == 0) {
402  mask = ((int)1 << type);
403  for (i = 0; i < RZ_REG_TYPE_LAST; i++) {
404  if (reg->regset[i].maskregstype & mask) {
405  regs = reg->regset[i].regs;
406  }
407  }
408  }
409 
410  return regs;
411 }
412 
413 // TODO regsize is in bits, delta in bytes, maybe we should standarize this..
414 RZ_API RzRegItem *rz_reg_get_at(RzReg *reg, int type, int regsize, int delta) {
416  const RzList *list = rz_reg_get_list(reg, type);
417  RzRegItem *ri;
418  RzListIter *iter;
419  rz_list_foreach (list, iter, ri) {
420  if (ri->size == regsize) {
421  if (BITS2BYTES(ri->offset) == delta) {
422  return ri;
423  }
424  }
425  }
426  return NULL;
427 }
428 
429 /* return the next register in the current regset that differs from */
430 RZ_API RzRegItem *rz_reg_next_diff(RzReg *reg, int type, const ut8 *buf, int buflen, RzRegItem *prev_ri, int regsize) {
432  if (type < 0 || type > (RZ_REG_TYPE_LAST - 1)) {
433  return NULL;
434  }
435  RzRegArena *arena = reg->regset[type].arena;
436  int prev_offset = prev_ri ? (prev_ri->offset / 8) + (prev_ri->size / 8) : 0;
437  RzList *list = reg->regset[type].regs;
438  RzRegItem *ri;
439  RzListIter *iter;
440  int offset;
441  rz_list_foreach (list, iter, ri) {
442  offset = ri->offset / 8;
443  if (offset > prev_offset) {
444  if (memcmp(arena->bytes + offset, buf + offset, ri->size / 8)) {
445  return ri;
446  }
447  }
448  }
449  return NULL;
450 }
451 
454  if (type < 0 || type >= RZ_REG_TYPE_LAST) {
455  return NULL;
456  }
457  RzRegSet *rs = &r->regset[type];
458  return rs->arena ? rs : NULL;
459 }
460 
461 static bool foreach_reg_cb(RzIntervalNode *node, void *user) {
462  RzRegItem *from_list = user;
463  RzRegItem *from_tree = node->data;
464  if (from_list == from_tree) {
465  return true;
466  }
467  // Check if from_list is covered entirely by from_tree, but is also smaller than it.
468  // We already know that
469  // from_tree->offset <= from_list->offset < from_tree->offset + from_tree->size
470  if (from_list->offset + from_list->size > from_tree->offset + from_tree->size) {
471  // from_list expands beyond from_tree, so it's not covered
472  return true;
473  }
474  if (from_list->offset + from_list->size == from_tree->offset + from_tree->size) {
475  // they end at the same position, so it is covered entirely, but is it also smaller?
476  if (from_list->offset == from_tree->offset) {
477  // nope
478  return true;
479  }
480  }
481  // from_list ends before from_tree, so it is covered and smaller
482  return false;
483 }
484 
489 RZ_API RZ_OWN RzList /*<RzRegItem *>*/ *rz_reg_filter_items_covered(RZ_BORROW RZ_NONNULL const RzList /*<RzRegItem *>*/ *regs) {
491  RzList *ret = rz_list_new();
492  if (!ret) {
493  return NULL;
494  }
495  RzIntervalTree t;
497  RzRegItem *item;
498  RzListIter *it;
499  rz_list_foreach (regs, it, item) {
500  if (item->offset < 0 || item->size <= 0) {
501  continue;
502  }
503  rz_interval_tree_insert(&t, item->offset, item->offset + item->size - 1, item);
504  }
505  rz_list_foreach (regs, it, item) {
506  if (item->offset < 0 || item->size <= 0) {
507  rz_list_push(ret, item);
508  continue;
509  }
510  if (!rz_interval_tree_all_in(&t, item->offset, true, foreach_reg_cb, item)) {
511  // foreach_reg_cb break-ed so it found a cover
512  continue;
513  }
514  rz_list_push(ret, item);
515  }
517  return ret;
518 }
#define e(frag)
#define rs()
#define mask()
static char * regs[]
Definition: analysis_sh.c:203
lzma_index ** i
Definition: index.h:629
RZ_API int rz_reg_arena_push(RzReg *reg)
Definition: arena.c:236
RZ_API RzRegArena * rz_reg_arena_new(size_t size)
Definition: arena.c:170
RZ_API void rz_reg_arena_free(RzRegArena *ra)
Definition: arena.c:189
ut16 val
Definition: armass64_const.h:6
#define RZ_API
#define NULL
Definition: cris-opc.c:27
#define r
Definition: crypto_rc6.c:12
uint32_t ut32
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
RZ_API const KEY_TYPE bool * found
Definition: ht_inc.h:130
voidpf uLong offset
Definition: ioapi.h:144
voidpf void * buf
Definition: ioapi.h:138
#define reg(n)
uint8_t ut8
Definition: lh5801.h:11
static void list(RzEgg *egg)
Definition: rz-gg.c:52
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
Definition: list.c:248
RZ_API bool rz_list_delete_data(RZ_NONNULL RzList *list, void *ptr)
Deletes an entry in the list by searching for a pointer.
Definition: list.c:148
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
Definition: list.c:235
RZ_API void rz_list_sort(RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
Sorts via merge sort or via insertion sort a list.
Definition: list.c:743
RZ_API RZ_BORROW RzListIter * rz_list_push(RZ_NONNULL RzList *list, void *item)
Alias for rz_list_append.
Definition: list.c:60
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
Definition: list.c:109
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
Definition: list.c:288
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
Definition: list.c:137
int n
Definition: mipsasm.c:19
int type
Definition: mipsasm.c:17
int idx
Definition: setup.py:197
const char * name
Definition: op.c:541
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
static const char * roles[RZ_REG_NAME_LAST+1]
Definition: reg.c:163
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
static const char * types[RZ_REG_TYPE_LAST+1]
Definition: reg.c:10
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_LIB_VERSION(rz_reg)
static bool foreach_reg_cb(RzIntervalNode *node, void *user)
Definition: reg.c:461
RZ_API bool rz_reg_set_name(RZ_NONNULL RzReg *reg, RzRegisterId role, RZ_NONNULL const char *name)
Definition: reg.c:138
static int regcmp(RzRegItem *a, RzRegItem *b)
Definition: reg.c:237
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(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
#define rz_return_if_fail(expr)
Definition: rz_assert.h:100
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
RZ_API bool rz_interval_tree_all_in(RzIntervalTree *tree, ut64 value, bool end_inclusive, RzIntervalIterCb cb, void *user)
Definition: intervaltree.c:262
RZ_API void rz_interval_tree_init(RzIntervalTree *tree, RzIntervalNodeFree free)
Definition: intervaltree.c:101
RZ_API bool rz_interval_tree_insert(RzIntervalTree *tree, ut64 start, ut64 end, void *data)
Definition: intervaltree.c:121
RZ_API void rz_interval_tree_fini(RzIntervalTree *tree)
Definition: intervaltree.c:114
void(* RzListFree)(void *ptr)
Definition: rz_list.h:11
int(* RzListComparator)(const void *value, const void *list_data)
Definition: rz_list.h:33
@ RZ_REG_TYPE_GPR
Definition: rz_reg.h:21
@ RZ_REG_TYPE_LAST
Definition: rz_reg.h:34
@ RZ_REG_TYPE_FLG
Definition: rz_reg.h:27
@ RZ_REG_TYPE_ANY
Definition: rz_reg.h:35
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
RZ_API int rz_str_casecmp(const char *dst, const char *orig)
Definition: str.c:121
RZ_API char * rz_str_dup(char *ptr, const char *string)
Definition: str.c:1021
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NEW0(x)
Definition: rz_types.h:284
#define RZ_NONNULL
Definition: rz_types.h:64
#define BITS2BYTES(x)
Definition: rz_types.h:280
#define RZ_FREE(x)
Definition: rz_types.h:369
#define RZ_BORROW
Definition: rz_types.h:63
#define UT64_MAX
Definition: rz_types_base.h:86
static int
Definition: sfsocketcall.h:114
#define b(i)
Definition: sha256.c:42
#define a(i)
Definition: sha256.c:41
Definition: z80asm.h:102
ut8 * bytes
Definition: rz_reg.h:131
int size
in bits> 8,16,32,64 ... 128/256
Definition: rz_reg.h:120
char * flags
Definition: rz_reg.h:124
int offset
Offset into register profile in bits.
Definition: rz_reg.h:121
char * name
Definition: rz_reg.h:118
bool init
Definition: core.c:77
ut64 buflen
Definition: core.c:76
static st64 delta
Definition: vmenus.c:2425
ut64(WINAPI *w32_GetEnabledXStateFeatures)()