Rizin
unix-like reverse engineering framework and cli tools
cprint.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2022 Peiwei Hu <jlu.hpw@foxmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #include <rz_core.h>
5 
6 #define STRING_CHUNK 16
7 
14  ut64 value;
15  size_t size = core->blocksize;
17 
18  if (!sb) {
19  RZ_LOG_ERROR("Fail to allocate the memory\n");
20  return NULL;
21  }
22  rz_strbuf_appendf(sb, "#define STRING_SIZE %" PFMTSZd "\nconst char s[STRING_SIZE] = \"", size);
23  for (size_t pos = 0; pos < size; pos++) {
24  if (pos && !(pos % STRING_CHUNK)) {
25  // newline and padding for long string
26  rz_strbuf_appendf(sb, "\"\n \"");
27  }
28  value = rz_read_ble(core->block + pos, false, 8);
29  rz_strbuf_appendf(sb, "\\x%02" PFMT64x, value);
30  }
31  rz_strbuf_append(sb, "\";");
32  return rz_strbuf_drain(sb);
33 }
34 
41 RZ_API RZ_OWN char *rz_core_hex_of_assembly(RzCore *core, const char *assembly) {
42  RzStrBuf *buf = rz_strbuf_new("");
43  if (!buf) {
44  RZ_LOG_ERROR("Fail to allocate memory\n");
45  return NULL;
46  }
47  rz_asm_set_pc(core->rasm, core->offset);
48  RzAsmCode *acode = rz_asm_massemble(core->rasm, assembly);
49  if (!acode) {
50  RZ_LOG_ERROR("Fail to assemble by rz_asm_massemble()\n");
52  return NULL;
53  }
54  for (int i = 0; i < acode->len; i++) {
55  ut8 b = acode->bytes[i]; // core->print->big_endian? (bytes - 1 - i): i ];
56  rz_strbuf_appendf(buf, "%02x", b);
57  }
58  rz_asm_code_free(acode);
59  return rz_strbuf_drain(buf);
60 }
61 
68 RZ_API RZ_OWN char *rz_core_esil_of_assembly(RzCore *core, const char *assembly) {
69  RzStrBuf *buf = rz_strbuf_new("");
70  if (!buf) {
71  RZ_LOG_ERROR("Fail to allocate memory\n");
72  return NULL;
73  }
74  rz_asm_set_pc(core->rasm, core->offset);
75  RzAsmCode *acode = rz_asm_massemble(core->rasm, assembly);
76  if (!acode) {
77  RZ_LOG_ERROR("Fail to assemble by rz_asm_massemble()\n");
79  return NULL;
80  }
81  int printed = 0, bufsz = acode->len;
82  RzAnalysisOp aop = { 0 };
83  while (printed < bufsz) {
84  aop.size = 0;
85  if (rz_analysis_op(core->analysis, &aop, core->offset,
86  (const ut8 *)acode->bytes + printed, bufsz - printed, RZ_ANALYSIS_OP_MASK_ESIL) <= 0 ||
87  aop.size < 1) {
88  RZ_LOG_ERROR("Cannot decode instruction\n");
89  rz_analysis_op_fini(&aop);
91  rz_asm_code_free(acode);
92  return NULL;
93  }
95  printed += aop.size;
96  rz_analysis_op_fini(&aop);
97  }
98  rz_asm_code_free(acode);
99  return rz_strbuf_drain(buf);
100 }
101 
110  RzStrBuf *buf = rz_strbuf_new("");
111  if (!buf) {
112  RZ_LOG_ERROR("Fail to allocate memory\n");
113  return NULL;
114  }
115  rz_asm_set_pc(core->rasm, core->offset);
116  RzAsmCode *acode = rz_asm_mdisassemble(core->rasm, hex, len);
117  if (!acode) {
118  RZ_LOG_ERROR("Invalid hexstr\n");
120  return NULL;
121  }
122  rz_strbuf_append(buf, acode->assembly);
123  rz_asm_code_free(acode);
124  return rz_strbuf_drain(buf);
125 }
126 
135  RzStrBuf *buf = rz_strbuf_new("");
136  if (!buf) {
137  RZ_LOG_ERROR("Fail to allocate memory\n");
138  goto fail;
139  }
140  int printed = 0;
141  RzAnalysisOp aop = { 0 };
142  while (printed < len) {
143  aop.size = 0;
144  if (rz_analysis_op(core->analysis, &aop, core->offset,
145  (const ut8 *)hex + printed, len - printed, RZ_ANALYSIS_OP_MASK_ESIL) <= 0 ||
146  aop.size < 1) {
147  RZ_LOG_ERROR("Cannot decode instruction\n");
148  rz_analysis_op_fini(&aop);
149  goto fail;
150  }
152  printed += aop.size;
153  rz_analysis_op_fini(&aop);
154  }
155  return rz_strbuf_drain(buf);
156 fail:
158  return NULL;
159 }
160 
162  int len, int base, int step, size_t zoomsz) {
163  char *string = rz_print_hexdump_str(core->print, addr, buf, len, base, step, zoomsz);
164  if (!string) {
165  RZ_LOG_ERROR("fail to print hexdump at 0x%" PFMT64x "\n", addr);
166  return;
167  }
168  rz_cons_print(string);
169  free(string);
170 }
171 
172 RZ_IPI void rz_core_print_jsondump(RZ_NONNULL RzCore *core, RZ_NONNULL const ut8 *buf, int len, int wordsize) {
173  char *string = rz_print_jsondump_str(core->print, buf, len, wordsize);
174  if (!string) {
175  RZ_LOG_ERROR("fail to print json hexdump\n");
176  return;
177  }
178  rz_cons_print(string);
179  free(string);
180 }
181 
182 RZ_IPI void rz_core_print_hexdiff(RZ_NONNULL RzCore *core, ut64 aa, RZ_NONNULL const ut8 *_a, ut64 ba, RZ_NONNULL const ut8 *_b, int len, int scndcol) {
183  char *string = rz_print_hexdiff_str(core->print, aa, _a, ba, _b, len, scndcol);
184  if (!string) {
185  RZ_LOG_ERROR("fail to print hexdiff between 0x%" PFMT64x " and 0x%" PFMT64x "\n", aa, ba);
186  return;
187  }
188  rz_cons_print(string);
189  free(string);
190 }
191 
196  rz_return_val_if_fail(core && core->cons && len > 0, false);
197  ut8 *a = malloc(len);
198  if (!a) {
199  return NULL;
200  }
201  ut8 *b = malloc(len);
202  if (!b) {
203  free(a);
204  return NULL;
205  }
206 
207  RZ_LOG_VERBOSE("print hexdump diff 0x%" PFMT64x " 0x%" PFMT64x " with len:%" PFMT64d "\n", aa, ba, len);
208 
209  rz_io_read_at(core->io, aa, a, (int)len);
210  rz_io_read_at(core->io, ba, b, (int)len);
211  int col = core->cons->columns > 123;
212  char *pstr = rz_print_hexdiff_str(core->print, aa, a,
213  ba, b, (int)len, col);
214  free(a);
215  free(b);
216  return pstr;
217 }
218 
220  char *string = rz_core_print_hexdump_diff_str(core, aa, ba, len);
221  if (!string) {
222  RZ_LOG_ERROR("fail to print hexdump diff between 0x%" PFMT64x " and 0x%" PFMT64x "\n", aa, ba);
223  return false;
224  }
225  rz_cons_print(string);
226  free(string);
227  return true;
228 }
229 
230 static inline st8 format_type_to_base(const RzCorePrintFormatType format, const ut8 n) {
231  static const st8 bases[][9] = {
232  { 0, 8 },
233  { 0, -1, -10, [4] = 10, [8] = -8 },
234  { 0, 16, 32, [4] = 32, [8] = 64 },
235  };
236  if (format >= RZ_CORE_PRINT_FORMAT_TYPE_INVALID || n >= sizeof(bases[0])) {
237  return 0;
238  }
239  return bases[format][n];
240 }
241 
242 static inline void fix_size_from_format(const RzCorePrintFormatType format, ut8 *size) {
243  if (format != RZ_CORE_PRINT_FORMAT_TYPE_INTEGER) {
244  return;
245  }
246  static const st8 sizes[] = {
247  0, 4, 2, [4] = 4, [8] = 4
248  };
249  if (*size >= sizeof(sizes)) {
250  return;
251  }
252  *size = sizes[*size];
253 }
254 
255 static inline void len_fixup(RzCore *core, ut64 *addr, int *len) {
256  if (!len) {
257  return;
258  }
259  bool is_positive = *len > 0;
260  if (RZ_ABS(*len) > core->blocksize_max) {
261  RZ_LOG_ERROR("this <len> is too big (0x%" PFMT32x
262  " < 0x%" PFMT32x ").",
263  *len, core->blocksize_max);
264  *len = (int)core->blocksize_max;
265  }
266  if (is_positive) {
267  return;
268  }
269  *len = RZ_ABS(*len);
270  if (addr) {
271  *addr = *addr - *len;
272  }
273 }
274 
282  ut64 addr, ut8 n, int len, RzCorePrintFormatType format) {
283  rz_return_val_if_fail(core, false);
284  if (!len) {
285  return NULL;
286  }
287  st8 base = format_type_to_base(format, n);
288  if (!base) {
289  return NULL;
290  }
291  len_fixup(core, &addr, &len);
292  ut8 *buffer = malloc(len);
293  if (!buffer) {
294  return NULL;
295  }
296 
297  char *string = NULL;
298  rz_io_read_at(core->io, addr, buffer, len);
299  RzPrint *print = core->print;
301  bool old_use_comments = print->use_comments;
302  print->use_comments = false;
303 
304  switch (mode) {
305  case RZ_OUTPUT_MODE_JSON:
306  string = rz_print_jsondump_str(print, buffer, len, n * 8);
307  break;
309  fix_size_from_format(format, &n);
310  string = rz_print_hexdump_str(print, addr, buffer, len, base, (int)n, 1);
311  break;
312  default:
314  break;
315  }
316 
317  print->use_comments = old_use_comments;
318  free(buffer);
319  return string;
320 }
321 
323  ut64 addr, ut8 n, int len, RzCorePrintFormatType format) {
324  char *string = rz_core_print_dump_str(core, mode, addr, n, len, format);
325  if (!string) {
326  RZ_LOG_ERROR("fail to print dump at 0x%" PFMT64x "\n", addr);
327  return false;
328  }
329  rz_cons_print(string);
330  return true;
331 }
332 
338  bool use_comment) {
339  rz_return_val_if_fail(core, false);
340  if (!len) {
341  return NULL;
342  }
343 
344  char *string = NULL;
345  RzPrint *print = core->print;
346  bool old_use_comments = print->use_comments;
347  print->use_comments = use_comment ? print->flags & RZ_PRINT_FLAGS_COMMENT : false;
348  switch (mode) {
350  ut64 from = rz_config_get_i(core->config, "diff.from");
351  ut64 to = rz_config_get_i(core->config, "diff.to");
352  if (from == to && !from) {
353  len_fixup(core, &addr, &len);
354  ut8 *buffer = malloc(len);
355  if (!buffer) {
356  return NULL;
357  }
358  rz_io_read_at(core->io, addr, buffer, len);
359  string = rz_print_hexdump_str(core->print, rz_core_pava(core, addr), buffer, len, 16, 1, 1);
360  free(buffer);
361  } else {
362  string = rz_core_print_hexdump_diff_str(core, addr, addr + to - from, len);
363  }
364  core->num->value = len;
365  break;
366  }
367  case RZ_OUTPUT_MODE_JSON:
368  string = rz_print_jsondump_str(core->print, core->block, len, 8);
369  break;
370  default:
372  break;
373  }
374  print->use_comments = old_use_comments;
375  return string;
376 }
377 
379  bool use_comment) {
380  char *string = rz_core_print_hexdump_or_hexdiff_str(core, mode, addr, len, use_comment);
381  if (!string) {
382  RZ_LOG_ERROR("fail to print hexdump at 0x%" PFMT64x "\n", addr);
383  return false;
384  }
385  rz_cons_print(string);
386  return true;
387 }
388 
389 static inline char *ut64_to_hex(const ut64 x, const ut8 width) {
391  rz_strbuf_appendf(sb, "%" PFMT64x, x);
393  if (len < width) {
395  }
396  rz_strbuf_prepend(sb, "0x");
397  return rz_strbuf_drain(sb);
398 }
399 
407  ut64 addr, int len, ut8 size) {
408  rz_return_val_if_fail(core, false);
409  if (!len) {
410  return NULL;
411  }
412  len_fixup(core, &addr, &len);
413  ut8 *buffer = malloc(len);
414  if (!buffer) {
415  return NULL;
416  }
417 
418  rz_io_read_at(core->io, addr, buffer, len);
419  const int round_len = len - (len % size);
421  for (int i = 0; i < round_len; i += size) {
422  const char *a, *b;
423  char *fn;
424  RzPrint *p = core->print;
425  RzFlagItem *f;
426  ut64 v = rz_read_ble(buffer + i, p->big_endian, size * 8);
427  if (p->colorfor) {
428  a = p->colorfor(p->user, v, true);
429  if (a && *a) {
430  b = Color_RESET;
431  } else {
432  a = b = "";
433  }
434  } else {
435  a = b = "";
436  }
437  f = rz_flag_get_at(core->flags, v, true);
438  fn = NULL;
439  if (f) {
440  st64 delta = (st64)(v - f->offset);
441  if (delta >= 0 && delta < 8192) {
442  if (v == f->offset) {
443  fn = strdup(f->name);
444  } else {
445  fn = rz_str_newf("%s+%" PFMT64d, f->name, v - f->offset);
446  }
447  }
448  }
449  char *vstr = ut64_to_hex(v, size * 2);
450  if (vstr) {
451  if (hex_offset) {
452  rz_strbuf_append(sb, rz_print_section_str(core->print, addr + i));
453  rz_strbuf_appendf(sb, "0x%08" PFMT64x " %s%s%s%s%s\n",
454  (ut64)addr + i, a, vstr, b, fn ? " " : "", fn ? fn : "");
455  } else {
456  rz_strbuf_appendf(sb, "%s%s%s\n", a, vstr, b);
457  }
458  }
459  free(vstr);
460  free(fn);
461  }
462  free(buffer);
463  return rz_strbuf_drain(sb);
464 }
465 
467  char *string = rz_core_print_hexdump_byline_str(core, hexoffset, addr, len, size);
468  if (!string) {
469  RZ_LOG_ERROR("fail to print hexdump by line at 0x%" PFMT64x "\n", addr);
470  return false;
471  }
472  rz_cons_print(string);
473  free(string);
474  return true;
475 }
size_t len
Definition: 6502dis.c:15
RZ_API void * rz_asm_code_free(RzAsmCode *acode)
Definition: acode.c:11
#define PFMT32x
#define RZ_IPI
Definition: analysis_wasm.c:11
lzma_index ** i
Definition: index.h:629
RZ_API RzAsmCode * rz_asm_mdisassemble(RzAsm *a, const ut8 *buf, int len)
Definition: asm.c:743
RZ_API int rz_asm_set_pc(RzAsm *a, ut64 pc)
Definition: asm.c:533
RZ_API RzAsmCode * rz_asm_massemble(RzAsm *a, const char *assembly)
Definition: asm.c:814
static SblHeader sb
Definition: bin_mbn.c:26
static int value
Definition: cmd_api.c:93
RZ_API ut64 rz_config_get_i(RzConfig *cfg, RZ_NONNULL const char *name)
Definition: config.c:119
#define RZ_API
static void len_fixup(RzCore *core, ut64 *addr, int *len)
Definition: cprint.c:255
RZ_API RZ_OWN char * rz_core_assembly_of_hex(RzCore *core, ut8 *hex, int len)
Get the assembly of the hexstr.
Definition: cprint.c:109
RZ_IPI void rz_core_print_hexdump(RZ_NONNULL RzCore *core, ut64 addr, RZ_NONNULL const ut8 *buf, int len, int base, int step, size_t zoomsz)
Definition: cprint.c:161
static st8 format_type_to_base(const RzCorePrintFormatType format, const ut8 n)
Definition: cprint.c:230
RZ_IPI bool rz_core_print_dump(RZ_NONNULL RzCore *core, RzOutputMode mode, ut64 addr, ut8 n, int len, RzCorePrintFormatType format)
Definition: cprint.c:322
RZ_API char * rz_core_print_dump_str(RZ_NONNULL RzCore *core, RzOutputMode mode, ut64 addr, ut8 n, int len, RzCorePrintFormatType format)
Print dump at addr.
Definition: cprint.c:281
static void fix_size_from_format(const RzCorePrintFormatType format, ut8 *size)
Definition: cprint.c:242
RZ_API RZ_OWN char * rz_core_esil_of_hex(RzCore *core, ut8 *hex, int len)
Get the esil of the hexstr.
Definition: cprint.c:134
RZ_API RZ_OWN char * rz_core_print_hexdump_byline_str(RZ_NONNULL RzCore *core, bool hex_offset, ut64 addr, int len, ut8 size)
Hexdump at addr.
Definition: cprint.c:406
RZ_IPI bool rz_core_print_hexdump_diff(RZ_NONNULL RzCore *core, ut64 aa, ut64 ba, ut64 len)
Definition: cprint.c:219
RZ_IPI bool rz_core_print_hexdump_or_hexdiff(RZ_NONNULL RzCore *core, RZ_NULLABLE RzOutputMode mode, ut64 addr, int len, bool use_comment)
Definition: cprint.c:378
static char * ut64_to_hex(const ut64 x, const ut8 width)
Definition: cprint.c:389
#define STRING_CHUNK
Definition: cprint.c:6
RZ_API RZ_OWN char * rz_core_hex_of_assembly(RzCore *core, const char *assembly)
Get the hexpair of the assembly.
Definition: cprint.c:41
RZ_IPI void rz_core_print_jsondump(RZ_NONNULL RzCore *core, RZ_NONNULL const ut8 *buf, int len, int wordsize)
Definition: cprint.c:172
RZ_API char * rz_core_print_hexdump_diff_str(RZ_NONNULL RzCore *core, ut64 aa, ut64 ba, ut64 len)
Print hexdump diff between aa and ba with len.
Definition: cprint.c:195
RZ_IPI void rz_core_print_hexdiff(RZ_NONNULL RzCore *core, ut64 aa, RZ_NONNULL const ut8 *_a, ut64 ba, RZ_NONNULL const ut8 *_b, int len, int scndcol)
Definition: cprint.c:182
RZ_API char * rz_core_print_hexdump_or_hexdiff_str(RZ_NONNULL RzCore *core, RzOutputMode mode, ut64 addr, int len, bool use_comment)
Print hexdump at addr, but maybe print hexdiff if (diff.from or diff.to),.
Definition: cprint.c:337
RZ_API RZ_OWN char * rz_core_print_string_c_cpp(RzCore *core)
Definition: cprint.c:13
RZ_IPI bool rz_core_print_hexdump_byline(RZ_NONNULL RzCore *core, bool hexoffset, ut64 addr, int len, ut8 size)
Definition: cprint.c:466
RZ_API RZ_OWN char * rz_core_esil_of_assembly(RzCore *core, const char *assembly)
Get the esil of the assembly.
Definition: cprint.c:68
#define NULL
Definition: cris-opc.c:27
RZ_API ut64 rz_core_pava(RzCore *core, ut64 addr)
Definition: disasm.c:364
const char * v
Definition: dsignal.c:12
static states step(struct re_guts *, sopno, sopno, states, int, states)
Definition: engine.c:888
RZ_API RzFlagItem * rz_flag_get_at(RzFlag *f, ut64 off, bool closest)
Definition: flag.c:404
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
voidpf void uLong size
Definition: ioapi.h:138
const char int mode
Definition: ioapi.h:137
voidpf void * buf
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
void * p
Definition: libc.cpp:67
void * malloc(size_t size)
Definition: malloc.c:123
static const char struct stat static buf struct stat static buf static idle const char static path static fd const char static len const void static prot const char struct module static image struct kernel_sym static table unsigned char static buf static fsuid unsigned struct dirent unsigned static count const struct iovec static count static pid const void static len static flags const struct sched_param static p static pid static policy struct timespec static tp static suid unsigned fn
Definition: sflib.h:186
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 x
Definition: mipsasm.c:20
int n
Definition: mipsasm.c:19
RZ_API bool rz_analysis_op_fini(RzAnalysisOp *op)
Definition: op.c:37
RZ_API int rz_analysis_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask)
Definition: op.c:96
RZ_API void rz_print_init_rowoffsets(RzPrint *p)
Definition: print.c:1519
RZ_API RZ_OWN char * rz_print_hexdiff_str(RZ_NONNULL RzPrint *p, ut64 aa, RZ_NONNULL const ut8 *_a, ut64 ba, RZ_NONNULL const ut8 *_b, int len, int scndcol)
Print hexdump diff between _a and _b.
Definition: print.c:1172
RZ_API RZ_OWN char * rz_print_hexdump_str(RZ_NONNULL RzPrint *p, ut64 addr, RZ_NONNULL const ut8 *buf, int len, int base, int step, size_t zoomsz)
Prints a hexdump of buf at addr.
Definition: print.c:573
RZ_API RZ_OWN char * rz_print_jsondump_str(RZ_NONNULL RzPrint *p, RZ_NONNULL const ut8 *buf, int len, int wordsize)
Print dump in json format.
Definition: print.c:1583
RZ_API char * rz_print_section_str(RzPrint *p, ut64 at)
Definition: print.c:511
static const char hex[16]
Definition: print.c:21
@ RZ_ANALYSIS_OP_MASK_ESIL
Definition: rz_analysis.h:441
#define rz_warn_if_reached()
Definition: rz_assert.h:29
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
#define Color_RESET
Definition: rz_cons.h:617
static ut64 rz_read_ble(const void *src, bool big_endian, int size)
Definition: rz_endian.h:517
RZ_API bool rz_io_read_at(RzIO *io, ut64 addr, ut8 *buf, int len)
Definition: io.c:300
#define RZ_LOG_VERBOSE(fmtstr,...)
Definition: rz_log.h:52
#define RZ_LOG_ERROR(fmtstr,...)
Definition: rz_log.h:58
#define RZ_PRINT_FLAGS_COMMENT
Definition: rz_print.h:25
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API const char * rz_str_pad(const char ch, int len)
Definition: str.c:3236
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
Definition: strbuf.c:342
#define RZ_STRBUF_SAFEGET(sb)
Definition: rz_strbuf.h:18
RZ_API bool rz_strbuf_prepend(RzStrBuf *sb, const char *s)
Definition: strbuf.c:201
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s)
Definition: strbuf.c:222
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
Definition: strbuf.c:8
RZ_API void rz_strbuf_free(RzStrBuf *sb)
Definition: strbuf.c:358
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API int rz_strbuf_length(RzStrBuf *sb)
Definition: strbuf.c:28
#define PFMTSZd
Definition: rz_types.h:398
#define PFMT64d
Definition: rz_types.h:394
#define RZ_NULLABLE
Definition: rz_types.h:65
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NONNULL
Definition: rz_types.h:64
RzOutputMode
Enum to describe the way data are printed.
Definition: rz_types.h:38
@ RZ_OUTPUT_MODE_JSON
Definition: rz_types.h:40
@ RZ_OUTPUT_MODE_STANDARD
Definition: rz_types.h:39
#define PFMT64x
Definition: rz_types.h:393
#define st8
Definition: rz_types_base.h:16
#define st64
Definition: rz_types_base.h:10
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
Definition: sfsocketcall.h:123
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
Definition: sfsocketcall.h:125
static int
Definition: sfsocketcall.h:114
#define b(i)
Definition: sha256.c:42
#define f(i)
Definition: sha256.c:46
#define a(i)
Definition: sha256.c:41
Definition: buffer.h:15
char * assembly
Definition: rz_asm.h:81
ut8 * bytes
Definition: rz_asm.h:80
ut64 offset
Definition: rz_core.h:301
RzAsm * rasm
Definition: rz_core.h:323
ut32 blocksize_max
Definition: rz_core.h:304
RzAnalysis * analysis
Definition: rz_core.h:322
ut8 * block
Definition: rz_core.h:305
ut32 blocksize
Definition: rz_core.h:303
int flags
Definition: rz_print.h:137
bool use_comments
Definition: rz_print.h:139
int pos
Definition: main.c:11
int width
Definition: main.c:10
#define fail(test)
Definition: tests.h:29
static st64 delta
Definition: vmenus.c:2425
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int addr
Definition: z80asm.c:58