16 #define DEFAULT_NARGS 4
17 #define FLAG_PREFIX ";-- "
19 #define COLOR(ds, field) ((ds)->show_color ? (ds)->field : "")
20 #define COLOR_ARG(ds, field) ((ds)->show_color && (ds)->show_color_args ? (ds)->field : "")
21 #define COLOR_CONST(ds, color) ((ds)->show_color ? Color_##color : "")
22 #define COLOR_RESET(ds) COLOR_CONST(ds, RESET)
24 #define DS_ANALYSIS_OP_MASK (RZ_ANALYSIS_OP_MASK_BASIC | RZ_ANALYSIS_OP_MASK_ESIL | \
25 RZ_ANALYSIS_OP_MASK_VAL | (ds->show_cmt_il ? RZ_ANALYSIS_OP_MASK_IL : 0))
79 #define DS_PRE_EMPTY 1
80 #define DS_PRE_FCN_HEAD 2
81 #define DS_PRE_FCN_MIDDLE 3
82 #define DS_PRE_FCN_TAIL 4
88 char str[1024], strsub[1024];
402 for (
i = 0;
i <
len;
i++) {
403 if (
line[
i] ==
' ') {
407 if (line_col[
i] ==
'd') {
415 for (
i = 0;
i <
len;
i++) {
421 for (
i = 0;
i <
len;
i++) {
422 if (
line[
i] ==
' ') {
426 if (line_col[
i] ==
'd') {
439 if (core &&
f && cmt && cmt_size > 0 &&
f->bits &&
f->bits != core->
rasm->
bits) {
441 if (asm_arch && *asm_arch && strstr(asm_arch,
"arm")) {
443 case 16: strcpy(cmt,
" (thumb)");
break;
444 case 32: strcpy(cmt,
" (arm)");
break;
445 case 64: strcpy(cmt,
" (aarch64)");
break;
448 snprintf(cmt, cmt_size,
" (%d bits)",
f->bits);
465 if (
s &&
s->name && *
s->name) {
472 if (
addr >=
map->addr && addr < map->addr_end) {
501 #define CMT_ALIGN _ds_comment_align_(ds, true, false)
524 va_start(ap, format);
530 #define DS_COMMENT_FUNC(name, align, nl) \
531 static void ds_comment_##name(RzDisasmState *ds, const char *format, ...) { \
533 va_start(ap, format); \
534 ds_comment_(ds, align, nl, format, ap); \
544 va_start(ap, format);
546 if (ds->show_comments && up) {
552 if (ds->show_comments && !ds->show_comment_right) {
567 eprintf(
"ESIL: fail to get regset\n");
591 #define P(x) (core->cons && core->cons->context->pal.x) ? core->cons->context->pal.x
754 const char *uri =
"malloc://32K";
763 eprintf(
"Cannot create map for tha stack, fd %d got closed again\n", ds->
stackFd);
1072 rz_list_foreach (
list,
iter, xref) {
1136 char *ox = strstr(ds->
str,
"0x");
1138 char *
e = strchr(ox,
']');
1180 char *bgcolor =
NULL;
1184 for (
i = 0;
i < argc;
i++) {
1185 bgcolor = strchr(wc_array[
i],
'\x1b');
1193 static char *hint_syntax =
NULL;
1214 if (fcn->
bits == 16 || fcn->
bits == 32) {
1343 rz_list_foreach (
list,
iter, xref) {
1348 rz_list_foreach (fls, iter2, fis) {
1385 char *
name, *realname;
1414 cols = cols > 5 ? 5 : cols;
1418 rz_list_foreach (xrefs,
iter, xrefi) {
1421 if (
count == cols) {
1443 rz_list_foreach (xrefs,
iter, xrefi) {
1447 if (xrefi->
to == ds->
at) {
1454 if (next_fun && next_fun->
addr == fun->
addr) {
1461 if (
f &&
f->demangled &&
f->realname) {
1462 realname =
strdup(
f->realname);
1473 if (next_f &&
f->offset == next_f->
offset) {
1486 realname =
strdup(
f->realname);
1498 const char *plus = fun ?
"" :
"+";
1499 ds_comment(ds,
false,
"%s; %s XREF%s from %s @ ",
1501 realname ? realname :
name);
1503 rz_list_foreach (addrs, it, addrptr) {
1504 if (addrptr && *addrptr) {
1523 eprintf(
"Corrupted database?\n");
1535 if (SZT_MUL_OVFCHK(
len, tabs)) {
1539 if (SZT_MUL_OVFCHK(
len, 4)) {
1552 int n,
i = 0,
comma = 0, word = 0;
1555 if (!ds || !ds->
atabs) {
1578 for (; *
b;
b++,
i++) {
1579 if (*
b ==
'(' || *
b ==
'[') {
1582 if (*
b ==
')' || *
b ==
']') {
1591 if (word > 0 && !
comma) {
1623 if (cur >
from && cur <
to) {
1630 for (
int i = 1;
i < ds->
oplen;
i++) {
1632 if (fi && fi->
name) {
1636 if (ds->
midflags == RZ_MIDFLAGS_REALIGN &&
1639 }
else if (!strncmp(fi->
name,
"hit.", 4)) {
1641 }
else if (!strncmp(fi->
name,
"str.", 4)) {
1642 ds->
midflags = RZ_MIDFLAGS_REALIGN;
1645 }
else if (ds->
midflags == RZ_MIDFLAGS_SYMALIGN) {
1646 if (strncmp(fi->
name,
"sym.", 4)) {
1668 if (bb && bb->
addr > ds->
at) {
1670 return bb->
addr - ds->
at;
1693 int skip_bytes_bb = midbb ?
handleMidBB(core, &ds) : 0;
1694 if (skip_bytes_flag && ds.
midflags > RZ_MIDFLAGS_SHOW) {
1695 *oplen = *ret = skip_bytes_flag;
1697 if (skip_bytes_bb && skip_bytes_bb < *ret) {
1698 *oplen = skip_bytes_bb;
1707 .midflags = *midflags
1748 res[
i++] =
'0' + (diff / 10);
1750 res[
i] =
'0' + (diff % 10);
1776 const char *pfx =
is_var ?
"var" :
"arg";
1780 COLOR_ARG(ds, color_func_var_type), vartype,
1783 constr ?
" { " :
"",
1784 constr ? constr :
"",
1815 rz_list_foreach (
list,
iter, var) {
1817 switch (var->
kind) {
1829 switch (var->
kind) {
1843 bp_vars_color = numColor;
1846 sp_vars_color = numColor;
1849 rg_vars_color = numColor;
1852 bp_args_color = numColor;
1855 sp_args_color = numColor;
1858 rg_args_color = numColor;
1901 return (
s && !strncmp(
s,
"void ", 5) && strstr(
s,
"()"));
1908 bool fcn_name_alloc =
false;
1917 const char *fcntype;
1925 fcn_name_alloc =
true;
1940 RzAnalysisFcnVarsCache vars_cache;
1946 int numvars = vars_cache.bvars->length + vars_cache.rvars->length + vars_cache.svars->length + padding;
1947 if (numvars > ds->
l) {
1991 if (!strcmp(fcntype,
"fcn")) {
2009 if (sig && fcnsig) {
2024 RzList *all_vars = vars_cache.bvars;
2032 RzList *all_vars = vars_cache.bvars;
2035 rz_list_foreach (all_vars,
iter, var) {
2051 switch (var->
kind) {
2053 char sign = var->
isarg || (-var->
delta <=
f->bp_off) ?
'+' :
'-';
2061 eprintf(
"Register not found");
2081 int saved_delta = var->
delta;
2083 char sign = var->
isarg || (-var->
delta <=
f->maxstack) ?
'+' :
'-';
2087 var->
delta = saved_delta;
2100 if (fcn_name_alloc) {
2137 if (
f->addr == ds->
at) {
2162 const char *
c =
NULL;
2185 COLOR(ds, color_fline),
c,
2197 op = strchr(locase,
' ');
2238 }
else if (vartype) {
2246 linelen = strlen(ds->
comment) + 5;
2248 if (ds->
ocols + linelen < core->cons->columns) {
2249 if (!strchr(ds->
comment,
'\n')) {
2256 int mycols = ds->
lcols;
2257 if ((mycols + linelen + 10) > core->
cons->
columns) {
2308 bool hasColor =
false;
2327 #define printPre (outline || !*comma)
2339 int case_start = -1, case_prev = 0, case_current = 0;
2345 const char *
comma =
"";
2347 bool docolon =
true;
2350 const char *switch_enum_name =
NULL;
2351 rz_list_foreach (uniqlist,
iter, flag) {
2352 if (!overlapped &&
f &&
f->addr == flag->
offset && !strcmp(flag->
name,
f->name)) {
2356 bool no_fcn_lines = (!overlapped &&
f &&
f->addr == flag->
offset);
2365 if (!strncmp(flag->
name,
"case.", 5)) {
2366 sscanf(flag->
name + 5,
"%63[^.].%d",
addr, &case_current);
2368 if (case_start == -1) {
2369 switch_addr = saddr;
2370 case_prev = case_current;
2371 case_start = case_current;
2376 if (case_current == case_prev + 1 && switch_addr == saddr) {
2377 case_prev = case_current;
2392 if (!fake_flag_marks) {
2400 bool hasColor =
false;
2417 if (!strncmp(flag->
name,
"switch.", 7)) {
2419 }
else if (!strncmp(flag->
name,
"case.", 5)) {
2423 if (!switch_block || switch_block->
switch_op->
addr != switch_addr) {
2424 switch_enum_name =
NULL;
2425 switch_block =
NULL;
2429 rz_list_foreach (
blocks, it, block) {
2431 switch_block = block;
2440 if (!strncmp(flag->
name + 5,
"default", 7)) {
2445 const char *case_prev_name =
NULL;
2446 if (switch_enum_name) {
2450 if (case_prev != case_start) {
2451 const char *case_start_name =
NULL;
2452 if (switch_enum_name) {
2455 if (case_start_name) {
2460 if (case_prev_name) {
2468 case_start = case_current;
2470 if (!case_prev_name) {
2478 case_prev = case_current;
2528 if (!outline && *
comma) {
2529 if (nth > 0 && docolon) {
2554 if (strchr(ds->
line,
'<')) {
2557 if (strchr(ds->
line,
'>')) {
2599 meta_size = rz_meta_item_size(node->
start, node->
end);
2629 switch (meta->
type) {
2650 int sz =
RZ_MIN(16, meta_size);
2653 const char *tail = (meta_size > 16) ?
"..." :
"";
2654 switch (meta->
type) {
2665 ds->
oplen = meta_size;
2731 if (meta && meta_size !=
UT64_MAX) {
2732 ds->
oplen = meta_size;
2776 int outsz = cols + 32;
2783 int sect_len = strlen(sect);
2785 if (sect_len > cols) {
2786 sect[cols - 2] =
'.';
2787 sect[cols - 1] =
'.';
2791 pre = strlen(
color) + 1;
2831 const char *
name =
"";
2890 bool hasCustomColor =
false;
2894 const char *
color =
f->color;
2895 if (ds->
at >=
f->offset && ds->
at <
f->offset +
f->size) {
2901 hasCustomColor =
true;
2913 bool show_trace =
false;
2954 show_trace = (tp ? !!tp->
count :
false);
2959 if (hasCustomColor) {
3055 const int isSigned = (ib == 1 || ib == 8 || ib == 10) ? 1 : 0;
3057 case 1:
type = isSigned ?
".char" :
".byte";
break;
3058 case 2:
type = isSigned ?
".int16" :
".word";
break;
3059 case 3:
type =
"htons";
break;
3060 case 4:
type = isSigned ?
".int32" :
".dword";
break;
3061 case 8:
type = isSigned ?
".int64" :
".qword";
break;
3062 default:
return false;
3181 ut64 mi_size = rz_meta_node_size(node);
3185 if (fmi &&
mi != fmi) {
3189 *mi_type =
mi->type;
3199 switch (
mi->subtype) {
3232 ds->
oplen = mi_size;
3238 if (mi_size < hexlen) {
3267 rz_cons_print(format);
3272 if (len_after > len_before &&
buf && cons_buf[len_after - 1] ==
'\n') {
3291 ut64 amagic = llabs(magic);
3296 if (amagic < 0xFFFFFF || amagic >
UT32_MAX) {
3302 for (
s = 0;
s < 16;
s++) {
3303 E = 1LL << (32 +
s);
3304 candidate = (
E + magic - 1) / magic;
3305 if (candidate > 0) {
3306 if (((
N * magic) >> (32 +
s)) == (
N / candidate)) {
3327 comma = strchr(esil,
',');
3331 imm = strtol(esil, &
end, 10);
3348 char *flagstr =
NULL;
3366 k = ds->
nb - strlen(
str) - 1;
3368 str[ds->
nb - 1] =
'\0';
3370 if (
k >
sizeof(
pad)) {
3373 for (j = 0; j <
k; j++) {
3384 if (k < 0 || k >
sizeof(
pad)) {
3387 for (j = 0; j <
k; j++) {
3410 if (
k >
sizeof(
pad)) {
3413 for (j = 0; j <
k; j++) {
3441 if (
num >=
sizeof(indent)) {
3442 num =
sizeof(indent) - 1;
3536 ds_comment(ds,
true,
"; REG %s - %s", sr,
"");
3566 if (!
f || !
f->name) {
3582 }
else if (
delta < 0) {
3598 int slen = shortcut ? strlen(shortcut) : 0;
3604 const char *ch = (
pos) ?
";" :
"";
3678 bool gotShortcut =
false;
3780 const int begin = gotShortcut ? 2 : 3;
3781 for (
i = begin - slen;
i > 0;
i--) {
3809 const int cmtcol = ds->
cmtcol - 1;
3817 if (cells < cmtcol) {
3818 int len = cmtcol - cells;
3819 if (len < cols && len > 0) {
3833 if ((!ds->
osl || (ds->
osl && strcmp(ds->
sl, ds->
osl)))) {
3895 for (
x = 0;
x <
mod;
x++) {
3905 char *escstr =
NULL;
3939 str_len = strlen(
str);
3940 if ((str_len == 1 &&
len > 3 &&
str[2] && !
str[3]) || (str_len == 3 &&
len > 5 && !memcmp(
str,
"\xff\xfe", 2) &&
str[4] && !
str[5])) {
3943 }
else if (str_len == 1 &&
len > 7 && !
str[2] && !
str[3] &&
str[4] && !
str[5]) {
3946 const char *ptr, *
end;
3951 for (ptr =
str; ptr <
end; ptr += 4) {
3965 const char *ptr =
str, *
end =
str + str_len;
3966 for (; ptr <
end; ptr++) {
4009 if (analysis_flag) {
4010 char *dupped =
strdup(analysis_flag);
4013 if (!strcmp(&
name[4], dupped)) {
4027 bool aligned =
false;
4030 bool f2_in_opstr =
false;
4041 if ((
char)
v > 0 &&
v >=
'!') {
4046 const char *ptr =
str;
4047 bool printable =
true;
4048 for (; *ptr; ptr++) {
4057 if (canHaveChar && printable) {
4064 if (canHaveChar && (
char)
v > 0 &&
v >=
'!' &&
v <=
'~') {
4074 rz_list_foreach (
list,
iter, xref) {
4085 if (
arch && !strcmp(
arch,
"x86")) {
4090 bool flag_printed =
false;
4091 bool refaddr_printed =
false;
4092 bool string_printed =
false;
4095 }
else if (((
st64)
p) > 0 || ((
st64)refaddr) > 0) {
4098 if (((
st64)
p) > 0) {
4102 if (subrel_addr && subrel_addr !=
p) {
4111 flag_printed =
true;
4121 char str[128] = { 0 };
4126 str[
sizeof(
str) - 1] = 0;
4129 string_printed =
true;
4137 }
else if (
n == n32 && (n32 > -512 && n32 < 512)) {
4141 const char *kind, *flag =
"";
4151 if (kind && !strcmp(kind,
"text")) {
4162 const char *refptrstr =
"";
4167 refptrstr =
s->name;
4171 ds_comment_start(ds,
"; [");
4172 if (
f && f2_in_opstr) {
4173 ds_comment_middle(ds,
"%s",
f->name);
4174 flag_printed =
true;
4176 ds_comment_middle(ds,
"0x%" PFMT64x, refaddr);
4178 ds_comment_end(ds,
":%d]=%s%s0x%" PFMT64x "%s%s",
4179 refptr, refptrstr, *refptrstr ?
"." :
"",
4180 n, (flag && *flag) ?
" " :
"", flag);
4184 refaddr_printed =
true;
4190 }
else if (!refaddr_printed && strcmp(ds->
show_cmtoff,
"false")) {
4191 char addrstr[32] = { 0 };
4193 if (!ds->
opstr || !strstr(ds->
opstr, addrstr)) {
4195 if (!ds->
opstr || !strstr(ds->
opstr, addrstr)) {
4196 bool print_refaddr =
true;
4199 if (ds->
opstr && strstr(ds->
opstr, addrstr)) {
4200 print_refaddr =
false;
4203 if (print_refaddr) {
4212 bool print_msg =
true;
4222 if (strlen(
msg) != 1) {
4226 if (!strncmp(msg2,
"UH..", 4)) {
4233 if (!string_printed) {
4236 }
else if (!flag_printed && (!ds->
opstr || (!strstr(ds->
opstr,
f->name) && !strstr(ds->
opstr,
f->realname)))) {
4245 }
else if (((
char)refaddr > 0) && refaddr >=
'!' && refaddr <=
'~') {
4247 if (canHaveChar && ch != ds->
chref) {
4251 }
else if (refaddr > 10) {
4252 if ((
st64)refaddr < 0) {
4260 ds_comment(ds,
true,
"; var %d", -(
int)refaddr);
4264 if (!string_printed && print_msg) {
4266 string_printed =
true;
4274 if (!strcmp(kind,
"text")) {
4275 if (!string_printed && print_msg) {
4278 }
else if (!strcmp(kind,
"invalid")) {
4279 int *
n = (
int *)&refaddr;
4286 if (*
n > -0xfff && *
n < 0xfff) {
4307 if (
p[l - 1] !=
'\n') {
4352 if (
f &&
f->demangled &&
f->realname && ds->
opstr && !strstr(ds->
opstr,
f->realname)) {
4360 char *demname =
NULL;
4369 const char *rel_label =
"RELOC";
4372 rel_label =
"RELOC TARGET";
4382 int cells = utf8len - (cstrlen - ansilen);
4390 }
else if (rel->
symbol) {
4441 #define RZ_DISASM_MAX_STR 512
4479 bool emu_str_printed =
false;
4482 str[
sizeof(
str) - 1] = 0;
4488 if (!(*
val >> 32)) {
4491 if (cstr[0] == 0 && cstr[1] < 0x1000) {
4493 if (!(*
val >> 32)) {
4511 bool jump_op =
false;
4512 bool ignored =
false;
4534 if (!jump_op && !ignored) {
4557 emu_str_printed =
true;
4615 ut64 base =
f->offset;
4618 int maxemu = 1024 * 1024;
4620 if (end < 0 || end > maxemu) {
4625 for (
i = 0;
i <
end;
i++) {
4636 ds_update_stackptr(ds,
op);
4693 if ((ds->
fcn && bb && ds->
fcn->
addr != ds->
at) || (!ds->
fcn && f_before)) {
4704 if (f_before == ds->
fcn) {
4710 char *refline, *reflinecol =
NULL;
4724 const int on_stack,
int asm_types) {
4725 if (on_stack == 1 && asm_types > 1) {
4732 (asm_types == 2) ?
"" :
"q", (on_stack == 1) ?
"*" :
"", fmt,
name,
addr);
4751 const char *begin = ll;
4766 if (strchr(emuskipmeta, (
char)item->
type)) {
4778 if (asm_arch && *asm_arch && strstr(asm_arch,
"mips")) {
4869 const char *fcn_name =
NULL;
4886 fcn_name = fcn->
name;
4890 fcn_name = item->
name;
4907 char *fcn_type_str =
NULL;
4912 ds_comment_middle(ds,
"; %s%s%s(",
4913 fcn_type_str ? fcn_type_str :
"",
sp,
4917 ds_comment_end(ds,
"void)");
4926 if (!rz_list_empty(
list)) {
4927 bool warning =
false;
4928 bool on_stack =
false;
4935 ds_comment_middle(ds,
"%s: unk_size",
arg->c_type);
4943 ds_comment_middle(ds,
"_format");
4945 ds_comment_middle(ds,
"%s : unk_format",
arg->c_type);
4948 ds_comment_middle(ds,
"?");
4950 ds_comment_middle(ds, nextele ?
", " :
")");
4954 ds_comment_middle(ds, nextele ?
", " :
")");
4957 ds_comment_end(ds,
"");
4974 ds_comment_middle(ds,
"; %s(", fcn_name);
4976 ds_comment_middle(ds,
"; 0x%" PFMT64x "(", pcv);
4981 ds_comment_middle(ds,
"%s0x%" PFMT64x,
i ?
", " :
"",
v);
4983 ds_comment_end(ds,
")");
5001 if (emu && emuwrite) {
5007 char *full_name =
NULL;
5012 full_name = fcn->
name;
5030 char *fcn_type_str =
NULL;
5035 char *cmt =
rz_str_newf(
"; %s%s%s(", fcn_type_str ? fcn_type_str :
"",
sp,
name);
5040 for (
i = 0;
i < arg_max;
i++) {
5047 tname,
i == arg_max - 1 ?
")" :
",");
5049 }
else if (tname && !strcmp(tname,
"...")) {
5051 tname,
i == arg_max - 1 ?
")" :
",");
5069 is_code =
mi->type !=
'd';
5077 op = strchr(locase,
' ');
5102 if (strchr(comment,
'\n')) {
5103 comment =
strdup(comment);
5111 for (
i = 0;
i < lines_count;
i++) {
5112 char *
c = comment + line_indexes[
i];
5118 if (
i < lines_count - 1) {
5163 while (*
p && !(*
p >=
'A' && *
p <=
'Z') && !(*
p >=
'a' && *
p <=
'z')) {
5195 if (!flag_sym || !flag_sym->
realname) {
5205 if (!
f->realnames) {
5221 const char *kw =
"";
5222 if (!ds->
subjmp || !analysis) {
5244 if (strchr(flag->
name,
'.')) {
5278 if (numval ==
addr) {
5279 while (*nptr && !
IS_SEPARATOR(*nptr) && *nptr != 0x1b) {
5346 bool calc_row_offsets =
p->calc_row_offsets;
5347 int ret, inc = 0, skip_bytes_flag = 0, skip_bytes_bb = 0,
idx = 0;
5349 const int addrbytes = core->io->addrbytes;
5372 if (!ds->
vec && json) {
5384 p->calc_row_offsets =
false;
5398 if (!core->keep_asmqjmps) {
5399 core->asmqjmps_count = 0;
5409 if (!ds->
vec && ds->
pj && !pj) {
5417 if (core->print->cur_enabled) {
5437 ds->
l = core->blocksize;
5445 if (!ds->
vec && ds->
pj) {
5455 if (!core->analysis->iob.is_valid_offset(core->analysis->iob.io, ds->
at, 0)) {
5493 if (fmt &&
typename) {
5499 inc = (type_bitsize >> 3) + (!!(type_bitsize & 0x7));
5508 if (ret == -31337) {
5549 if (skip_bytes_flag && ds->
midflags == RZ_MIDFLAGS_SHOW &&
5550 (!ds->
midbb || !skip_bytes_bb || skip_bytes_bb > skip_bytes_flag)) {
5551 ds->
at += skip_bytes_flag;
5554 ds->
at -= skip_bytes_flag;
5557 static bool sparse =
false;
5560 for (inc = 1; inc < ds->
oplen; inc++) {
5644 int os = core->rasm->syntax;
5647 len - addrbytes *
idx + 5);
5684 int os = core->rasm->syntax;
5687 len - addrbytes *
idx + 5);
5713 core->print->resetbg =
true;
5717 if (strchr(ds->
line,
'>')) {
5735 if (ds->
midflags == RZ_MIDFLAGS_REALIGN && skip_bytes_flag) {
5736 inc = skip_bytes_flag;
5738 if (skip_bytes_bb && skip_bytes_bb < inc) {
5739 inc = skip_bytes_bb;
5760 if (ds->
tries > 0) {
5772 if (continueoninvbreak) {
5778 if (!ds->
vec && ds->
pj) {
5795 p->calc_row_offsets = calc_row_offsets;
5798 return addrbytes *
idx;
5805 if (nb_opcodes > 0) {
5807 return i_opcodes < nb_opcodes && i_bytes < nb_bytes;
5809 return i_opcodes < nb_opcodes;
5811 return i_bytes < nb_bytes;
5816 int i, j, ret,
len = 0;
5819 bool hasanalysis =
false;
5821 int skip_bytes_flag = 0, skip_bytes_bb = 0;
5823 if (nb_bytes < 1 && nb_opcodes < 1) {
5831 ds->
len = nb_opcodes * 8;
5845 ds->
at = address +
i;
5847 int len = nb_bytes - addrbytes *
i;
5848 hasanalysis =
false;
5865 if (skip_bytes_flag && ds->
midflags > RZ_MIDFLAGS_SHOW) {
5866 ret = skip_bytes_flag;
5868 if (skip_bytes_bb && skip_bytes_bb < ret) {
5869 ret = skip_bytes_bb;
5963 if (
buf == core->
block && nb_opcodes > 0 && j < nb_opcodes) {
5969 core->
offset = old_offset;
5992 if (!*pn_opcodes && !*pn_bytes) {
5993 core->blocksize = 0;
5996 const ut64 old_offset = core->offset;
5997 const ut32 old_blocksize = core->blocksize;
5999 const int x_bytes = *pn_bytes
6001 : (
int)core->blocksize;
6003 if (*pn_opcodes < 0) {
6004 *pn_opcodes = -*pn_opcodes;
6005 *pn_bytes = x_bytes;
6010 if (*pn_bytes < 0) {
6011 offset = old_offset - x_bytes;
6013 *pn_bytes = x_bytes;
6016 if (*pn_bytes > old_blocksize) {
6019 if (
offset != old_offset) {
6058 RzAnalysisBytes *ab;
6070 pj_kn(pj,
"offset",
op->addr);
6072 pj_ki(pj,
"size", 1);
6073 pj_ks(pj,
"bytes", ab->bytes);
6074 pj_ks(pj,
"opcode",
"invalid");
6088 pj_s(pj, hint && hint->
esil ? hint->
esil : (esil ? esil :
""));
6090 pj_kb(pj,
"refptr",
op->refptr);
6093 pj_kn(pj,
"fcn_addr",
f ?
f->addr : 0);
6096 pj_ks(pj,
"opcode", asm_pseudo ? ab->pseudo : ab->opcode);
6097 pj_ks(pj,
"disasm", ab->disasm);
6099 pj_s(pj, ab->bytes);
6105 pj_kb(pj,
"reloc", rel);
6118 rz_list_foreach (
op->switch_op->cases, iter2, caseop) {
6141 rz_list_foreach (
flags, iter2, flag) {
6153 pj_ks(pj,
"comment", b64comment);
6162 if (xrefs && !rz_list_empty(xrefs)) {
6163 pj_k(pj,
"xrefs_from");
6165 rz_list_foreach (xrefs, iter2, xref) {
6180 if (xrefs && !rz_list_empty(xrefs)) {
6181 pj_k(pj,
"xrefs_to");
6183 rz_list_foreach (xrefs, iter2, xref) {
6199 if (core->
offset != old_offset) {
6228 for (
i = 0;
i < l;
i++) {
6272 char *
sp = strchr(
str,
' ');
6274 char *
end =
sp + 60 + 1;
6276 char *
dst =
sp + 1 + (
i * 2);
6295 pj_ks(pj,
"bytes", op_hex);
6335 int i = 0, j, ret,
err = 0;
6345 if (nb_opcodes < 1 && nb_bytes < 1) {
6390 ut64 meta_start = at;
6394 switch (meta->
type) {
6401 int hexlen = nb_bytes -
idx;
6402 int delta = at - meta_start;
6403 if (meta_size < hexlen) {
6439 nb_bytes - addrbytes *
i);
6440 if (midflags || midbb) {
6444 .midflags = midflags
6446 int skip_bytes_flag = 0, skip_bytes_bb = 0;
6451 if (skip_bytes_flag && midflags > RZ_MIDFLAGS_SHOW) {
6452 asmop.
size = ret = skip_bytes_flag;
6454 if (skip_bytes_bb && skip_bytes_bb < ret) {
6455 asmop.
size = ret = skip_bytes_bb;
6486 }
else if (!asm_immtrim && (
decode || esil)) {
6525 asm_str = (
char *)&
opstr;
6547 if (
buf == core->
block && nb_opcodes > 0 && j < nb_opcodes) {
6569 if (offset_into_buf + bytes_to_read > *buf_sz) {
6570 const size_t new_sz = *buf_sz * 2;
6582 if (nb_opcodes < 1) {
6599 const int ocached = core->
io->
cached;
6616 min_op_size = min_op_size > 0 ? min_op_size : 1;
6617 const ut64 read_len = max_op_size > 0 ? max_op_size : 32;
6618 size_t buf_sz = 0x100, block_sz = 0, block_instr = 0;
6622 for (
i = 0;
i < nb_opcodes;
i++) {
6624 if (!
read_ahead(core->
io, &
buf, &buf_sz, op_addr, block_sz, read_len)) {
6630 bool end_of_block =
false;
6637 end_of_block =
true;
6644 block_sz += min_op_size;
6646 block_sz +=
op.size;
6649 end_of_block =
true;
6655 const ut64 ops_to_read =
RZ_MIN(
op.delay, nb_opcodes - (
i + 1));
6656 const ut64 bytes_to_read = ops_to_read * read_len;
6657 if (!
read_ahead(core->
io, &
buf, &buf_sz, op_addr +
op.size, block_sz, bytes_to_read)) {
6660 block_instr += ops_to_read;
6661 block_sz += bytes_to_read;
6665 switch (
state->mode) {
6734 pj_kn(pj,
"size", fcn_size);
6739 rz_list_foreach (fcn->
bbs, locs_it,
b) {
6774 const int size = 12;
6777 char *buf_asm =
NULL;
6790 char *ba =
malloc(ba_len);
6798 ba, ba,
sizeof(asmop.
buf_asm));
6807 if (
color && has_color) {
RZ_API RZ_OWN char * rz_analysis_function_name_guess(RzTypeDB *typedb, RZ_NONNULL char *name)
Checks if varions function name variations present in the database.
RZ_API RzAnalysisFunction * rz_analysis_get_function_at(RzAnalysis *analysis, ut64 addr)
RZ_API ut64 rz_analysis_function_max_addr(RzAnalysisFunction *fcn)
RZ_API ut64 rz_analysis_function_linear_size(RzAnalysisFunction *fcn)
RZ_API ut64 rz_analysis_function_realsize(const RzAnalysisFunction *fcn)
RZ_API ut64 rz_analysis_function_min_addr(RzAnalysisFunction *fcn)
RZ_API bool rz_analysis_function_contains(RzAnalysisFunction *fcn, ut64 addr)
RZ_API int rz_analysis_archinfo(RzAnalysis *analysis, int query)
static int analysis_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, RzAnalysisOpMask mask)
static int bb_cmpaddr(const void *_a, const void *_b)
RZ_API int rz_asm_op_get_size(RzAsmOp *op)
RZ_API void rz_asm_op_fini(RzAsmOp *op)
RZ_API int rz_asm_op_set_hexbuf(RzAsmOp *op, const ut8 *buf, int len)
RZ_API char * rz_asm_op_get_hex(RzAsmOp *op)
RZ_API void rz_asm_op_set_asm(RzAsmOp *op, const char *str)
RZ_API char * rz_asm_op_get_asm(RzAsmOp *op)
RZ_API ut8 * rz_reg_arena_peek(RzReg *reg)
RZ_API int rz_reg_arena_push(RzReg *reg)
RZ_API void rz_reg_arena_pop(RzReg *reg)
RZ_API void rz_reg_arena_poke(RzReg *reg, const ut8 *ret)
static const char * arg(RzAnalysis *a, csh *handle, cs_insn *insn, char *buf, int n)
static RzILOpEffect * cmp(cs_insn *insn, bool is_thumb)
static RzILOpEffect * mov(cs_insn *insn, bool is_thumb)
RZ_API RZ_OWN RzAsmParseParam * rz_asm_get_parse_param(RZ_NULLABLE const RzReg *reg, ut32 ana_op_type)
Does all kinds of NULL checks on the parameters and returns an initialized RzAsmParseParam or NULL on...
RZ_API char * rz_asm_describe(RzAsm *a, const char *str)
RZ_API bool rz_asm_set_syntax(RzAsm *a, int syntax)
RZ_DEPRECATE RZ_API RZ_OWN RzStrBuf * rz_asm_colorize_asm_str(RZ_BORROW RzStrBuf *asm_str, RZ_BORROW RzPrint *p, RZ_NULLABLE const RzAsmParseParam *param, RZ_NULLABLE const RzAsmTokenString *toks)
Colors a given asm string and returns it. If toks is not NULL it uses the tokens to color the asm str...
RZ_API int rz_asm_set_pc(RzAsm *a, ut64 pc)
RZ_API int rz_asm_disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len)
static int opstr(RzAsm *a, ut8 *data, const Opcode *op)
RZ_API char * sdb_encode(const ut8 *bin, int len)
RZ_API RzBinPlugin * rz_bin_file_cur_plugin(RzBinFile *bf)
RZ_API bool rz_bin_string_filter(RzBin *bin, const char *str, int len, ut64 addr)
RZ_API bool rz_bin_strpurge(RzBin *bin, const char *str, ut64 refaddr)
RZ_API RzBinObject * rz_bin_cur_object(RzBin *bin)
RZ_API RZ_BORROW RzBinSection * rz_bin_get_section_at(RzBinObject *o, ut64 off, int va)
Find the binary section at offset off.
RZ_API RZ_OWN char * rz_bin_demangle(RZ_NULLABLE RzBinFile *bf, RZ_NULLABLE const char *language, RZ_NULLABLE const char *symbol, ut64 vaddr, bool libs)
Demangles a symbol based on the language or the RzBinFile data.
int bits(struct state *s, int need)
RZ_API RzList * rz_analysis_get_blocks_in(RzAnalysis *analysis, ut64 addr)
RZ_API RzAnalysisBlock * rz_analysis_find_most_relevant_block_in(RzAnalysis *analysis, ut64 off)
const lzma_allocator const uint8_t size_t uint8_t * out
RZ_API RZ_BORROW RzBreakpointItem * rz_bp_get_at(RZ_NONNULL RzBreakpoint *bp, ut64 addr)
Get the breakpoint at exactly addr.
RZ_API RZ_OWN RzPVector * rz_core_analysis_bytes(RZ_NONNULL RzCore *core, RZ_NONNULL const ut8 *buf, int len, int nops)
RZ_IPI char * rz_core_analysis_var_display(RzCore *core, RzAnalysisVar *var, bool add_name)
RZ_API ut64 rz_core_analysis_address(RzCore *core, ut64 addr)
RZ_API bool rz_core_analysis_function_add(RzCore *core, const char *name, ut64 addr, bool analyze_recursively)
RZ_API RzAnalysisOp * rz_core_analysis_op(RzCore *core, ut64 addr, int mask)
RZ_API RZ_OWN RzList * rz_core_get_func_args(RzCore *core, const char *fcn_name)
RZ_DEPRECATE RZ_API ut64 rz_core_arg_get(RzCore *core, const char *cc, int num)
Get the value of the num-th argument from the current debug or emulation state.
RZ_API char * resolve_fcn_name(RzAnalysis *analysis, const char *func_name)
RZ_API const char * rz_analysis_syscc_default(RzAnalysis *analysis)
RZ_API void rz_core_analysis_esil_init_mem(RZ_NONNULL RzCore *core, RZ_NULLABLE const char *name, ut64 addr, ut32 size)
RZ_API void rz_core_analysis_esil_reinit(RZ_NONNULL RzCore *core)
Reinitialize ESIL.
RZ_API void rz_core_seek_arch_bits(RzCore *core, ut64 addr)
RZ_API int rz_core_block_read(RzCore *core)
RZ_API char * rz_core_cmd_strf(RzCore *core, const char *fmt,...)
RZ_API int rz_core_cmdf(RzCore *core, const char *fmt,...)
RZ_API void rz_cmd_state_output_array_start(RzCmdStateOutput *state)
Mark the start of an array of elements in the output.
RZ_API void rz_cmd_state_output_array_end(RzCmdStateOutput *state)
Mark the end of an array of elements in the output.
RZ_API void rz_print_offset_sg(RzPrint *p, ut64 off, int invert, int offseg, int seggrn, int offdec, int delta, const char *label)
RZ_API ut64 rz_config_get_i(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API bool rz_config_get_b(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API RzConfigNode * rz_config_set(RzConfig *cfg, RZ_NONNULL const char *name, const char *value)
RZ_API RzConfigNode * rz_config_set_i(RzConfig *cfg, RZ_NONNULL const char *name, const ut64 i)
RZ_API RZ_BORROW const char * rz_config_get(RzConfig *cfg, RZ_NONNULL const char *name)
RZ_API int rz_cons_get_buffer_len(void)
RZ_API void rz_cons_memset(char ch, int len)
RZ_API bool rz_cons_drop(int n)
RZ_API int rz_cons_get_size(int *rows)
RZ_API RZ_OWN char * rz_cons_get_buffer_dup(void)
Return a newly allocated buffer containing what's currently in RzCons buffer.
RZ_API void rz_cons_strcat(const char *str)
RZ_API void rz_cons_newline(void)
RZ_API void rz_cons_break_pop(void)
RZ_API char * rz_cons_lastline(int *len)
RZ_API void rz_cons_strcat_justify(const char *str, int j, char c)
RZ_API void rz_cons_break_push(RzConsBreak cb, void *user)
RZ_API int rz_cons_printf(const char *format,...)
RZ_API void rz_cons_chop(void)
RZ_API const char * rz_cons_get_buffer(void)
Return the current RzCons buffer.
RZ_API void rz_cons_printf_list(const char *format, va_list ap)
RZ_API bool rz_cons_is_interactive(void)
RZ_API bool rz_cons_is_breaked(void)
RZ_API void rz_cons_println(const char *str)
RZ_API void rz_cons_reset(void)
RZ_API void rz_cons_pop(void)
RZ_API void rz_cons_push(void)
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)
RZ_API RzReg * rz_core_reg_default(RzCore *core)
Get the currently relevant RzReg.
RZ_API RZ_OWN char * rz_core_syscall_as_string(RzCore *core, st64 n, ut64 addr)
Returns the syscall representation as a string.
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 nbytes
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 count
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 start
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 key
RZ_API const char * rz_analysis_data_kind(RzAnalysis *a, ut64 addr, const ut8 *buf, int len)
RZ_DEPRECATE RZ_API char * rz_bin_addr2text(RzBin *bin, ut64 addr, int origin)
static void ds_print_cmt_esil(RzDisasmState *ds)
static void ds_begin_comment(RzDisasmState *ds)
RZ_IPI void rz_core_asm_bb_middle(RZ_NONNULL RzCore *core, ut64 at, RZ_INOUT RZ_NONNULL int *oplen, RZ_NONNULL int *ret)
Update oplen by "asm.bb.middle" and "asm.flags.middle".
static void __replaceImports(RzDisasmState *ds)
static bool ds_print_data_type(RzDisasmState *ds, const ut8 *buf, int ib, int size)
static void ds_print_demangled(RzDisasmState *ds)
static void ds_print_relocs(RzDisasmState *ds)
static void ds_show_functions(RzDisasmState *ds)
static char * _find_next_number(char *op)
static char * ds_sub_jumps(RzDisasmState *ds, char *str)
static void ds_pre_line(RzDisasmState *ds)
static void ds_print_color_reset(RzDisasmState *ds)
static void ds_print_ref_lines(char *line, char *line_col, RzDisasmState *ds)
static bool ds_print_core_vmode_jump_hit(RzDisasmState *ds, int pos)
static void ds_comment(RzDisasmState *ds, bool align, const char *format,...)
static void ds_print_optype(RzDisasmState *ds)
static int handleMidBB(RzCore *core, RzDisasmState *ds)
static void ds_reflines_init(RzDisasmState *ds)
static int myregread(RzAnalysisEsil *esil, const char *name, ut64 *res, int *size)
static void ds_print_show_cursor(RzDisasmState *ds)
static st64 get_ptr_at(RzAnalysisFunction *fcn, st64 delta, ut64 addr)
static const char * get_utf8_char(const char line, RzDisasmState *ds)
static st64 revert_cdiv_magic(st64 magic)
RZ_API int rz_core_print_disasm_instructions_with_buf(RzCore *core, ut64 address, ut8 *buf, int nb_bytes, int nb_opcodes)
static void ds_print_dwarf(RzDisasmState *ds)
static bool ds_must_strip(RzDisasmState *ds)
static const char * rz_vline_uc[]
RZ_API int rz_core_flag_in_middle(RzCore *core, ut64 at, int oplen, int *midflags)
RZ_IPI bool rz_core_handle_backwards_disasm(RZ_NONNULL RzCore *core, RZ_NONNULL RZ_INOUT int *pn_opcodes, RZ_NONNULL RZ_INOUT int *pn_bytes)
Converting negative numbers n_opcodes and n_opcodes to positive numbers n_opcodes and n_opcodes and s...
static void ds_print_family(RzDisasmState *ds)
static void ds_print_lines_left(RzDisasmState *ds)
static void ds_show_xrefs(RzDisasmState *ds)
static RzDisasmState * ds_init(RzCore *core)
static int myregwrite(RzAnalysisEsil *esil, const char *name, ut64 *val)
static void delete_last_comment(RzDisasmState *ds)
static void ds_print_offset(RzDisasmState *ds)
static void ds_show_functions_argvar(RzDisasmState *ds, RzAnalysisFunction *fcn, RzAnalysisVar *var, const char *base, bool is_var, char sign)
static void ds_print_pre(RzDisasmState *ds, bool fcnline)
RZ_API int rz_core_print_disasm_json(RzCore *core, ut64 addr, ut8 *buf, int nb_bytes, int nb_opcodes, PJ *pj)
static bool empty_signature(const char *s)
static void ds_show_flags(RzDisasmState *ds, bool overlapped)
static void ssa_set(RzAnalysisEsil *esil, const char *reg)
static const char * get_reg_at(RzAnalysisFunction *fcn, st64 delta, ut64 addr)
static void ds_comment_esil(RzDisasmState *ds, bool up, bool end, const char *format,...)
static void mipsTweak(RzDisasmState *ds)
static bool set_jump_realname(RzDisasmState *ds, ut64 addr, const char **kw, const char **name)
static int mymemwrite1(RzAnalysisEsil *esil, ut64 addr, const ut8 *buf, int len)
RZ_API int rz_core_disasm_pdi_with_buf(RzCore *core, ut64 address, ut8 *buf, ut32 nb_opcodes, ut32 nb_bytes, int fmt)
static void ds_comment_(RzDisasmState *ds, bool align, bool nl, const char *format, va_list ap)
#define COLOR_ARG(ds, field)
static void ds_setup_pre(RzDisasmState *ds, bool tail, bool middle)
static bool can_emulate_metadata(RzCore *core, ut64 at)
static int ds_print_middle(RzDisasmState *ds, int ret)
static int flagCmp(const void *a, const void *b)
static void print_fcn_arg(RzCore *core, RzType *type, const char *name, const char *fmt, const ut64 addr, const int on_stack, int asm_types)
static int mymemwrite0(RzAnalysisEsil *esil, ut64 addr, const ut8 *buf, int len)
static void ds_cdiv_optimization(RzDisasmState *ds)
static char * ds_esc_str(RzDisasmState *ds, const char *str, int len, const char **prefix_out, bool is_comment)
static void ds_print_comments_right(RzDisasmState *ds)
#define RZ_DISASM_MAX_STR
RZ_API void rz_analysis_disasm_text_free(RzAnalysisDisasmText *t)
Free RzAnalysisDisasmText p.
static void ds_newline(RzDisasmState *ds)
static void ds_print_sysregs(RzDisasmState *ds)
static int handleMidFlags(RzCore *core, RzDisasmState *ds, bool print)
static void ds_print_as_string(RzDisasmState *ds)
static void ds_end_line_highlight(RzDisasmState *ds)
static int ds_print_shortcut(RzDisasmState *ds, ut64 addr, int pos)
static void ds_print_opstr(RzDisasmState *ds)
static void ds_print_lines_right(RzDisasmState *ds)
static void ds_print_esil_analysis_fini(RzDisasmState *ds)
RZ_API bool rz_core_print_function_disasm_json(RzCore *core, RzAnalysisFunction *fcn, PJ *pj)
static void ds_reflines_fini(RzDisasmState *ds)
static void printVarSummary(RzDisasmState *ds, RzList *list)
static bool read_ahead(RzIO *io, ut8 **buf, size_t *buf_sz, ut64 address, size_t offset_into_buf, size_t bytes_to_read)
static bool calc_tab_buf_size(size_t len, size_t tabs, size_t *c)
static void ds_print_ptr(RzDisasmState *ds, int len, int idx)
static void printCol(RzDisasmState *ds, char *sect, int cols, const char *color)
static void ds_show_comments_describe(RzDisasmState *ds)
RZ_API const char * rz_core_get_section_name(RzCore *core, ut64 addr)
static void ds_print_cycles(RzDisasmState *ds)
static void ds_build_op_str(RzDisasmState *ds, bool print_color)
static int ds_disassemble(RzDisasmState *ds, ut8 *buf, int len)
static bool ds_print_core_vmode(RzDisasmState *ds, int pos)
static void ds_align_comment(RzDisasmState *ds)
static void ds_print_esil_analysis(RzDisasmState *ds)
RZ_API int rz_core_print_disasm_all(RzCore *core, ut64 addr, int l, int len, int mode)
static void _ds_comment_align_(RzDisasmState *ds, bool up, bool nl)
static void ds_begin_cont(RzDisasmState *ds)
static void ds_print_op_size(RzDisasmState *ds)
static const char * rz_vline_u[]
#define DS_COMMENT_FUNC(name, align, nl)
static int mymemwrite2(RzAnalysisEsil *esil, ut64 addr, const ut8 *buf, int len)
static void ds_pre_emulation(RzDisasmState *ds)
static void ds_begin_line(RzDisasmState *ds)
RZ_API int rz_core_bb_starts_in_middle(RzCore *core, ut64 at, int oplen)
static void ds_print_stackptr(RzDisasmState *ds)
static bool is_filtered_flag(RzDisasmState *ds, const char *name)
static void ds_begin_nl_comment(RzDisasmState *ds)
static void ds_show_refs(RzDisasmState *ds)
static void ds_print_trace(RzDisasmState *ds)
static void ds_print_fcn_name(RzDisasmState *ds)
static void get_bits_comment(RzCore *core, RzAnalysisFunction *f, char *cmt, int cmt_size)
#define DS_PRE_FCN_MIDDLE
static bool requires_op_size(RzDisasmState *ds)
static void ds_comment_lineup(RzDisasmState *ds)
static RzAnalysisDisasmText * ds_disasm_text(RzDisasmState *ds, RzAnalysisDisasmText *t, char *text)
static void ds_print_show_bytes(RzDisasmState *ds)
static ut64 get_ptr(RzDisasmState *ds, ut64 addr)
static void ds_print_str(RzDisasmState *ds, const char *str, int len, ut64 refaddr)
static void ds_pre_xrefs(RzDisasmState *ds, bool no_fcnlines)
RZ_API ut64 rz_core_pava(RzCore *core, ut64 addr)
static RzAnalysisFunction * fcnIn(RzDisasmState *ds, ut64 at, int type)
static void ds_print_asmop_payload(RzDisasmState *ds, const ut8 *buf)
static void ds_adistrick_comments(RzDisasmState *ds)
static bool ds_print_labels(RzDisasmState *ds, RzAnalysisFunction *f)
static void ds_setup_print_pre(RzDisasmState *ds, bool tail, bool middle)
static void ds_print_cmt_il(RzDisasmState *ds)
static void ds_control_flow_comments(RzDisasmState *ds)
#define DS_ANALYSIS_OP_MASK
static void ds_update_ref_lines(RzDisasmState *ds)
static bool line_highlighted(RzDisasmState *ds)
static void __preline_flag(RzDisasmState *ds, RzFlagItem *flag)
static void ds_print_esil_analysis_init(RzDisasmState *ds)
static void ds_highlight_word(RzDisasmState *ds, char *word, char *color)
static void ds_print_bbline(RzDisasmState *ds)
static void ds_free(RzDisasmState *ds)
static void ds_print_indent(RzDisasmState *ds)
static void ds_start_line_highlight(RzDisasmState *ds)
static void ds_print_calls_hints(RzDisasmState *ds)
static void ds_show_comments_right(RzDisasmState *ds)
RZ_API RZ_OWN char * rz_core_disasm_instruction(RzCore *core, ut64 addr, ut64 reladdr, RZ_NULLABLE RzAnalysisFunction *fcn, bool color)
Returns a disassembly of one instruction.
RZ_IPI bool rz_disasm_check_end(int nb_opcodes, int i_opcodes, int nb_bytes, int i_bytes)
Is i_opcodes < nb_opcodes and i_bytes < nb_bytes ?
static void ds_atabs_option(RzDisasmState *ds)
RZ_API int rz_core_print_disasm(RZ_NONNULL RzCore *core, ut64 addr, RZ_NONNULL ut8 *buf, int len, int nlines, RZ_NULLABLE RzCmdStateOutput *state, RZ_NULLABLE RzCoreDisasmOptions *options)
Disassemble len bytes and nlines opcodes restricted by len and nlines at the same time.
RZ_API int rz_core_disasm_pdi(RzCore *core, int nb_opcodes, int nb_bytes, int fmt)
static char * ssa_get(RzAnalysisEsil *esil, const char *reg)
RZ_API int rz_core_disasm_pde(RzCore *core, int nb_opcodes, RzCmdStateOutput *state)
RZ_API RzAnalysisHint * rz_core_hint_begin(RzCore *core, RzAnalysisHint *hint, ut64 at)
RZ_API int rz_core_print_disasm_instructions(RzCore *core, int nb_bytes, int nb_opcodes)
static const char * rz_vline_a[]
static bool ds_print_meta_infos(RzDisasmState *ds, ut8 *buf, int len, int idx, int *mi_type)
static ut64 get_ptr_ble(RzDisasmState *ds, ut64 addr)
int(* decode)(const ut8 *, ebc_command_t *cmd)
static int is_var(char *x)
size_t map(int syms, int left, int len)
RZ_API void rz_analysis_esil_stack_free(RzAnalysisEsil *esil)
RZ_API RzAnalysisEsil * rz_analysis_esil_new(int stacksize, int iotrap, unsigned int addrsize)
RZ_API bool rz_analysis_esil_set_pc(RzAnalysisEsil *esil, ut64 addr)
RZ_API int rz_analysis_esil_reg_read(RzAnalysisEsil *esil, const char *regname, ut64 *num, int *size)
RZ_API bool rz_analysis_esil_setup(RzAnalysisEsil *esil, RzAnalysis *analysis, int romem, int stats, int nonull)
RZ_API bool rz_analysis_esil_parse(RzAnalysisEsil *esil, const char *str)
static int hook_mem_write(RzAnalysisEsil *esil, ut64 addr, const ut8 *buf, int len)
RZ_API RzAnalysisBlock * rz_analysis_fcn_bbget_at(RzAnalysis *analysis, RzAnalysisFunction *fcn, ut64 addr)
RZ_DEPRECATE RZ_API RzAnalysisFunction * rz_analysis_get_fcn_in(RzAnalysis *analysis, ut64 addr, int type)
RZ_API RzAnalysisBlock * rz_analysis_fcn_bbget_in(const RzAnalysis *analysis, RzAnalysisFunction *fcn, ut64 addr)
RZ_API RZ_OWN char * rz_analysis_function_get_signature(RZ_NONNULL RzAnalysisFunction *function)
RZ_API RzFlagItem * rz_flag_get_i(RzFlag *f, ut64 off)
RZ_API const RzList * rz_flag_get_list(RzFlag *f, ut64 off)
RZ_API RzFlagItem * rz_flag_get_at(RzFlag *f, ut64 off, bool closest)
RZ_API char * rz_flag_get_liststr(RzFlag *f, ut64 off)
RZ_API RzFlagItem * rz_flag_get(RzFlag *f, const char *name)
RZ_API RzFlagItem * rz_flag_get_by_spaces(RzFlag *f, ut64 off,...)
RZ_API char * sdb_fmt(const char *fmt,...)
unsigned short prefix[65536]
RZ_API RzAnalysisHint * rz_analysis_hint_get(RzAnalysis *a, ut64 addr)
RZ_API void rz_analysis_hint_free(RzAnalysisHint *h)
RZ_API void rz_config_hold_restore(RzConfigHold *h)
Restore whatever config options were previously saved in h.
RZ_API RzConfigHold * rz_config_hold_new(RzConfig *cfg)
Create an opaque object to save/restore some configuration options.
RZ_API bool rz_config_hold_s(RzConfigHold *h,...)
Save the current values of a list of config options that have string values.
RZ_API bool rz_config_hold_i(RzConfigHold *h,...)
Save the current values of a list of config options that have integer values.
RZ_API void rz_config_hold_free(RzConfigHold *h)
Free a RzConfigHold object h.
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API char * rz_cons_html_filter(const char *ptr, int *newlen)
RZ_API void rz_il_op_effect_stringify(RZ_NONNULL RzILOpEffect *op, RZ_NONNULL RzStrBuf *sb)
RZ_API const char * rz_analysis_function_get_label_at(RzAnalysisFunction *fcn, ut64 addr)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
const char * spaces(int count)
RZ_API RzBinReloc * rz_core_getreloc(RzCore *core, ut64 addr, int size)
RZ_API RzFlagItem * rz_core_flag_get_by_spaces(RzFlag *f, ut64 off)
RZ_API bool rz_core_block_size(RzCore *core, ut32 bsize)
RZ_API char * rz_core_add_asmqjmp(RzCore *core, ut64 addr)
RZ_API RzBinReloc * rz_core_get_reloc_to(RzCore *core, ut64 addr)
static void list(RzEgg *egg)
RZ_API RZ_BORROW RzListIter * rz_list_iter_get_next(RzListIter *list)
returns the next RzList iterator in the list
RZ_API RZ_OWN RzList * rz_list_uniq(RZ_NONNULL const RzList *list, RZ_NONNULL RzListComparator cmp)
Returns a new RzList which contains only unique values.
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API void rz_list_sort(RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
Sorts via merge sort or via insertion sort a list.
RZ_API bool rz_list_join(RZ_NONNULL RzList *list1, RZ_NONNULL RzList *list2)
Joins 2 list into one (list2 pointer needs to be freed by the user)
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
RZ_API void rz_list_purge(RZ_NONNULL RzList *list)
Empties the list without freeing the list pointer.
void * realloc(void *ptr, size_t size)
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd times
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
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")
static const char struct stat static buf struct stat static buf static vhangup int options
RZ_API ut64 sdb_num_get(Sdb *s, const char *key, ut32 *cas)
RZ_API ut64 sdb_num_inc(Sdb *s, const char *key, ut64 n2, ut32 cas)
RZ_API void rz_analysis_op_free(void *op)
RZ_API bool rz_analysis_op_fini(RzAnalysisOp *op)
RZ_API char * rz_analysis_op_to_string(RzAnalysis *analysis, RzAnalysisOp *op)
RZ_API const char * rz_analysis_optype_to_string(int type)
RZ_API int rz_analysis_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask)
RZ_API const char * rz_analysis_op_family_to_string(int id)
RZ_API char * rz_cons_pal_parse(const char *str, RzColor *outcol)
RZ_API bool rz_parse_filter(RzParse *p, ut64 addr, RzFlag *f, RzAnalysisHint *hint, char *data, char *str, int len, bool big_endian)
filter the opcode in data into str by following the flags and hints information
RZ_API char * rz_parse_immtrim(char *opstr)
RZ_API char * rz_parse_pseudocode(RzParse *p, const char *assembly)
Converts the assembly line into pseudocode.
RZ_API bool rz_parse_subvar(RzParse *p, RZ_NULLABLE RzAnalysisFunction *f, RZ_NONNULL RzAnalysisOp *op, RZ_NONNULL RZ_IN char *data, RZ_BORROW RZ_NONNULL RZ_OUT char *str, int len)
RZ_API void rz_print_set_rowoff(RzPrint *p, int i, ut32 offset, bool overwrite)
RZ_API void rz_print_set_screenbounds(RzPrint *p, ut64 addr)
Sets screen_bounds member of p to addr if the cursor is not visible on the screen.
RZ_API char * rz_print_hexpair(RzPrint *p, const char *str, int n)
static void pad(RzStrBuf *sb, ut32 count)
RZ_API void rz_analysis_reflines_str_free(RzAnalysisRefStr *refstr)
RZ_API RzList * rz_analysis_reflines_get(RzAnalysis *analysis, ut64 addr, const ut8 *buf, ut64 len, int nlines, int linesout, int linescall)
RZ_API RzAnalysisRefStr * rz_analysis_reflines_str(void *_core, ut64 addr, int opts)
RZ_API int rz_analysis_reflines_middle(RzAnalysis *a, RzList *list, ut64 addr, int len)
RZ_API ut64 rz_reg_getv(RzReg *reg, const char *name)
RZ_API RzRegItem * rz_reg_get(RzReg *reg, const char *name, int type)
RZ_API const char * rz_reg_get_name(RzReg *reg, int role)
RZ_API RzRegItem * rz_reg_index_get(RzReg *reg, int idx)
RZ_API ut64 rz_reg_setv(RzReg *reg, const char *name, ut64 val)
RZ_API RzRegSet * rz_reg_regset_get(RzReg *r, int type)
RZ_API bool rz_reg_set_value(RzReg *reg, RzRegItem *item, ut64 value)
RZ_API ut64 rz_reg_get_value(RzReg *reg, RzRegItem *item)
#define RZ_ANALYSIS_ADDR_TYPE_ASCII
#define RZ_ANALYSIS_OP_HINT_MASK
@ RZ_ANALYSIS_FCN_TYPE_SYM
@ RZ_ANALYSIS_FCN_TYPE_IMP
@ RZ_ANALYSIS_FCN_TYPE_LOC
@ RZ_ANALYSIS_FCN_TYPE_NULL
@ RZ_ANALYSIS_FCN_TYPE_FCN
@ RZ_ANALYSIS_XREF_TYPE_CODE
@ RZ_ANALYSIS_XREF_TYPE_STRING
@ RZ_ANALYSIS_XREF_TYPE_CALL
@ RZ_ANALYSIS_XREF_TYPE_DATA
#define RZ_ANALYSIS_ARCHINFO_MAX_OP_SIZE
int(* RzAnalysisEsilHookRegWriteCB)(ANALYSIS_ESIL *esil, const char *name, ut64 *val)
@ RZ_ANALYSIS_OP_MASK_ALL
@ RZ_ANALYSIS_OP_MASK_BASIC
@ RZ_ANALYSIS_OP_MASK_ESIL
@ RZ_ANALYSIS_OP_MASK_HINT
#define RZ_ANALYSIS_OP_TYPE_MASK
@ RZ_ANALYSIS_REFLINE_TYPE_MIDDLE_BEFORE
@ RZ_ANALYSIS_REFLINE_TYPE_MIDDLE_AFTER
@ RZ_ANALYSIS_REFLINE_TYPE_WIDE
@ RZ_ANALYSIS_REFLINE_TYPE_UTF8
#define RZ_ANALYSIS_ARCHINFO_MIN_OP_SIZE
@ RZ_ANALYSIS_VAR_KIND_REG
@ RZ_ANALYSIS_VAR_KIND_SPV
@ RZ_ANALYSIS_VAR_KIND_BPV
@ RZ_ANALYSIS_OP_TYPE_CMP
@ RZ_ANALYSIS_OP_TYPE_ICALL
@ RZ_ANALYSIS_OP_TYPE_LOAD
@ RZ_ANALYSIS_OP_TYPE_MUL
@ RZ_ANALYSIS_OP_TYPE_JMP
@ RZ_ANALYSIS_OP_TYPE_UJMP
@ RZ_ANALYSIS_OP_TYPE_IJMP
@ RZ_ANALYSIS_OP_TYPE_MJMP
@ RZ_ANALYSIS_OP_TYPE_SWI
@ RZ_ANALYSIS_OP_TYPE_IND
@ RZ_ANALYSIS_OP_TYPE_TRAP
@ RZ_ANALYSIS_OP_TYPE_CALL
@ RZ_ANALYSIS_OP_TYPE_STORE
@ RZ_ANALYSIS_OP_TYPE_REG
@ RZ_ANALYSIS_OP_TYPE_PUSH
@ RZ_ANALYSIS_OP_TYPE_IRJMP
@ RZ_ANALYSIS_OP_TYPE_RJMP
@ RZ_ANALYSIS_OP_TYPE_CJMP
@ RZ_ANALYSIS_OP_TYPE_COND
@ RZ_ANALYSIS_OP_TYPE_UCJMP
@ RZ_ANALYSIS_OP_TYPE_MOV
@ RZ_ANALYSIS_OP_TYPE_ILL
@ RZ_ANALYSIS_OP_TYPE_UCALL
@ RZ_ANALYSIS_OP_TYPE_RET
@ RZ_ANALYSIS_OP_TYPE_LEA
@ RZ_ANALYSIS_OP_TYPE_RCALL
@ RZ_ANALYSIS_OP_TYPE_IRCALL
#define rz_warn_if_fail(expr)
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
#define Color_INVERT_RESET
#define RZ_FLAGS_FS_IMPORTS
#define RZ_CORE_ASMQJMPS_NUM
#define RZ_FLAGS_FS_CLASSES
#define RZ_FLAGS_FS_RELOCS
#define RZ_FLAGS_FS_SYMBOLS
#define RZ_FLAGS_FS_FUNCTIONS
static ut64 rz_read_ble64(const void *src, bool big_endian)
static ut32 rz_read_ble32(const void *src, bool big_endian)
static ut64 rz_read_ble(const void *src, bool big_endian, int size)
RZ_API void rz_io_cache_init(RzIO *io)
RZ_API bool rz_io_read_at(RzIO *io, ut64 addr, ut8 *buf, int len)
RZ_API int rz_io_fd_open(RzIO *io, const char *uri, int flags, int mode)
RZ_API bool rz_io_read_i(RzIO *io, ut64 addr, ut64 *val, int size, bool endian)
RZ_API RzIOMap * rz_io_map_get_paddr(RzIO *io, ut64 paddr)
RZ_API void rz_io_cache_fini(RzIO *io)
RZ_API bool rz_io_read_at_mapped(RzIO *io, ut64 addr, ut8 *buf, int len)
RZ_API bool rz_io_is_valid_offset(RzIO *io, ut64 offset, int hasperm)
RZ_API void rz_io_map_set_name(RzIOMap *map, const char *name)
RZ_API RzIOMap * rz_io_map_add(RzIO *io, int fd, int flags, ut64 delta, ut64 addr, ut64 size)
RZ_API bool rz_io_fd_close(RzIO *io, int fd)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API const ut8 * rz_mem_mem_aligned(const ut8 *haystack, int hlen, const ut8 *needle, int nlen, int align)
RZ_API bool rz_name_filter(char *name, int len, bool strict)
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
RZ_API ut64 rz_num_math(RzNum *num, const char *str)
RZ_API void * rz_num_dup(ut64 n)
RZ_API char * rz_num_as_string(RzNum *___, ut64 n, bool printable_only)
RZ_API PJ * pj_kb(PJ *j, const char *k, bool v)
RZ_API PJ * pj_ki(PJ *j, const char *k, int d)
RZ_API PJ * pj_k(PJ *j, const char *k)
RZ_API PJ * pj_end(PJ *j)
RZ_API const char * pj_string(PJ *pj)
RZ_API void pj_free(PJ *j)
RZ_API PJ * pj_s(PJ *j, const char *k)
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
RZ_API PJ * pj_kn(PJ *j, const char *k, ut64 n)
RZ_API PJ * pj_kN(PJ *j, const char *k, st64 n)
#define RZ_PRINT_FLAGS_SECSUB
#define RZ_PRINT_FLAGS_ADDRDEC
#define RZ_PRINT_FLAGS_COLOR
#define RZ_PRINT_FLAGS_HEADER
#define RZ_PRINT_FLAGS_SEGOFF
#define RZ_PRINT_FLAGS_UNALLOC
static void rz_skyline_clear(RzSkyline *skyline)
RZ_API bool rz_skyline_add(RzSkyline *skyline, RzInterval itv, void *user)
RZ_API RzStrEnc rz_str_enc_string_as_type(RZ_NULLABLE const char *enc)
converts an encoding name to RzStrEnc
RZ_API char * rz_str_append_owned(char *ptr, char *string)
RZ_API void rz_str_trim_char(RZ_NONNULL RZ_INOUT char *str, const char c)
Removes the character c from the beginning and end of a string.
#define RZ_STR_ISNOTEMPTY(x)
RZ_API const char * rz_str_lchr(const char *str, char chr)
RZ_API const char * rz_str_rwx_i(int rwx)
RZ_API char * rz_str_appendf(char *ptr, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_str_append(char *ptr, const char *string)
RZ_API char * rz_str_ndup(RZ_NULLABLE const char *ptr, int len)
Create new copy of string ptr limited to size len.
RZ_API char * rz_str_escape_utf16be(const char *buf, int buf_size, RzStrEscOptions *opt)
RZ_API char * rz_str_new(const char *str)
RZ_API char RZ_API char * rz_str_newlen(const char *str, int len)
RZ_API size_t rz_str_ansi_len(const char *str)
RZ_API int rz_str_ansi_filter(char *str, char **out, int **cposs, int len)
RZ_API void rz_str_case(char *str, bool up)
RZ_API const char * rz_str_ansi_chrn(const char *str, size_t n)
RZ_API size_t rz_str_ncpy(char *dst, const char *src, size_t n)
Secure string copy with null terminator.
static const char * rz_str_get_null(const char *str)
RZ_API char * rz_str_escape_utf32le(const char *buf, int buf_size, RzStrEscOptions *opt)
#define RZ_STR_ISEMPTY(x)
RZ_API void rz_str_filter(char *str)
Convert all non-printable characters in str with '.'.
RZ_API char * rz_str_escape_8bit(const char *buf, bool colors, RzStrEscOptions *opt)
RZ_API char * rz_str_escape_utf8(const char *buf, RzStrEscOptions *opt)
RZ_API size_t rz_str_len_utf8(const char *s)
RZ_API int rz_str_bits(char *strout, const ut8 *buf, int len, const char *bitz)
RZ_API char * rz_str_replace(char *str, const char *key, const char *val, int g)
RZ_API bool rz_str_is_printable_incl_newlines(const char *str)
RZ_API char * rz_str_escape_utf32be(const char *buf, int buf_size, RzStrEscOptions *opt)
RZ_API char ** rz_str_argv(const char *str, int *_argc)
RZ_API void rz_str_trim(RZ_NONNULL RZ_INOUT char *str)
Removes whitespace characters (space, tab, newline etc.) from the beginning and end of a string.
RZ_API bool rz_str_startswith(RZ_NONNULL const char *str, RZ_NONNULL const char *needle)
Checks if a string starts with a specifc sequence of characters (case sensitive)
RZ_API char * rz_str_highlight(char *str, const char *word, const char *color, const char *color_reset)
RZ_API char * rz_str_escape_utf16le(const char *buf, int buf_size, RzStrEscOptions *opt)
RZ_API int rz_str_replace_char(char *s, int a, int b)
RZ_API const char * rz_str_pad(const char ch, int len)
RZ_API size_t rz_str_len_utf8_ansi(const char *str)
RZ_API size_t * rz_str_split_lines(char *str, size_t *count)
Split the string str in lines and returns the result in an array.
RZ_API bool rz_str_endswith(RZ_NONNULL const char *str, RZ_NONNULL const char *needle)
Checks if a string ends with a specifc sequence of characters (case sensitive)
RZ_API char * rz_str_from_ut64(ut64 val)
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
#define RZ_STRBUF_SAFEGET(sb)
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
RZ_API void rz_strbuf_fini(RzStrBuf *sb)
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
RZ_API void rz_strbuf_free(RzStrBuf *sb)
RZ_API void rz_strbuf_init(RzStrBuf *sb)
RZ_API int rz_strbuf_length(RzStrBuf *sb)
@ RZ_OUTPUT_MODE_QUIETEST
#define SZT_ADD_OVFCHK(x, y)
RZ_API int rz_utf32le_decode(const ut8 *ptr, int ptrlen, RzRune *ch)
RZ_API RzStrEnc rz_utf_bom_encoding(const ut8 *ptr, int ptrlen)
RZ_API int rz_utf8_decode(const ut8 *ptr, int ptrlen, RzRune *ch)
RZ_API int rz_utf8_strlen(const ut8 *str)
static size_t rz_pvector_len(const RzPVector *vec)
static void ** rz_pvector_push(RzPVector *vec, void *x)
RZ_API void * rz_pvector_pop_front(RzPVector *vec)
RZ_API void rz_pvector_free(RzPVector *vec)
RZ_API RzVector * rz_vector_clone(RzVector *vec)
#define rz_pvector_foreach(vec, it)
static bool is_comment(const char *s)
RZ_API Sdb * sdb_new0(void)
RZ_API bool sdb_free(Sdb *s)
RZ_API bool rz_core_seek(RzCore *core, ut64 addr, bool rb)
Seek to addr.
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
static struct sockaddr static addrlen static backlog const void static flags void flags
static struct sockaddr static addrlen static backlog const void msg
bool asm_hint_call_indirect
RzSpace * flagspace_ports
const char * color_offset
const char * color_func_var
const char * color_func_var_type
const char * color_func_var_addr
int show_comment_right_default
const char * color_usrcmt
const char * color_invalid
const char * color_comment
const char * color_gui_cflow
const char * color_gui_background
const char * color_gui_dataoffset
const char * color_linehl
const char * color_gui_alt_background
const char * color_gui_border
Group together some common options used by string escaping functions.
bool esc_bslash
When true, backslashes \ are quoted with \\
bool show_asciidot
When true, dots . are placed instead of unprintable characters.
bool esc_double_quotes
When true, double quotes "</tt> are quoted with <tt>\\"
RzAnalysisSwitchOp * switch_op
ut64 arrow
In general, arrow = UT64_MAX, if there is a jump(jmp, ...), arrow = dst offset.
int(* hook_reg_read)(ANALYSIS_ESIL *esil, const char *name, ut64 *res, int *size)
int(* hook_mem_write)(ANALYSIS_ESIL *esil, ut64 addr, const ut8 *buf, int len)
RzAnalysisEsilHookRegWriteCB hook_reg_write
RzAnalysisEsilCallbacks cb
RzAnalysisOpFamily family
RzAnalysisStackOp stackop
RzAnalysisLiftedILOp il_op
RzPlatformTarget * arch_target
struct rz_analysis_esil_t * esil
RzAsmTokenString * asm_toks
Tokenized asm string.
char *(* enrich_asm)(RzBinFile *bf, const char *asm_str, int asm_len)
ut64 vaddr
the vaddr where the value should be patched into
RZ_DEPRECATE RzBinFile * cur
never use this in new code! Get a file from the binfiles list or track it yourself.
Represent the output state of a command handler.
RzConsPrintablePalette pal
const char *(* get_reg_at)(RzAnalysisFunction *fcn, st64 delta, ut64 addr)
RzSpace * notin_flagspace
st64(* get_ptr_at)(RzAnalysisFunction *fcn, st64 delta, ut64 addr)
RzPrintAsmColorOpts colorize_opts
Coloize options for asm strings.
const char * strconv_mode
char * name[RZ_REG_NAME_LAST]
static struct Type metas[]
RZ_API const char * rz_sysreg_get(RzSyscall *s, const char *type, ut64 port)
Searches the sysregs SDB database inside librz/reg/d for the type (mmio/reg) and returns its value as...
RZ_API RzDebugTracepoint * rz_debug_trace_get(RzDebug *dbg, ut64 addr)
RZ_API int rz_type_func_args_count(RzTypeDB *typedb, RZ_NONNULL const char *name)
Searches for the RzCallable type in types database and returns arguments' count.
RZ_API RZ_BORROW const char * rz_type_func_args_name(RzTypeDB *typedb, RZ_NONNULL const char *name, int i)
Searches for the RzCallable type in types database and returns argument name.
RZ_API RZ_BORROW RzType * rz_type_func_ret(RzTypeDB *typedb, RZ_NONNULL const char *name)
Searches for the RzCallable type in types database and returns return type.
RZ_API bool rz_type_func_exist(RzTypeDB *typedb, RZ_NONNULL const char *name)
Checks if the RzCallable type exists in the database given the name.
RZ_API RZ_BORROW RzType * rz_type_func_args_type(RzTypeDB *typedb, RZ_NONNULL const char *name, int i)
Searches for the RzCallable type in types database and returns argument type.
RZ_API RZ_BORROW const char * rz_type_identifier(RZ_NONNULL const RzType *type)
Returns the type C identifier.
RZ_API ut64 rz_type_db_get_bitsize(const RzTypeDB *typedb, RZ_NONNULL RzType *type)
Returns the type size in bits (target dependent)
RZ_API RZ_BORROW const char * rz_type_db_enum_member_by_val(const RzTypeDB *typedb, RZ_NONNULL const char *name, ut64 val)
Returns the enum case name matching the cpecified value.
RZ_API RZ_OWN char * rz_type_as_string(const RzTypeDB *typedb, RZ_NONNULL const RzType *type)
Returns the type C representation.
RZ_API RZ_BORROW RzType * rz_analysis_type_link_at(RzAnalysis *analysis, ut64 addr)
Returns the RzType linked to the given address.
RZ_API void rz_analysis_fcn_vars_cache_fini(RzAnalysisFcnVarsCache *cache)
RZ_API RZ_BORROW RzAnalysisVar * rz_analysis_function_get_var(RzAnalysisFunction *fcn, char kind, int delta)
RZ_API int rz_analysis_var_count(RzAnalysis *a, RzAnalysisFunction *fcn, int kind, int type)
RZ_API char * rz_analysis_var_get_constraints_readable(RzAnalysisVar *var)
RZ_API st64 rz_analysis_function_get_var_stackptr_at(RzAnalysisFunction *fcn, st64 delta, ut64 addr)
RZ_API char * rz_analysis_fcn_format_sig(RZ_NONNULL RzAnalysis *analysis, RZ_NONNULL RzAnalysisFunction *fcn, RZ_NULLABLE char *fcn_name, RZ_NULLABLE RzAnalysisFcnVarsCache *reuse_cache, RZ_NULLABLE const char *fcn_name_pre, RZ_NULLABLE const char *fcn_name_post)
RZ_API const char * rz_analysis_function_get_var_reg_at(RzAnalysisFunction *fcn, st64 delta, ut64 addr)
RZ_API void rz_analysis_fcn_vars_cache_init(RzAnalysis *analysis, RzAnalysisFcnVarsCache *cache, RzAnalysisFunction *fcn)
RZ_API bool rz_core_prevop_addr(RzCore *core, ut64 start_addr, int numinstrs, ut64 *prev_addr)
RZ_API ut64 rz_core_prevop_addr_force(RzCore *core, ut64 start_addr, int numinstrs)
if(dbg->bits==RZ_SYS_BITS_64)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
RZ_API RzList * rz_analysis_xrefs_get_from(RzAnalysis *analysis, ut64 addr)
RZ_API RzList * rz_analysis_xrefs_get_to(RzAnalysis *analysis, ut64 addr)
RZ_API const char * rz_analysis_xrefs_type_tostring(RzAnalysisXRefType type)