Rizin
unix-like reverse engineering framework and cli tools
parse_arm_pseudo.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2015-2018 pancake <pancake@nopcode.org>
2 // SPDX-FileCopyrightText: 2021 deroad <wargio@libero.it>
3 // SPDX-License-Identifier: LGPL-3.0-only
4 
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <rz_lib.h>
9 #include <rz_util.h>
10 #include <rz_flag.h>
11 #include <rz_analysis.h>
12 #include <rz_parse.h>
13 
14 #include "parse_common.c"
15 
16 static RzList *arm_tokenize(const char *assembly, size_t length);
17 
18 static const RzPseudoGrammar arm_lexicon[] = {
19  RZ_PSEUDO_DEFINE_GRAMMAR("abs", "1 = abs(1)"),
20  RZ_PSEUDO_DEFINE_GRAMMAR("adc", "1 = 2 + 3"),
21  RZ_PSEUDO_DEFINE_GRAMMAR("add", "1 = 2 + 3"),
22  RZ_PSEUDO_DEFINE_GRAMMAR("add.w", "1 = 2 + 3"),
23  RZ_PSEUDO_DEFINE_GRAMMAR("adds", "1 = 2 + 3"),
24  RZ_PSEUDO_DEFINE_GRAMMAR("addw", "1 = 2 + 3"),
25  RZ_PSEUDO_DEFINE_GRAMMAR("adf", "1 = 2 + 3"),
26  RZ_PSEUDO_DEFINE_GRAMMAR("adr", "1 = 2"),
27  RZ_PSEUDO_DEFINE_GRAMMAR("adrp", "1 = 2"),
28  RZ_PSEUDO_DEFINE_GRAMMAR("and", "1 = 2 & 3"),
29  RZ_PSEUDO_DEFINE_GRAMMAR("ands", "1 &= 2"),
30  RZ_PSEUDO_DEFINE_GRAMMAR("asl", "1 = 2 << 3"),
31  RZ_PSEUDO_DEFINE_GRAMMAR("asls", "1 = 2 << 3"),
32  RZ_PSEUDO_DEFINE_GRAMMAR("asr", "1 = 2 >> 3"),
33  RZ_PSEUDO_DEFINE_GRAMMAR("asrs", "1 = 2 >> 3"),
34  RZ_PSEUDO_DEFINE_GRAMMAR("b", "goto 1"),
35  RZ_PSEUDO_DEFINE_GRAMMAR("b.gt", "if (? > ?) goto 1"),
36  RZ_PSEUDO_DEFINE_GRAMMAR("b.le", "if (? < ?) goto 1"),
37  RZ_PSEUDO_DEFINE_GRAMMAR("b.w", "goto 1"),
38  RZ_PSEUDO_DEFINE_GRAMMAR("beq", "if (? == ?) goto 1"),
39  RZ_PSEUDO_DEFINE_GRAMMAR("bge", "if (? >= ?) goto 1"),
40  RZ_PSEUDO_DEFINE_GRAMMAR("bkpt", "breakpoint 1"),
41  RZ_PSEUDO_DEFINE_GRAMMAR("bl", "1 ()"),
42  RZ_PSEUDO_DEFINE_GRAMMAR("blx", "1 ()"),
43  RZ_PSEUDO_DEFINE_GRAMMAR("bxeq", "if (? == ?) goto 1"),
44  RZ_PSEUDO_DEFINE_GRAMMAR("call", "1 ()"),
45  RZ_PSEUDO_DEFINE_GRAMMAR("cbnz", "if (1) goto 2"),
46  RZ_PSEUDO_DEFINE_GRAMMAR("cbz", "if (!1) goto 2"),
47  RZ_PSEUDO_DEFINE_GRAMMAR("cmf", "if (1 == 2)"),
48  RZ_PSEUDO_DEFINE_GRAMMAR("cmn", "if (1 != 2)"),
49  RZ_PSEUDO_DEFINE_GRAMMAR("cmp", "if (1 == 2)"),
50  RZ_PSEUDO_DEFINE_GRAMMAR("div", "1 = 2 / 3"),
51  RZ_PSEUDO_DEFINE_GRAMMAR("dvf", "1 = 2 / 3"),
52  RZ_PSEUDO_DEFINE_GRAMMAR("eor", "1 = 2 ^ 3"),
53  RZ_PSEUDO_DEFINE_GRAMMAR("fcmp", "if (1 == 2)"),
54  RZ_PSEUDO_DEFINE_GRAMMAR("fdiv", "1 = 2 / 3"),
55  RZ_PSEUDO_DEFINE_GRAMMAR("fdv", "1 = 2 / 3"),
56  RZ_PSEUDO_DEFINE_GRAMMAR("fml", "1 = 2 * 3"),
57  RZ_PSEUDO_DEFINE_GRAMMAR("fmov", "1 = 2"),
58  RZ_PSEUDO_DEFINE_GRAMMAR("fmul", "1 = 2 * 3"),
59  RZ_PSEUDO_DEFINE_GRAMMAR("fsub", "1 = 2 - 3"),
60  RZ_PSEUDO_DEFINE_GRAMMAR("ldp", "(1, 2) = 3"),
61  RZ_PSEUDO_DEFINE_GRAMMAR("ldr", "1 = 2"),
62  RZ_PSEUDO_DEFINE_GRAMMAR("ldr.w", "1 = 2"),
63  RZ_PSEUDO_DEFINE_GRAMMAR("ldrb", "1 = (byte) 2 + 3"),
64  RZ_PSEUDO_DEFINE_GRAMMAR("ldrh", "1 = (word) 2 + 3"),
65  RZ_PSEUDO_DEFINE_GRAMMAR("ldrsb", "1 = (byte) 2 + 3"),
66  RZ_PSEUDO_DEFINE_GRAMMAR("ldrsw", "1 = 2 + 3"),
67  RZ_PSEUDO_DEFINE_GRAMMAR("ldrsw", "1 = 2"),
68  RZ_PSEUDO_DEFINE_GRAMMAR("lsl", "1 = 2 << 3"),
69  RZ_PSEUDO_DEFINE_GRAMMAR("lsls", "1 = 2 << 3"),
70  RZ_PSEUDO_DEFINE_GRAMMAR("lsr", "1 = 2 >> 3"),
71  RZ_PSEUDO_DEFINE_GRAMMAR("lsrs", "1 = 2 >> 3"),
72  RZ_PSEUDO_DEFINE_GRAMMAR("mov", "1 = 2"),
73  RZ_PSEUDO_DEFINE_GRAMMAR("movk", "1 = 2"),
74  RZ_PSEUDO_DEFINE_GRAMMAR("movn", "1 = ~2"),
75  RZ_PSEUDO_DEFINE_GRAMMAR("movz", "1 = 2"),
76  RZ_PSEUDO_DEFINE_GRAMMAR("muf", "1 = 2 * 3"),
77  RZ_PSEUDO_DEFINE_GRAMMAR("mul", "1 = 2 * 3"),
78  RZ_PSEUDO_DEFINE_GRAMMAR("muls", "1 = 2 * 3"),
79  RZ_PSEUDO_DEFINE_GRAMMAR("mvn", "1 = ~2"),
80  RZ_PSEUDO_DEFINE_GRAMMAR("neg", "1 = !2"),
81  RZ_PSEUDO_DEFINE_GRAMMAR("orr", "1 = 2 | 3"),
82  RZ_PSEUDO_DEFINE_GRAMMAR("rmf", "1 = 2 % 3"),
83  RZ_PSEUDO_DEFINE_GRAMMAR("sbc", "1 = 2 - 3"),
84  RZ_PSEUDO_DEFINE_GRAMMAR("sqt", "1 = sqrt(2)"),
85  RZ_PSEUDO_DEFINE_GRAMMAR("stp", "3 = (1, 2)"),
86  RZ_PSEUDO_DEFINE_GRAMMAR("str", "2 = 1"),
87  RZ_PSEUDO_DEFINE_GRAMMAR("strb", "2 = (byte) 1"),
88  RZ_PSEUDO_DEFINE_GRAMMAR("strh", "2 = (half) 1"),
89  RZ_PSEUDO_DEFINE_GRAMMAR("strh.w", "2 = (half) 1"),
90  RZ_PSEUDO_DEFINE_GRAMMAR("stur", "2 = 1"),
91  RZ_PSEUDO_DEFINE_GRAMMAR("sub", "1 = 2 - 3"),
92  RZ_PSEUDO_DEFINE_GRAMMAR("subs", "1 = 2 - 3"),
93  RZ_PSEUDO_DEFINE_GRAMMAR("swp", "swap(1, 2)"),
94  RZ_PSEUDO_DEFINE_GRAMMAR("sxtb", "1 = (char) 2"),
95  RZ_PSEUDO_DEFINE_GRAMMAR("sxth", "1 = (short) 2"),
96  RZ_PSEUDO_DEFINE_GRAMMAR("sxtw", "1 = 2"),
97  RZ_PSEUDO_DEFINE_GRAMMAR("tst", "if ((1 & 2) == 0)"),
98  RZ_PSEUDO_DEFINE_GRAMMAR("udf", "undefined 2"),
99  RZ_PSEUDO_DEFINE_GRAMMAR("udiv", "1 = (unsigned) 2 / 3"),
100  RZ_PSEUDO_DEFINE_GRAMMAR("vmov.i32", "1 = 2"),
101  /* arm thumb */
102  RZ_PSEUDO_DEFINE_GRAMMAR("lsl.w", "1 = 2 << 3"),
103  RZ_PSEUDO_DEFINE_GRAMMAR("lsr.w", "1 = 2 >> 3"),
104  RZ_PSEUDO_DEFINE_GRAMMAR("movs", "1 = 2"),
105  RZ_PSEUDO_DEFINE_GRAMMAR("movt", "1 |= 2 << #16"),
106  RZ_PSEUDO_DEFINE_GRAMMAR("movw", "1 = 2"),
107  RZ_PSEUDO_DEFINE_GRAMMAR("pop", "pop 1"),
108  RZ_PSEUDO_DEFINE_GRAMMAR("pop.w", "pop 1"),
109  RZ_PSEUDO_DEFINE_GRAMMAR("push", "push 1"),
110  RZ_PSEUDO_DEFINE_GRAMMAR("push.w", "push 1"),
111  RZ_PSEUDO_DEFINE_GRAMMAR("sub", "1 -= 2"), // THUMB
112  RZ_PSEUDO_DEFINE_GRAMMAR("sub.w", "1 = 2 - 3"),
113  RZ_PSEUDO_DEFINE_GRAMMAR("subs", "1 -= 2"), // THUMB
114  RZ_PSEUDO_DEFINE_GRAMMAR("tst.w", "if ((1 & 2) == 0)"),
115  RZ_PSEUDO_DEFINE_GRAMMAR("vdiv.f64", "1 = (float) 2 / 3"),
116  RZ_PSEUDO_DEFINE_GRAMMAR("vmov", "1 = (float) 2 . 3"),
117  RZ_PSEUDO_DEFINE_GRAMMAR("vpop", "pop(1)"),
118  RZ_PSEUDO_DEFINE_GRAMMAR("vpush", "push(1)"),
119 };
120 
121 static const RzPseudoDirect arm_direct[] = {
122  RZ_PSEUDO_DEFINE_DIRECT("beq lr", "if (? == ?) return"),
123  RZ_PSEUDO_DEFINE_DIRECT("bx lr", "return"),
124 };
125 
126 static const RzPseudoReplace arm_replace[] = {
127  RZ_PSEUDO_DEFINE_REPLACE(" + 0]", "]", 0),
128  RZ_PSEUDO_DEFINE_REPLACE("+ -", "- ", 1),
129  RZ_PSEUDO_DEFINE_REPLACE("0 << 16", "0", 1),
130  RZ_PSEUDO_DEFINE_REPLACE("{", "(", 1),
131  RZ_PSEUDO_DEFINE_REPLACE("}", ")", 1),
132 };
133 
135 
136 RzList *arm_tokenize(const char *assembly, size_t length) {
137  size_t i, p;
138  char *buf = NULL;
139  const char *comma_replace = NULL;
140  bool keep = false;
141  RzList *tokens = NULL;
142 
143  buf = rz_str_ndup(assembly, length);
144  if (!buf) {
145  return NULL;
146  }
147 
148  for (i = 0, p = 0; p < length; ++i, ++p) {
149  if (buf[p] == ',') {
150  if (!keep) {
151  p++;
152  } else if (buf[p + 1] == ' ') {
153  buf[i] = buf[p];
154  p++;
155  continue;
156  }
157  } else if (buf[p] == '(') {
158  buf[p] = ' ';
159  } else if (buf[p] == ')') {
160  buf[p] = ' ';
161  } else if (buf[p] == '[') {
162  keep = true;
163  comma_replace = " + ";
164  } else if (buf[p] == ']') {
165  keep = false;
166  } else if (buf[p] == '{') {
167  if (strchr(buf + p + 1, ',') < strchr(buf + p + 1, '}')) {
168  keep = true;
169  comma_replace = ", ";
170  } else {
171  p++;
172  }
173  } else if (buf[p] == '}') {
174  if (!comma_replace) {
175  p++;
176  }
177  keep = false;
178  } else if ((buf[p] == 'w' || buf[p] == 'x') && buf[p + 1] == 'z' && buf[p + 2] == 'r') {
179  p += 2;
180  buf[p] = '0';
181  }
182  if (p > i) {
183  buf[i] = buf[p];
184  }
185  }
186  buf[i] = 0;
187 
188  tokens = rz_str_split_duplist(buf, " ", true);
189  free(buf);
190  if (!tokens) {
191  return NULL;
192  }
193 
194  if (comma_replace) {
195  RzListIter *it;
196  rz_list_foreach (tokens, it, buf) {
197  it->data = rz_str_replace(buf, ",", comma_replace, 1);
198  }
199  }
200 
201  return tokens;
202 }
203 
204 static bool parse(RzParse *p, const char *assembly, RzStrBuf *sb) {
205  return rz_pseudo_convert(&arm_config, assembly, sb);
206 }
207 
208 static char *subs_var_string(RzParse *p, RzAnalysisVarField *var, char *tstr, const char *oldstr, const char *reg, int delta) {
209  char *newstr = p->localvar_only
210  ? rz_str_newf("%s", var->name)
211  : rz_str_newf("%s %c %s", reg, delta > 0 ? '+' : '-', var->name);
212  if (IS_UPPER(*tstr)) {
213  char *space = strrchr(newstr, ' ');
214  if (space) {
215  *space = 0;
216  rz_str_case(newstr, true);
217  *space = ' ';
218  }
219  }
220  char *ret = rz_str_replace(tstr, oldstr, newstr, 1);
221  free(newstr);
222  return ret;
223 }
224 
225 static char *mount_oldstr(RzParse *p, const char *reg, st64 delta, bool ucase) {
226  const char *tmplt;
227  char *oldstr;
228  if (delta > -10 && delta < 10) {
229  if (p->pseudo) {
230  char sign = '+';
231  if (delta < 0) {
232  sign = '-';
233  }
234  oldstr = rz_str_newf("%s %c %" PFMT64d, reg, sign, RZ_ABS(delta));
235  } else {
236  oldstr = rz_str_newf("%s, %" PFMT64d, reg, delta);
237  }
238  } else if (delta > 0) {
239  tmplt = p->pseudo ? "%s + 0x%x" : (ucase ? "%s, 0x%X" : "%s, 0x%x");
240  oldstr = rz_str_newf(tmplt, reg, delta);
241  } else {
242  tmplt = p->pseudo ? "%s - 0x%x" : (ucase ? "%s, -0x%X" : "%s, -0x%x");
243  oldstr = rz_str_newf(tmplt, reg, -delta);
244  }
245  if (ucase) {
246  char *comma = strchr(oldstr, ',');
247  if (comma) {
248  *comma = 0;
249  rz_str_case(oldstr, true);
250  *comma = ',';
251  }
252  }
253  return oldstr;
254 }
255 
256 static bool subvar(RzParse *p, RzAnalysisFunction *f, RzAnalysisOp *op, char *data, char *str, int len) {
257  const ut64 addr = op->addr;
258  const int oplen = op->size;
259  RzList *spargs = NULL;
260  RzList *bpargs = NULL;
261  RzListIter *iter;
262  RzAnalysis *analysis = p->analb.analysis;
263  char *oldstr;
264  char *tstr = strdup(data);
265  if (!tstr) {
266  return false;
267  }
268 
269  if (!p->varlist) {
270  free(tstr);
271  return false;
272  }
273  if (p->subrel) {
274  char *rip;
275  if (p->pseudo) {
276  rip = (char *)rz_str_casestr(tstr, "[pc +");
277  if (!rip) {
278  rip = (char *)rz_str_casestr(tstr, "[pc -");
279  }
280  } else {
281  rip = (char *)rz_str_casestr(tstr, "[pc, ");
282  }
283 
284  if (rip) {
285  rip += 4;
286  char *tstr_new, *ripend = strchr(rip, ']');
287  const char *neg = strchr(rip, '-');
288  ut64 off = (oplen == 2 || strstr(tstr, ".w") || strstr(tstr, ".W")) ? 4 : 8;
289  ut64 repl_num = (addr + off) & ~3;
290  if (!ripend) {
291  ripend = "]";
292  }
293  const char *maybe_num = neg ? neg + 1 : rip;
294  maybe_num = rz_str_trim_head_ro(maybe_num);
295  if (rz_is_valid_input_num_value(NULL, maybe_num)) {
296  if (neg) {
297  repl_num -= rz_num_get(NULL, maybe_num);
298  } else {
299  repl_num += rz_num_get(NULL, maybe_num);
300  }
301  rip -= 3;
302  *rip = 0;
303  tstr_new = rz_str_newf("%s0x%08" PFMT64x "%s", tstr, repl_num, ripend);
304  free(tstr);
305  tstr = tstr_new;
306  }
307  }
308  }
309 
310  bpargs = p->varlist(f, 'b');
311  spargs = p->varlist(f, 's');
312  bool ucase = IS_UPPER(*tstr);
313  RzAnalysisVarField *var;
314  rz_list_foreach (bpargs, iter, var) {
315  st64 delta = p->get_ptr_at
316  ? p->get_ptr_at(f, var->delta, addr)
317  : ST64_MAX;
318  if (delta == ST64_MAX && var->field) {
319  delta = var->delta + f->bp_off;
320  } else if (delta == ST64_MAX) {
321  continue;
322  }
323  const char *reg = NULL;
324  if (p->get_reg_at) {
325  reg = p->get_reg_at(f, var->delta, addr);
326  }
327  if (!reg) {
328  reg = analysis->reg->name[RZ_REG_NAME_BP];
329  }
330  oldstr = mount_oldstr(p, reg, delta, ucase);
331  if (strstr(tstr, oldstr)) {
332  tstr = subs_var_string(p, var, tstr, oldstr, reg, delta);
333  free(oldstr);
334  break;
335  }
336  free(oldstr);
337  }
338  rz_list_foreach (spargs, iter, var) {
339  st64 delta = p->get_ptr_at
340  ? p->get_ptr_at(f, var->delta, addr)
341  : ST64_MAX;
342  if (delta == ST64_MAX && var->field) {
343  delta = var->delta;
344  } else if (delta == ST64_MAX) {
345  continue;
346  }
347  const char *reg = NULL;
348  if (p->get_reg_at) {
349  reg = p->get_reg_at(f, var->delta, addr);
350  }
351  if (!reg) {
352  reg = analysis->reg->name[RZ_REG_NAME_SP];
353  }
354  oldstr = mount_oldstr(p, reg, delta, ucase);
355  if (strstr(tstr, oldstr)) {
356  tstr = subs_var_string(p, var, tstr, oldstr, reg, delta);
357  free(oldstr);
358  break;
359  }
360  free(oldstr);
361  }
362  rz_list_free(bpargs);
363  rz_list_free(spargs);
364  if (len > strlen(tstr)) {
365  strcpy(str, tstr);
366  } else {
367  // TOO BIG STRING CANNOT REPLACE HERE
368  free(tstr);
369  return false;
370  }
371  free(tstr);
372  return true;
373 }
374 
376  .name = "arm.pseudo",
377  .desc = "ARM/ARM64 pseudo syntax",
378  .parse = parse,
379  .subvar = &subvar,
380 };
381 
382 #ifndef RZ_PLUGIN_INCORE
386  .version = RZ_VERSION
387 };
388 #endif
size_t len
Definition: 6502dis.c:15
lzma_index ** i
Definition: index.h:629
static ut32 neg(ArmOp *op)
Definition: armass64.c:981
static RASN1String * newstr(const char *string)
Definition: astr.c:23
static SblHeader sb
Definition: bin_mbn.c:26
void rip(char *fname, off_t offset, unsigned int length)
Definition: cabrip.c:18
#define RZ_API
#define NULL
Definition: cris-opc.c:27
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
Definition: sflib.h:133
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
voidpf void * buf
Definition: ioapi.h:138
#define reg(n)
void * p
Definition: libc.cpp:67
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
Definition: list.c:137
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
@ RZ_ABS
int off
Definition: pal.c:13
RzParsePlugin rz_parse_plugin_arm_pseudo
static const RzPseudoConfig arm_config
static const RzPseudoReplace arm_replace[]
static char * mount_oldstr(RzParse *p, const char *reg, st64 delta, bool ucase)
static bool subvar(RzParse *p, RzAnalysisFunction *f, RzAnalysisOp *op, char *data, char *str, int len)
RZ_API RzLibStruct rizin_plugin
static const RzPseudoGrammar arm_lexicon[]
static const RzPseudoDirect arm_direct[]
static RzList * arm_tokenize(const char *assembly, size_t length)
static char * subs_var_string(RzParse *p, RzAnalysisVarField *var, char *tstr, const char *oldstr, const char *reg, int delta)
static bool parse(RzParse *p, const char *assembly, RzStrBuf *sb)
#define RZ_PSEUDO_DEFINE_REPLACE(x, y, f)
Definition: parse_common.c:64
static bool rz_pseudo_convert(const RzPseudoConfig *config, const char *assembly, RzStrBuf *sb)
Definition: parse_common.c:103
#define RZ_PSEUDO_DEFINE_DIRECT(x, y)
Definition: parse_common.c:61
#define RZ_PSEUDO_DEFINE_CONFIG(d, l, r, m, t)
Definition: parse_common.c:67
#define RZ_PSEUDO_DEFINE_GRAMMAR(x, y)
Definition: parse_common.c:58
RZ_DEPRECATE struct rz_analysis_var_field_t RzAnalysisVarField
@ RZ_LIB_TYPE_PARSE
Definition: rz_lib.h:74
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
Definition: unum.c:172
RZ_API bool rz_is_valid_input_num_value(RzNum *num, const char *input_value)
Definition: unum.c:735
@ RZ_REG_NAME_SP
Definition: rz_reg.h:44
@ RZ_REG_NAME_BP
Definition: rz_reg.h:46
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_str_ndup(RZ_NULLABLE const char *ptr, int len)
Create new copy of string ptr limited to size len.
Definition: str.c:1006
RZ_API void rz_str_case(char *str, bool up)
Definition: str.c:341
RZ_API RzList * rz_str_split_duplist(const char *str, const char *c, bool trim)
Split the string str according to the substring c and returns a RzList with the result.
Definition: str.c:3464
RZ_API const char * rz_str_trim_head_ro(const char *str)
Definition: str_trim.c:86
RZ_API char * rz_str_replace(char *str, const char *key, const char *val, int g)
Definition: str.c:1110
RZ_API const char * rz_str_casestr(const char *a, const char *b)
Definition: str.c:2757
#define IS_UPPER(c)
Definition: rz_str_util.h:14
#define PFMT64d
Definition: rz_types.h:394
#define PFMT64x
Definition: rz_types.h:393
#define st64
Definition: rz_types_base.h:10
#define ST64_MAX
Definition: rz_types_base.h:84
#define RZ_VERSION
Definition: rz_version.h:8
#define f(i)
Definition: sha256.c:46
void * data
Definition: rz_list.h:14
char * name[RZ_REG_NAME_LAST]
Definition: rz_reg.h:149
Definition: dis.c:32
static st64 delta
Definition: vmenus.c:2425
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int comma
Definition: z80asm.c:76
static int addr
Definition: z80asm.c:58