15 #define is_invalid_address_va(va, vaddr, paddr) (((va) && (vaddr) == UT64_MAX) || (!(va) && (paddr) == UT64_MAX))
16 #define is_invalid_address_va2(va, vaddr, paddr) (((va) != VA_FALSE && (vaddr) == UT64_MAX) || ((va) == VA_FALSE && (paddr) == UT64_MAX))
17 #define is_in_range(at, from, sz) ((at) >= (from) && (at) < ((from) + (sz)))
23 #define LOAD_BSS_MALLOC 0
25 #define IS_MODE_SET(mode) ((mode)&RZ_MODE_SET)
26 #define IS_MODE_SIMPLE(mode) ((mode)&RZ_MODE_SIMPLE)
27 #define IS_MODE_SIMPLEST(mode) ((mode)&RZ_MODE_SIMPLEST)
28 #define IS_MODE_JSON(mode) ((mode)&RZ_MODE_JSON)
29 #define IS_MODE_RZCMD(mode) ((mode)&RZ_MODE_RIZINCMD)
30 #define IS_MODE_EQUAL(mode) ((mode)&RZ_MODE_EQUAL)
31 #define IS_MODE_NORMAL(mode) (!(mode))
32 #define IS_MODE_CLASSDUMP(mode) ((mode)&RZ_MODE_CLASSDUMP)
35 #define PAIR_WIDTH "9"
38 if (binfile && binfile->rbin && binfile->rbin->verbose) \
75 #define STR(x) (x) ? (x) : ""
123 rz_flag_space_push(core->
flags,
"format");
132 if ((flagname = strstr(
dup,
".offset"))) {
144 if (strstr(
dup,
".cparse")) {
149 char *error_msg =
NULL;
152 if (result && error_msg) {
165 if ((flagname = strstr(
dup,
".format"))) {
183 if ((flagname = strstr(
dup,
".format"))) {
190 char *offset_key =
rz_str_newf(
"%s.offset", flagname);
205 eprintf(
"Warning: Cannot register invalid format (%s)\n",
v);
207 rz_cons_print(format);
214 if ((flagname = strstr(
dup,
".size"))) {
224 eprintf(
"Cannot find flag named '%s'\n", flagname);
232 rz_flag_space_pop(core->
flags);
238 if (strchr(
file,
'\"')) {
239 eprintf(
"Invalid char found in filename\n");
242 RzBinOptions opt = { 0 };
271 if (
mask & RZ_CORE_BIN_ACC_STRINGS) {
274 if (
mask & RZ_CORE_BIN_ACC_INFO) {
277 if (
mask & RZ_CORE_BIN_ACC_MAIN) {
280 if (
mask & RZ_CORE_BIN_ACC_DWARF) {
283 if (
mask & RZ_CORE_BIN_ACC_ENTRIES) {
286 if (
mask & RZ_CORE_BIN_ACC_MAPS) {
289 if (
mask & RZ_CORE_BIN_ACC_SECTIONS) {
295 if (
mask & RZ_CORE_BIN_ACC_IMPORTS) {
298 if (
mask & RZ_CORE_BIN_ACC_SYMBOLS) {
301 if (
mask & RZ_CORE_BIN_ACC_CLASSES) {
304 if (
mask & RZ_CORE_BIN_ACC_RESOURCES) {
389 #define wrap_mode(header, default_mode, method) \
391 RzCmdStateOutput *st = add_header(state, default_mode, header); \
393 add_footer(state, st); \
397 if (
mask & RZ_CORE_BIN_ACC_INFO) {
402 if (
mask & RZ_CORE_BIN_ACC_IMPORTS) {
407 if (
mask & RZ_CORE_BIN_ACC_ENTRIES) {
412 if (
mask & RZ_CORE_BIN_ACC_EXPORTS) {
417 if (
mask & RZ_CORE_BIN_ACC_CLASSES) {
422 if (
mask & RZ_CORE_BIN_ACC_SYMBOLS) {
427 if (
mask & RZ_CORE_BIN_ACC_SECTIONS) {
432 if (
mask & RZ_CORE_BIN_ACC_SEGMENTS) {
437 if (
mask & RZ_CORE_BIN_ACC_MEM) {
442 if (
mask & RZ_CORE_BIN_ACC_STRINGS) {
447 if (
mask & RZ_CORE_BIN_ACC_MAIN) {
452 if (
mask & RZ_CORE_BIN_ACC_DWARF) {
457 if (
mask & RZ_CORE_BIN_ACC_RELOCS) {
462 if (
mask & RZ_CORE_BIN_ACC_RESOURCES) {
467 if (
mask & RZ_CORE_BIN_ACC_FIELDS) {
472 if (
mask & RZ_CORE_BIN_ACC_LIBS) {
477 if (
mask & RZ_CORE_BIN_ACC_SIZE) {
482 if (
mask & RZ_CORE_BIN_ACC_PDB) {
495 if (
mask & RZ_CORE_BIN_ACC_VERSIONINFO) {
500 if (
mask & RZ_CORE_BIN_ACC_SIGNATURE) {
505 if (
mask & RZ_CORE_BIN_ACC_INITFINI) {
510 if (
mask & RZ_CORE_BIN_ACC_TRYCATCH) {
515 if (
mask & RZ_CORE_BIN_ACC_SECTIONS_MAPPING) {
520 if (
mask & RZ_CORE_BIN_ACC_BASEFIND) {
546 rz_list_foreach (l,
iter,
string) {
561 if (
r->bin->prefix) {
570 rz_flag_space_pop(
r->flags);
650 rz_flag_space_pop(
r->flags);
689 switch (
entry->type) {
708 int i = 0, init_i = 0, fini_i = 0, preinit_i = 0;
715 hpaddr =
entry->hpaddr;
717 hvaddr =
rva(o, hpaddr,
entry->hvaddr, va);
743 rz_flag_space_pop(core->
flags);
761 if (
desc->perm == perm && !strcmp(
desc->uri, uri)) {
820 if (
map->vsize >
map->psize) {
832 const char *
prefix =
"fmap";
835 if (
map->vfile_name) {
863 int perm =
map->perm;
865 if (
map->name && strstr(
map->name,
"text")) {
877 iomap->
name = map_name;
895 if (!o || !o->
maps) {
903 rz_list_foreach (
maps, it,
map) {
938 bool segments_only =
true;
943 segments_only =
false;
948 int section_index = 0;
965 if (
section->vsize < 1024 * 1024 * 2) {
987 if (!
section->is_segment || segments_only) {
991 pfx ? pfx :
"", pfx ?
"." :
"",
section->name);
996 rz_flag_space_pop(core->
flags);
1034 if (!
s || *
s->name) {
1059 case RZ_BIN_RELOC_##T: return (T) / 8
1060 switch (reloc->
type) {
1082 if (reloc->import && reloc->import->libname) {
1084 }
else if (reloc->symbol && reloc->symbol->libname) {
1091 }
else if (reloc->import && reloc->import->name && *reloc->import->name) {
1093 }
else if (reloc->symbol && reloc->symbol->name && *reloc->symbol->name) {
1095 }
else if (reloc->is_ifunc) {
1115 if (
r->bin->prefix) {
1116 snprintf(flagname,
sizeof(flagname),
"%s.%s.%s",
r->bin->prefix,
prefix, reloc_name);
1118 snprintf(flagname,
sizeof(flagname),
"%s.%s",
prefix, reloc_name);
1120 char *demname =
NULL;
1122 demname =
rz_bin_demangle(
r->bin->cur, lang, flagname, flag_addr, keep_lib);
1124 snprintf(flagname,
sizeof(flagname),
"reloc.%s", demname);
1129 if (existing && existing->
offset == flag_addr) {
1152 size_t module_len = strlen(
module);
1153 if (module_len > 4 && !strcmp(
module + module_len - 4,
".dll")) {
1154 module[module_len - 4] =
'\0';
1157 const char *
import = reloc->
import->
name + strlen(
"Ordinal_");
1160 int ordinal = atoi(
import);
1161 if (!*sdb_module || strcmp(
module, *sdb_module)) {
1185 if (
r->bin->prefix) {
1225 char *sdb_module =
NULL;
1226 for (
size_t i = 0;
i <
relocs->relocs_count;
i++) {
1250 rz_flag_space_pop(core->
flags);
1270 if (!import->libname || !strstr(import->libname,
".dll")) {
1302 #define MAXFLAG_LEN_DEFAULT 128
1305 char *
r =
rz_str_newf(
"%s.%s%s%s", pfx, libname ? libname :
"", libname ?
"_" :
"", symname);
1328 const char *
name = sym->dname && demangle ? sym->dname : sym->
name;
1330 sn->libname = sym->libname ?
strdup(sym->libname) :
NULL;
1333 if (sym->classname && sym->classname[0]) {
1334 sn->classname =
strdup(sym->classname);
1335 sn->classflag =
rz_str_newf(
"sym.%s.%s", sn->classname, sn->name);
1341 sn->classname =
NULL;
1342 sn->classflag =
NULL;
1343 sn->methname =
NULL;
1344 sn->methflag =
NULL;
1348 if (demangle && sym->paddr && lang) {
1349 sn->demname =
rz_bin_demangle(
r->bin->cur, lang, sn->name, sym->vaddr, keep_lib);
1360 if (
r->bin->prefix) {
1362 free(sn->symbolname);
1363 sn->symbolname =
tmp;
1389 if (!strcmp(symbol->
name,
"$a")) {
1391 }
else if (!strcmp(symbol->
name,
"$x")) {
1393 }
else if (!strcmp(symbol->
name,
"$t")) {
1395 }
else if (!strcmp(symbol->
name,
"$d")) {
1417 if (paddr & 1 ||
bits == 16) {
1421 }
else if (!(paddr & 1) &&
bits == 32) {
1450 if (!o || !o->
info) {
1467 if (!symbol->
name) {
1525 eprintf(
"[Warning] Can't find flag (%s)\n",
fn);
1534 rz_flag_space_pop(core->
flags);
1548 rz_flag_space_pop(core->
flags);
1567 rz_list_foreach (
cs,
iter,
c) {
1568 if (!
c || !
c->name || !
c->name[0]) {
1584 rz_list_foreach (
c->methods, iter2, sym) {
1592 rz_flag_space_pop(core->
flags);
1609 const char *pe_path =
"bin/cur/info/pe_resource";
1625 rz_flag_space_pop(core->
flags);
1649 rz_list_foreach (digests, it, digest) {
1660 ht_pp_insert(
r, digest, chkstr);
1698 if (plugin->
name && !strcmp(plugin->
name,
"any")) {
1709 Sdb *binFileSdb = bf->sdb;
1710 Sdb *info_ns =
sdb_ns(binFileSdb,
"info",
false);
1712 "image_file_header.TimeDateStamp_string", 0);
1713 return timeDateStamp_string;
1723 rz_list_foreach (obj->
sections, it, sec) {
1783 if (chopPath &&
file) {
1786 memmove(
file, slash + 1, strlen(slash));
1802 s->address,
s->file ?
s->file :
"-");
1806 rz_cons_print(
"-\n");
1827 case RZ_BIN_RELOC_##T: return reloc->additive ? "ADD_" #T : "SET_" #T
1828 switch (reloc->
type) {
1860 if (
entry->hpaddr) {
1861 hpaddr =
entry->hpaddr;
1862 if (
entry->hvaddr) {
1863 hvaddr =
rva(o, hpaddr,
entry->hvaddr, va);
1871 switch (
state->mode) {
1919 if (
s->is_imported) {
1926 if (
addr == sym_addr && sym_size == 0) {
1929 if (sym_size == 0) {
1948 if (!symbol->
name) {
1970 char addr_value[20];
1972 rz_strf(addr_value,
"----------");
1977 switch (
state->mode) {
2014 symbol->
bind ? symbol->
bind :
"NONE",
2015 symbol->
type ? symbol->
type :
"NONE",
2039 RzCoreBinFilter
filter = { 0 };
2040 filter.offset = core->offset;
2053 RzCoreBinFilter
filter = { 0 };
2054 filter.offset = core->offset;
2063 int va = (core->io->va || core->bin->is_debugger) ?
VA_TRUE :
VA_FALSE;
2073 if (!import->name) {
2077 char *symname =
import->name ?
strdup(import->name) :
NULL;
2078 char *libname =
import->libname ?
strdup(import->libname) :
NULL;
2107 if (core->bin->prefix) {
2108 char *prname =
rz_str_newf(
"%s.%s", core->bin->prefix, symname);
2112 switch (
state->mode) {
2114 rz_cons_printf(
"%s%s%s\n", libname ? libname :
"", libname ?
" " :
"", symname);
2121 pj_ki(
state->d.pj,
"ordinal", import->ordinal);
2128 if (import->classname && import->classname[0]) {
2129 pj_ks(
state->d.pj,
"classname", import->classname);
2130 pj_ks(
state->d.pj,
"descriptor", import->descriptor);
2143 (
ut64)import->ordinal,
2145 import->bind ? import->bind :
"NONE",
2146 import->type ? import->type :
"NONE",
2147 libname ? libname :
"",
2172 rz_list_foreach (
libs,
iter, lib) {
2173 switch (
state->mode) {
2195 int va = (core->io->va || core->bin->is_debugger) ?
VA_TRUE :
VA_FALSE;
2204 switch (
state->mode) {
2237 RZ_LOG_WARN(
"Could not get relocations for current bin file.\n");
2248 for (
size_t i = 0;
i <
relocs->relocs_count;
i++) {
2252 switch (
state->mode) {
2259 char *relname =
NULL;
2265 }
else if (reloc->
symbol) {
2304 if (core->bin->prefix) {
2366 pj_ks(pj,
"perm", perms);
2370 pj_ks(pj,
"type", section_type);
2376 if (!rz_list_empty(
flags)) {
2399 ht_pp_free(digests);
2409 char *section_type =
NULL;
2413 char *section_flags_str =
NULL;
2416 if (section_flags) {
2422 char *section_name =
section->name;
2431 bool result =
false;
2440 rz_list_foreach (hashes, it, hash) {
2441 char *digest = ht_pp_find(digests, hash, &
found);
2446 ht_pp_free(digests);
2450 if (section_name !=
section->name) {
2454 free(section_flags_str);
2462 rz_cmd_state_output_set_columnsf(
state,
"XxXxssssx",
"paddr",
"size",
"vaddr",
"vsize",
"align",
"perm",
"name",
"type",
"flags");
2464 rz_list_foreach (hashes,
iter, hashname) {
2508 switch (
state->mode) {
2544 RzCoreBinFilter
filter = { 0 };
2545 filter.offset = core->offset;
2552 RzCoreBinFilter
filter = { 0 };
2553 filter.offset = core->offset;
2581 options.pointer_size = pointer_size;
2608 rz_list_foreach (scores, it, pair) {
2609 switch (
state->mode) {
2649 rz_list_foreach (hashes,
iter, hashname) {
2656 rz_list_foreach (segments,
iter, segment) {
2666 switch (
state->mode) {
2697 rz_list_foreach (
list,
iter,
string) {
2698 const char *section_name, *type_string;
2701 paddr =
string->paddr;
2702 vaddr = obj ?
rva(obj, paddr, string->
vaddr, va) : paddr;
2715 memcpy(&b64,
string,
sizeof(b64));
2728 switch (
state->mode) {
2740 pj_ks(
state->d.pj,
"string", escaped_string);
2742 switch (string->
type) {
2749 if (block_list[0] == 0 && block_list[1] == -1) {
2755 int *block_ptr = block_list;
2758 for (; *block_ptr != -1; block_ptr++) {
2760 pj_s(
state->d.pj, utfName ? utfName :
"");
2771 char *
str = escaped_string;
2772 char *no_dbl_bslash_str =
NULL;
2775 for (ptr =
str; *ptr; ptr++) {
2779 if (*(ptr + 1) ==
'\\') {
2780 if (!no_dbl_bslash_str) {
2782 if (!no_dbl_bslash_str) {
2785 ptr = no_dbl_bslash_str + (ptr -
str);
2787 memmove(ptr + 1, ptr + 2, strlen(ptr + 2) + 1);
2790 if (no_dbl_bslash_str) {
2791 str = no_dbl_bslash_str;
2796 switch (string->
type) {
2803 if (block_list[0] == 0 && block_list[1] == -1) {
2809 int *block_ptr = block_list;
2811 for (; *block_ptr != -1; block_ptr++) {
2812 if (block_ptr != block_list) {
2824 (
int)string->
length, (
int)string->
size, section_name,
2825 type_string, bufstr);
2827 free(no_dbl_bslash_str);
2832 rz_strf(quiet_val,
"----------");
2837 string->
size, string->
length, escaped_string);
2846 free(escaped_string);
2869 bool new_bf =
false;
2870 if (bf && strstr(bf->file,
"malloc://")) {
2904 bf->rbin = core->bin;
2936 }
else if (
desc->uri) {
2953 char *escaped =
NULL;
2957 switch (
state->mode) {
2962 const char *file_tag =
"file";
2979 if (
desc->referer && *
desc->referer) {
2983 pj_ki(
state->d.pj,
"block", core->blocksize);
2985 if (binfile->curxtr) {
2986 pj_ks(
state->d.pj,
"packet", binfile->curxtr->name);
3022 if (binfile && binfile->curxtr) {
3054 const char *compiled =
NULL;
3068 switch (
state->mode) {
3113 pj_ks(pj,
"compiled", compiled);
3121 pj_ks(pj,
"endian", endian);
3123 tmp_buf =
sdb_get(bf->sdb,
"mdmp.flags", 0);
3125 pj_ks(pj,
"flags", tmp_buf);
3139 pj_kn(pj,
"laddr", laddr);
3148 pj_ki(pj,
"maxopsz", u);
3165 pj_ki(pj,
"pcalign", uv);
3168 tmp_buf =
sdb_get(obj->
kv,
"elf.relro", 0);
3170 pj_ks(pj,
"relro", tmp_buf);
3192 pj_kb(pj,
"havecode", havecode);
3210 for (j = 0; j <
h->len; j++) {
3245 tmp_buf =
sdb_get(bf->sdb,
"mdmp.flags", 0);
3276 tmp_buf =
sdb_get(obj->
kv,
"elf.relro", 0);
3326 for (
i = 0;
i < 64;
i++) {
3331 pj_s(pj, flag_string);
3403 if (*objc_type ==
'^' && objc_type[1] ==
'{') {
3404 char *
a =
strdup(objc_type + 2);
3405 char *
b = strchr(
a,
'>');
3409 a[strlen(
a) - 1] = 0;
3412 if (*objc_type ==
'<') {
3413 char *
a =
strdup(objc_type + 1);
3414 char *
b = strchr(
a,
'>');
3420 if (!strcmp(objc_type,
"f")) {
3423 if (!strcmp(objc_type,
"d")) {
3426 if (!strcmp(objc_type,
"i")) {
3429 if (!strcmp(objc_type,
"s")) {
3432 if (!strcmp(objc_type,
"l")) {
3435 if (!strcmp(objc_type,
"L")) {
3436 return strdup(
"unsigned long");
3438 if (!strcmp(objc_type,
"*")) {
3441 if (!strcmp(objc_type,
"c")) {
3444 if (!strcmp(objc_type,
"v")) {
3447 if (!strcmp(objc_type,
"#")) {
3450 if (!strcmp(objc_type,
"B")) {
3451 return strdup(
"cxxbool");
3453 if (!strcmp(objc_type,
"Q")) {
3454 return strdup(
"uint64_t");
3456 if (!strcmp(objc_type,
"q")) {
3457 return strdup(
"long long");
3459 if (!strcmp(objc_type,
"C")) {
3460 return strdup(
"uint8_t");
3462 if (strlen(objc_type) == 1) {
3463 eprintf(
"Unknown objc type '%s'\n", objc_type);
3467 s[strlen(
s) - 1] =
'*';
3470 return strdup(objc_type);
3475 char *
s =
strdup(
n ?
n + 1 : objc_name);
3476 char *
p = strchr(
s,
'(');
3487 rz_list_foreach (
c->fields, iter2,
f) {
3488 if (
f->type &&
f->name) {
3508 rz_list_foreach (
c->fields, iter2,
f) {
3514 rz_list_foreach (
c->methods, iter3, sym) {
3521 }
else if (sym->
type) {
3531 if (!strcmp(
string,
"std")) {
3537 #define CXX_BIN_VISIBILITY_FLAGS (RZ_BIN_METH_PUBLIC | RZ_BIN_METH_PRIVATE | RZ_BIN_METH_PROTECTED)
3543 bool has_methods =
false;
3544 bool is_namespace =
false;
3546 const char *visibility =
"class";
3547 if (
c->visibility_str) {
3548 visibility =
c->visibility_str;
3549 is_namespace = !!strstr(visibility,
"namespace");
3551 visibility =
"namespace";
3552 is_namespace =
true;
3563 rz_list_foreach (
c->methods,
iter, sym) {
3570 rz_cons_print(
" private:\n");
3572 rz_cons_print(
" protected:\n");
3574 rz_cons_print(
" public:\n");
3579 rz_cons_print(
"static ");
3583 rz_cons_print(
name);
3588 rz_cons_print(
" const");
3591 rz_cons_print(
" = 0;\n");
3593 rz_cons_print(
";\n");
3603 rz_list_foreach (
c->fields,
iter,
f) {
3607 rz_cons_print(
" private:\n");
3609 rz_cons_print(
" public:\n");
3611 rz_cons_print(
" protected:\n");
3616 rz_cons_print(
"static ");
3619 rz_cons_print(
"const ");
3626 #undef CXX_BIN_VISIBILITY_FLAGS
3629 if (!classname || classname[0] !=
'L') {
3630 return strdup(classname ? classname :
"?");
3632 char *demangled =
strdup(classname + 1);
3634 return strdup(classname);
3637 demangled[strlen(demangled) - 1] = 0;
3643 return strdup(
"unknown");
3647 case 'B':
return strdup(
"byte");
3648 case 'C':
return strdup(
"char");
3649 case 'D':
return strdup(
"double");
3650 case 'F':
return strdup(
"float");
3651 case 'I':
return strdup(
"int");
3652 case 'J':
return strdup(
"long");
3653 case 'S':
return strdup(
"short");
3654 case 'V':
return strdup(
"void");
3655 case 'Z':
return strdup(
"boolean");
3656 default:
return strdup(
"unknown");
3661 return v ?
v :
"public";
3668 bool simplify =
false;
3669 char *
package = NULL, *classname = NULL;
3672 package = demangle_class(c->name);
3674 classname[strlen(classname) - 1] = 0;
3677 package = strdup("defpackage");
3685 rz_list_foreach (
c->fields, iter2,
f) {
3690 }
else if (simplify && ftype && package && classname) {
3697 if (!rz_list_empty(
c->fields)) {
3701 rz_list_foreach (
c->methods, iter3, sym) {
3707 }
else if (simplify && dem && package && classname) {
3742 rz_list_foreach (
c->fields, iter2,
f) {
3751 rz_list_foreach (
c->methods, iter2, sym) {
3762 rz_list_foreach (
c->fields, iter2,
f) {
3785 rz_list_foreach (
cs,
iter,
c) {
3786 if (class_name && (!
c->name || !strstr(
c->name, class_name))) {
3830 rz_list_foreach (
cs,
iter,
c) {
3831 if (class_name && (!
c->name || strcmp(
c->name, class_name))) {
3835 switch (
state->mode) {
3837 rz_list_foreach (
c->fields, iter2,
f) {
3845 rz_list_foreach (
c->fields, iter2,
f) {
3850 rz_list_foreach (
c->fields, iter2,
f) {
3865 rz_list_foreach (
c->fields, iter2,
f) {
3897 rz_list_foreach (
cs,
iter,
c) {
3898 if (class_name && (!
c->name || strcmp(
c->name, class_name))) {
3902 rz_list_foreach (
c->methods, iter2, sym) {
3906 switch (
state->mode) {
3959 rz_list_foreach (
cs,
iter,
c) {
3963 rz_list_foreach (
c->methods, iter2, sym) {
3965 if (sym->
vaddr < at_min) {
3966 at_min = sym->
vaddr;
3978 switch (
state->mode) {
3981 c->addr, at_min, at_max,
c->name,
c->super ?
" " :
"",
3982 c->super ?
c->super :
"");
3993 pj_ks(
state->d.pj,
"visibility",
c->visibility_str ?
c->visibility_str :
"");
3997 rz_list_foreach (
c->methods, iter2, sym) {
4008 rz_list_foreach (
c->fields, iter3,
f) {
4052 switch (
state->mode) {
4081 switch (
state->mode) {
4110 haveComment ?
"; " :
"",
4111 haveComment ? field->
comment :
"");
4127 if (plg && plg->
header) {
4154 int num_version = 0;
4155 int num_stringtable = 0;
4157 const char *format_version =
"bin/cur/info/vs_version_info/VS_VERSIONINFO%d";
4158 const char *format_stringtable =
"%s/string_file_info/stringtable%d";
4159 const char *format_string =
"%s/string%d";
4166 char *path_version =
sdb_fmt(format_version, num_version);
4171 pj_ko(pj,
"VS_FIXEDFILEINFO");
4175 const char *path_fixedfileinfo =
sdb_fmt(
"%s/fixed_file_info", path_version);
4176 if (!(sdb =
sdb_ns_path(
r->sdb, path_fixedfileinfo, 0))) {
4184 char *file_version =
rz_str_newf(
"%u.%u.%u.%u", file_version_ms >> 16, file_version_ms & 0xFFFF,
4185 file_version_ls >> 16, file_version_ls & 0xFFFF);
4188 char *product_version =
rz_str_newf(
"%u.%u.%u.%u", product_version_ms >> 16, product_version_ms & 0xFFFF,
4189 product_version_ls >> 16, product_version_ls & 0xFFFF);
4193 pj_ks(pj,
"FileVersion", file_version);
4194 pj_ks(pj,
"ProductVersion", product_version);
4214 free(product_version);
4223 pj_ko(pj,
"StringTable");
4227 for (num_stringtable = 0; sdb; num_stringtable++) {
4228 char *path_stringtable =
rz_str_newf(format_stringtable, path_version, num_stringtable);
4230 for (num_string = 0; sdb; num_string++) {
4231 char *path_string =
rz_str_newf(format_string, path_stringtable, num_string);
4241 eprintf(
"Warning: Cannot decode utf16 to utf8\n");
4243 pj_ks(pj, (
char *)key_utf8, (
char *)val_utf8);
4254 free(path_stringtable);
4273 pj_ka(pj,
"versym");
4284 pj_ka(pj,
"entries");
4291 for (
size_t i = 0;
i < num_entries;
i++) {
4320 Sdb *sdb =
sdb_ns_path(
r->sdb,
"bin/cur/info/versioninfo/verneed", 0);
4326 pj_ka(pj,
"verneed");
4334 pj_kn(pj,
"address", address);
4336 pj_ka(pj,
"entries");
4346 for (
size_t num_version = 0;; num_version++) {
4348 int num_vernaux = 0;
4350 char *path_version =
sdb_fmt(
"bin/cur/info/versioninfo/verneed/version%zu", num_version);
4377 pj_ki(pj,
"cnt", cnt);
4383 pj_ka(pj,
"vernaux");
4387 const char *
const path_vernaux =
sdb_fmt(
"%s/vernaux%d", path_version, num_vernaux++);
4451 }
else if (!strncmp(
"elf",
info->
rclass, 3)) {
4453 }
else if (!strncmp(
"mach0",
info->
rclass, 5)) {
4491 if (curfile != binfile || binfile->
curxtr) {
4493 if (binfile->
o && binfile->
o->
info) {
4511 bits =
r->rasm->bits;
4513 arch =
r->rasm->cur->arch;
4518 if (binfile && binfile->
curxtr) {
4563 switch (
state->mode) {
4611 rz_list_foreach (binfiles,
iter, binfile) {
4641 if (
cls->visibility_str) {
4642 char *copy =
strdup(
cls->visibility_str);
4660 if (!
cls->name || !
cls->super) {
4664 if (
cls->visibility_str) {
4665 char *copy =
strdup(
cls->visibility_str);
4682 if (!
cls->name || !meth->name) {
4689 if (meth->visibility_str) {
4690 char *copy =
strdup(meth->visibility_str);
4697 const char *mn = meth->dname ? meth->dname : meth->name;
4710 if (!
cls->name || !field->name) {
4717 if (field->visibility_str) {
4718 char *copy =
strdup(field->visibility_str);
4742 for (
i = 0;
i < 64;
i++) {
4747 pj_s(pj, flag_string);
4762 for (
i = 0;
i < 64;
i++) {
4775 for (;
len < pad_len;
len++) {
4788 switch (
state->mode) {
4829 switch (
state->mode) {
4864 rz_list_foreach (
bin->plugins,
iter, bp) {
4870 rz_list_foreach (
bin->binxtrs,
iter, bx) {
4914 const char *symstore_path =
rz_config_get(core->config,
"pdb.symstore");
4923 rz_list_foreach (mems, it,
mem) {
4924 switch (
state->mode) {
4939 mirror ? mirror->
name :
"");
4977 if (hashes && resource->
size > 0) {
4985 rz_list_foreach (hashes, it, hash) {
4986 char *digest = ht_pp_find(digests, hash, &
found);
4991 ht_pp_free(digests);
4998 if (hashes && resource->
size > 0) {
5006 rz_list_foreach (hashes, it, hash) {
5007 char *digest = ht_pp_find(digests, hash, &
found);
5012 ht_pp_free(digests);
5025 if (hashes && resource->
size > 0) {
5033 rz_list_foreach (hashes, it, hash) {
5034 char *digest = ht_pp_find(digests, hash, &
found);
5039 ht_pp_free(digests);
5049 char *hashname =
NULL;
5054 rz_list_foreach (hashes, it, hashname) {
5063 rz_list_foreach (resources, it, resource) {
5064 switch (
state->mode) {
5088 switch (
state->mode) {
5106 switch (
state->mode) {
5132 const char *space =
"";
5155 switch (
state->mode) {
5182 const char *fmt =
"Xnss";
5184 switch (
state->mode) {
5194 if (
info && !strcmp(
ctx->arch,
"mips")) {
5204 if (flag && strcmp(flag,
"unknown_flag")) {
5225 const char *fmt =
"Xnss";
5232 rz_list_foreach (binfile->
xtr_data, iter_xtr, xtr_data) {
5233 if (!xtr_data || !xtr_data->
metadata ||
const aarch64_field fields[]
RZ_API int rz_analysis_archinfo(RzAnalysis *analysis, int query)
static const char * arg(RzAnalysis *a, csh *handle, cs_insn *insn, char *buf, int n)
static RzILOpEffect * cls(cs_insn *insn)
RZ_API bool rz_asm_is_valid(RzAsm *a, const char *name)
RZ_API bool rz_asm_use(RzAsm *a, const char *name)
Puts an Asm plugin in use and disables the previous one.
RZ_API ut8 * sdb_decode(const char *in, int *len)
RZ_API RZ_OWN RzList * rz_basefind(RZ_NONNULL RzCore *core, RZ_NONNULL RzBaseFindOpt *options)
Calculates a list of possible base addresses candidates using the strings position.
RZ_API bool rz_bin_file_set_cur_binfile(RzBin *bin, RzBinFile *bf)
RZ_API bool rz_bin_file_set_cur_by_fd(RzBin *bin, ut32 bin_fd)
RZ_API RzBinFile * rz_bin_file_find_by_fd(RzBin *bin, ut32 bin_fd)
RZ_API bool rz_bin_file_delete(RzBin *bin, RzBinFile *bf)
RZ_API RzBinFile * rz_bin_file_find_by_arch_bits(RzBin *bin, const char *arch, int bits)
RZ_API RzBinPlugin * rz_bin_file_cur_plugin(RzBinFile *bf)
RZ_API bool rz_bin_file_set_cur_by_name(RzBin *bin, const char *name)
RZ_API RzList * rz_bin_file_get_trycatch(RZ_NONNULL RzBinFile *bf)
RZ_API RZ_OWN RzList * rz_bin_file_strings(RZ_NONNULL RzBinFile *bf, size_t min_length, bool raw_strings)
Generates a RzList struct containing RzBinString from a given RzBinFile.
RZ_API bool rz_bin_string_filter(RzBin *bin, const char *str, int len, ut64 addr)
RZ_API const char * rz_bin_entry_type_string(int etype)
RZ_DEPRECATE RZ_API RZ_BORROW RzBinInfo * rz_bin_get_info(RzBin *bin)
RZ_API ut64 rz_bin_get_laddr(RzBin *bin)
RZ_API RzBinObject * rz_bin_cur_object(RzBin *bin)
RZ_API ut64 rz_bin_get_size(RzBin *bin)
RZ_API RZ_OWN RzList * rz_bin_section_flag_to_list(RzBin *bin, ut64 flag)
Converts the RzBinSection flags to a list of string representations.
RZ_API RzBinFile * rz_bin_file_at(RzBin *bin, ut64 at)
RZ_API const char * rz_bin_symbol_name(RzBinSymbol *s)
RZ_DEPRECATE RZ_API int rz_bin_is_static(RZ_NONNULL RzBin *bin)
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_symbols(RZ_NONNULL RzBin *bin)
RZ_API bool rz_bin_select_bfid(RzBin *bin, ut32 bf_id)
RZ_API ut64 rz_bin_get_baddr(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.
RZ_DEPRECATE RZ_API RZ_BORROW RzList * rz_bin_get_strings(RZ_NONNULL RzBin *bin)
RZ_API void rz_bin_options_init(RzBinOptions *opt, int fd, ut64 baseaddr, ut64 loadaddr, bool patch_relocs)
RZ_API RzBinFile * rz_bin_open(RzBin *bin, const char *file, RzBinOptions *opt)
RZ_API RzBinFile * rz_bin_cur(RzBin *bin)
RZ_API const char * rz_bin_get_meth_flag_string(ut64 flag, bool compact)
RZ_API bool rz_bin_use_arch(RzBin *bin, const char *arch, int bits, const char *name)
RZ_API RZ_OWN char * rz_bin_section_type_to_string(RzBin *bin, int type)
Converts the RzBinSection type to the string representation.
static ut64 baddr(RzBinFile *bf)
static RzList * maps(RzBinFile *bf)
static RzList * libs(RzBinFile *bf)
RzList * entries(RzBinFile *bf)
RzBinInfo * info(RzBinFile *bf)
RzList * symbols(RzBinFile *bf)
RzList * imports(RzBinFile *bf)
RzList * sections(RzBinFile *bf)
RzList * relocs(RzBinFile *bf)
static RzList * trycatch(RzBinFile *bf)
static char * signature(RzBinFile *bf, bool json)
static const char * typeString(ut32 n, int *bits)
static RzBinSourceLineInfo * lines(RzBinFile *bf)
int bits(struct state *s, int need)
const lzma_allocator const uint8_t size_t uint8_t * out
RZ_API const RzList * rz_bin_object_get_entries(RZ_NONNULL RzBinObject *obj)
Get list of RzBinAddr representing the entry points of the binary object.
RZ_API const RzList * rz_bin_object_get_classes(RZ_NONNULL RzBinObject *obj)
Get list of RzBinClass representing the classes (e.g. C++ classes) defined in the binary object.
RZ_API const RzList * rz_bin_object_get_imports(RZ_NONNULL RzBinObject *obj)
Get list of RzBinImport representing the imports of the binary object.
RZ_API const RzBinAddr * rz_bin_object_get_special_symbol(RzBinObject *o, RzBinSpecialSymbol sym)
Return the RzBinAddr structure representing the special symbol sym.
RZ_API const RzList * rz_bin_object_get_fields(RZ_NONNULL RzBinObject *obj)
Get list of RzBinField representing the fields of the binary object.
RZ_API RZ_OWN RzVector * rz_bin_object_sections_mapping_list(RZ_NONNULL RzBinObject *obj)
Get the mapping between segments and sections in the binary.
RZ_API const RzList * rz_bin_object_get_libs(RZ_NONNULL RzBinObject *obj)
Get list of char* representing the libraries used by the binary object.
RZ_API ut64 rz_bin_object_addr_with_base(RzBinObject *o, ut64 addr)
Put the given address on top of o's base address.
RZ_API RzBinSymbol * rz_bin_object_get_symbol_of_import(RzBinObject *o, RzBinImport *imp)
Find the symbol that represents the given import This is necessary for example to determine the addre...
RZ_API const RzList * rz_bin_object_get_strings(RZ_NONNULL RzBinObject *obj)
Get list of RzBinString representing the strings identified in the binary object.
RZ_API ut64 rz_bin_object_get_vaddr(RzBinObject *o, ut64 paddr, ut64 vaddr)
RZ_API const RzList * rz_bin_object_get_mem(RZ_NONNULL RzBinObject *obj)
Get list of RzBinMem representing the memory regions identified in the binary object.
RZ_API const RzList * rz_bin_object_get_resources(RZ_NONNULL RzBinObject *obj)
Get a list of RzBinResource representing the resources in the binary object.
RZ_API RZ_OWN RzList * rz_bin_object_get_segments(RZ_NONNULL RzBinObject *obj)
Get list of RzBinSection representing only the segments of the binary object.
RZ_API RZ_OWN RzList * rz_bin_object_get_sections(RZ_NONNULL RzBinObject *obj)
Get list of RzBinSection representing only the sections of the binary object.
RZ_API const RzList * rz_bin_object_get_symbols(RZ_NONNULL RzBinObject *obj)
Get list of RzBinSymbol representing the symbols in the binary object.
RZ_API RzBinRelocStorage * rz_bin_object_patch_relocs(RzBinFile *bf, RzBinObject *o)
RZ_API ut64 rz_bin_reloc_size(RzBinReloc *reloc)
size of the reloc (where it is supposed to be patched) in bits
RZ_API int rz_type_parse_string_stateless(RzTypeParser *parser, const char *code, char **error_msg)
Parses the C type string reusing the existing parser state.
RZ_API void rz_core_analysis_type_init(RzCore *core)
RZ_API void rz_core_analysis_cc_init(RzCore *core)
RZ_API bool rz_core_bin_class_as_source_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, const char *class_name)
RZ_IPI RzCmdStatus rz_core_bin_plugin_print(const RzBinPlugin *bp, RzCmdStateOutput *state)
RZ_API bool rz_core_sym_is_export(RZ_NONNULL RzBinSymbol *s)
Is RzBinSymbol exported?
RZ_API bool rz_core_bin_exports_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state, RzCoreBinFilter *filter)
RZ_API char * rz_core_bin_method_flags_str(ut64 flags, int mode)
RZ_API void rz_core_bin_export_info(RzCore *core, int mode)
RZ_API bool rz_core_bin_headers_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf)
RZ_API void rz_core_bin_print_source_line_info(RzCore *core, const RzBinSourceLineInfo *li, RzCmdStateOutput *state)
RZ_API void rz_core_sym_name_init(RZ_NONNULL RzCore *r, RZ_OUT RzBinSymNames *sn, RZ_NONNULL RzBinSymbol *sym, RZ_NULLABLE const char *lang)
Initlize sn.
static int bin_trycatch(RzCore *core, PJ *pj, int mode)
static void resolve_method_flags(RzStrBuf *buf, ut64 flags)
RZ_API bool rz_core_bin_fields_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API bool rz_core_bin_apply_info(RzCore *r, RzBinFile *binfile, ut32 mask)
static const char * bin_reloc_type_name(RzBinReloc *reloc)
RZ_API bool rz_core_bin_entries_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
static bool is_in_symbol_range(ut64 sym_addr, ut64 sym_size, ut64 addr)
RZ_API bool rz_core_bin_apply_main(RzCore *r, RzBinFile *binfile, bool va)
static bool is_known_namespace(const char *string)
static void bin_resources_print_json(RzCore *core, RzCmdStateOutput *state, RzList *hashes, RzBinResource *resource)
RZ_API RZ_OWN char * rz_core_bin_field_build_flag_name(RZ_NONNULL RzBinClass *cls, RZ_NONNULL RzBinField *field)
Returns the flag name of a class field.
RZ_API bool rz_core_bin_apply_relocs(RzCore *core, RzBinFile *binfile, bool va_bool)
RZ_API bool rz_core_bin_apply_maps(RzCore *core, RzBinFile *binfile, bool va)
RZ_API bool rz_core_bin_cur_symbol_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
static void reloc_set_flag(RzCore *r, RzBinReloc *reloc, const char *prefix, ut64 flag_addr)
static const char * resolve_java_visibility(const char *v)
static bool is_file_symbol(RzBinSymbol *s)
RZ_API bool rz_core_bin_memory_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API bool rz_core_bin_whole_strings_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API RZ_OWN HtPP * rz_core_bin_create_digests(RzCore *core, ut64 paddr, ut64 size, RzList *digests)
Create a hashtable of digests.
static const char * get_filename(RzBinInfo *info, RzIODesc *desc)
RZ_API bool rz_core_bin_signatures_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
static bool meta_for_reloc(RzCore *r, RzBinObject *binobj, RzBinReloc *reloc, bool is_target, ut64 addr, RZ_OUT ut64 *size)
static ut64 get_section_addr(RzCore *core, RzBinObject *o, RzBinSection *section)
static void bin_class_print_rizin(RzCore *r, RzBinClass *c, ut64 at_min)
RZ_API bool rz_core_bin_cur_export_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API bool rz_core_bin_libs_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
static void classdump_objc(RzCore *r, RzBinClass *c)
RZ_API bool rz_core_bin_apply_sections(RzCore *core, RzBinFile *binfile, bool va)
RZ_API bool rz_core_bin_apply_symbols(RzCore *core, RzBinFile *binfile, bool va)
static char * demangle_class(const char *classname)
RZ_API RZ_OWN RzList * rz_core_bin_whole_strings(RZ_NONNULL RzCore *core, RZ_NULLABLE RzBinFile *bf)
RZ_API bool rz_core_bin_set_cur(RZ_NONNULL RzCore *core, RZ_NULLABLE RzBinFile *binfile)
Set binfile as current binfile.
static bool strings_print(RzCore *core, RzCmdStateOutput *state, const RzList *list)
RZ_API bool rz_core_bin_initfini_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API bool rz_core_bin_print(RzCore *core, RZ_NONNULL RzBinFile *bf, ut32 mask, RzCoreBinFilter *filter, RzCmdStateOutput *state, RzList *hashes)
Print (to RzCons or inside RzCmdStateOutput) the binary information specified in mask.
static bool is_initfini(RzBinAddr *entry)
static void section_perms_str(char *dst, int perms)
Write a section-specific permission string like srwx.
static bool is_file_reloc(RzBinReloc *r)
static void classdump_c(RzCore *r, RzBinClass *c)
static void add_map(RzCore *core, RZ_NULLABLE RzCoreFile *cf, RzBinFile *bf, RzBinMap *map, ut64 addr, int fd)
RZ_API RZ_OWN char * rz_core_bin_super_build_flag_name(RZ_NONNULL RzBinClass *cls)
Returns the flag name of a super class.
static bool sections_print_table(RzCore *core, RzTable *t, RzBinObject *o, RzBinSection *section, RzList *hashes)
RZ_API bool rz_core_bin_apply_dwarf(RzCore *core, RzBinFile *binfile)
static bool add_footer(RzCmdStateOutput *main_state, RzCmdStateOutput *state)
RZ_API int rz_core_bin_set_by_name(RzCore *core, const char *name)
#define IS_MODE_JSON(mode)
RZ_API bool rz_core_binfiles_delete(RzCore *core, RzBinFile *bf)
Close an opened binary file.
RZ_API int rz_core_bin_set_by_fd(RzCore *core, ut64 bin_fd)
static char * objc_name_toc(const char *objc_name)
RZ_API bool rz_core_bin_sections_mapping_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
static bool io_create_mem_map(RzIO *io, RZ_NULLABLE RzCoreFile *cf, RzBinMap *map, ut64 at)
Create null-map for excessive vsize over psize.
RZ_API int rz_core_bin_update_arch_bits(RzCore *r)
static bool core_basefind_progess_status(const RzBaseFindThreadInfo *th_info, void *user)
RZ_API bool rz_core_binfiles_print(RzCore *core, RzCmdStateOutput *state)
Print all the opened binary files according to state.
RZ_API RZ_OWN char * rz_core_bin_class_build_flag_name(RZ_NONNULL RzBinClass *cls)
Returns the flag name of a class.
static const char * get_prefix_for_sym(RzBinSymbol *sym)
static void set_bin_relocs(RzCore *r, RzBinObject *o, RzBinReloc *reloc, bool va, Sdb **db, char **sdb_module)
RZ_API bool rz_core_bin_size_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API bool rz_core_bin_apply_config(RzCore *r, RzBinFile *binfile)
RZ_API bool rz_core_bin_relocs_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
static void select_flag_space(RzCore *core, RzBinSymbol *symbol)
static char * get_rp(const char *rtype)
static void bin_elf_versioninfo_verneed(RzCore *r, PJ *pj, int mode)
RZ_API bool rz_core_bin_resources_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state, RZ_NULLABLE RzList *hashes)
static bool is_section_reloc(RzBinReloc *r)
RZ_API void rz_core_bin_print_source_line_sample(RzCore *core, const RzBinSourceLineSample *s, RzCmdStateOutput *state)
RZ_API bool rz_core_bin_archs_print(RZ_NONNULL RzBin *bin, RZ_NONNULL RzCmdStateOutput *state)
static RZ_NULLABLE RZ_BORROW const RzList * core_bin_strings(RzCore *r, RzBinFile *file)
RZ_API bool rz_core_bin_info_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
static bool is_special_symbol(RzBinSymbol *s)
static bool core_basefind_check_ctrl_c(const RzBaseFindThreadInfo *th_info, void *user)
#define is_invalid_address_va(va, vaddr, paddr)
static void handle_arm_entry(RzCore *core, RzBinObject *o, RzBinAddr *entry, int va)
static void classdump_java(RzCore *r, RzBinClass *c)
RZ_API bool rz_core_bin_segments_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state, RzCoreBinFilter *filter, RzList *hashes)
static char * objc_type_toc(const char *objc_type)
static void bin_mach0_versioninfo(RzCore *r, PJ *pj, int mode)
RZ_API RzCmdStatus rz_core_bin_plugins_print(RzBin *bin, RzCmdStateOutput *state)
#define IS_MODE_SET(mode)
RZ_API void rz_core_bin_options_init(RzCore *core, RZ_OUT RzBinOptions *opts, int fd, ut64 baseaddr, ut64 loadaddr)
RZ_API bool rz_core_bin_apply_imports(RzCore *core, RzBinFile *binfile, bool va)
#define wrap_mode(header, default_mode, method)
static void digests_ht_free(HtPPKv *kv)
RZ_API bool rz_core_bin_cur_section_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state, RzList *hashes)
static void table_add_row_bool(RzTable *t, const char *key, bool val)
static void bin_elf_versioninfo(RzCore *r, PJ *pj, int mode)
static bool is_executable(RzBinObject *obj)
static RzCmdStateOutput * add_header(RzCmdStateOutput *main_state, RzOutputMode default_mode, const char *header)
static int bin_versioninfo(RzCore *r, PJ *pj, int mode)
RZ_API RZ_OWN char * rz_core_bin_method_build_flag_name(RZ_NONNULL RzBinClass *cls, RZ_NONNULL RzBinSymbol *meth)
Returns the flag name of a class method.
#define MAXFLAG_LEN_DEFAULT
#define CXX_BIN_VISIBILITY_FLAGS
static char * construct_reloc_name(RZ_NONNULL RzBinReloc *reloc, RZ_NULLABLE const char *name)
static void bin_memory_print_rec(RzCmdStateOutput *state, RzBinMem *mirror, const RzList *mems, int perms)
RZ_API RZ_BORROW const char * rz_core_bin_get_compile_time(RZ_NONNULL RzBinFile *bf)
Get TimeDateStamp string from bf->sdb with key "info.image_file_header.TimeDateStamp_string".
RZ_API bool rz_core_bin_strings_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API bool rz_core_bin_symbols_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state, RzCoreBinFilter *filter)
RZ_API bool rz_core_bin_apply_resources(RzCore *core, RzBinFile *binfile)
RZ_API bool rz_core_bin_classes_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API bool rz_core_bin_apply_strings(RzCore *r, RzBinFile *binfile)
RZ_API RZ_OWN char * rz_core_bin_pdb_get_filename(RZ_NONNULL RzCore *core)
static void bin_resources_print_standard(RzCore *core, RzList *hashes, RzBinResource *resource)
static void bin_resources_print_table(RzCore *core, RzCmdStateOutput *state, RzList *hashes, RzBinResource *resource)
static ut8 bin_reloc_size(RzBinReloc *reloc)
#define IS_MODE_RZCMD(mode)
RZ_API bool rz_core_bin_dwarf_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API bool rz_core_bin_cur_segment_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state, RzList *hashes)
static bool symbols_print(RzCore *core, RzBinFile *bf, RzCmdStateOutput *state, RzCoreBinFilter *filter, bool only_export)
static bool bin_dwarf(RzCore *core, RzBinFile *binfile, RzCmdStateOutput *state)
static void handle_arm_hint(RzCore *core, RzBinObject *o, ut64 paddr, ut64 vaddr, int bits, int va)
RZ_API bool rz_core_bin_class_fields_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state, const char *class_name)
static RzIODesc * find_reusable_file(RzIO *io, RzCoreFile *cf, const char *uri, int perm)
RZ_API bool rz_core_bin_raise(RzCore *core, ut32 bfid)
static void sections_headers_setup(RzCore *core, RzCmdStateOutput *state, RzList *hashes)
RZ_API bool rz_core_bin_apply_entry(RzCore *core, RzBinFile *binfile, bool va)
static void sections_print_json(RzCore *core, PJ *pj, RzBinObject *o, RzBinSection *section, RzList *hashes)
RZ_API bool rz_core_bin_load_structs(RZ_NONNULL RzCore *core, RZ_NONNULL const char *file)
static void bin_pe_versioninfo(RzCore *r, PJ *pj, int mode)
static void core_bin_file_print(RzCore *core, RzBinFile *bf, RzCmdStateOutput *state)
static char * demangle_type(const char *any)
static void bin_elf_versioninfo_versym(RzCore *r, PJ *pj, int mode)
RZ_IPI RzCmdStatus rz_core_binxtr_plugin_print(const RzBinXtrPlugin *bx, RzCmdStateOutput *state)
RZ_API int rz_core_bin_set_arch_bits(RzCore *r, const char *name, const char *arch, ut16 bits)
static void print_arch(RzBin *bin, RzCmdStateOutput *state, struct arch_ctx *ctx, const char *flag, RzBinInfo *info)
static void sdb_concat_by_path(Sdb *s, const char *path)
RZ_API bool rz_core_file_info_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *binfile, RZ_NONNULL RzCmdStateOutput *state)
static const char * str2na(const char *s)
static char * resolveModuleOrdinal(Sdb *sdb, const char *module, int ordinal)
RZ_API void rz_core_sym_name_fini(RZ_NULLABLE RzBinSymNames *sn)
RZ_FREE all member of sn (sn->*)
static void handle_arm_special_symbol(RzCore *core, RzBinObject *o, RzBinSymbol *symbol, int va)
RZ_API bool rz_core_bin_sections_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state, RzCoreBinFilter *filter, RzList *hashes)
static char * construct_symbol_flagname(const char *pfx, const char *libname, const char *symname, int len)
static bool is_section_symbol(RzBinSymbol *s)
RZ_API bool rz_core_bin_imports_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state, RzCoreBinFilter *filter)
static void classdump_cpp(RzCore *r, RzBinClass *c)
static bool entries_initfini_print(RzCore *core, RzBinFile *bf, RzCmdStateOutput *state, bool initfini)
#define is_invalid_address_va2(va, vaddr, paddr)
RZ_API bool rz_core_bin_apply_classes(RzCore *core, RzBinFile *binfile)
static void handle_arm_symbol(RzCore *core, RzBinObject *o, RzBinSymbol *symbol, int va)
static bool digests_pj_cb(void *user, const void *k, const void *v)
static ut64 rva(RzBinObject *o, ut64 paddr, ut64 vaddr, int va)
static char * __filterQuotedShell(const char *arg)
static void flags_to_json(PJ *pj, int flags)
RZ_API bool rz_core_bin_basefind_print(RzCore *core, ut32 pointer_size, RzCmdStateOutput *state)
RZ_API bool rz_core_bin_pdb_load(RZ_NONNULL RzCore *core, RZ_NONNULL const char *filename)
RZ_API bool rz_core_bin_versions_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API bool rz_core_bin_apply_all_info(RzCore *r, RzBinFile *binfile)
RZ_API bool rz_core_bin_trycatch_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API bool rz_core_bin_main_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state)
RZ_API bool rz_core_bin_class_methods_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzCmdStateOutput *state, const char *class_name)
RZ_API bool rz_analysis_cc_exist(RzAnalysis *analysis, const char *convention)
RZ_API void rz_core_bin_dwarf_print_abbrev_section(const RzBinDwarfDebugAbbrev *da)
RZ_API void rz_core_bin_dwarf_print_debug_info(const RzBinDwarfDebugInfo *inf)
RZ_API void rz_core_bin_dwarf_print_line_units(RzList *lines)
RZ_API void rz_core_bin_dwarf_print_aranges(RzList *aranges)
RZ_API void rz_core_bin_dwarf_print_loc(HtUP *loc_table, int addr_size)
RZ_API ut32 rz_core_file_cur_fd(RzCore *core)
RZ_IPI RzCoreIOMapInfo * rz_core_io_map_info_new(RzCoreFile *cf, int perm_orig)
RZ_API RzCoreFile * rz_core_file_find_by_fd(RzCore *core, ut64 fd)
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 RzCmdStatus rz_core_cmd_rzshell(RzCore *core, const char *cstr, int log)
RZ_API void rz_cmd_state_output_free(RZ_NONNULL RzCmdStateOutput *state)
Free the RzCmdStateOutput structure and its inner fields appropriately.
RZ_API bool rz_cmd_state_output_init(RZ_NONNULL RzCmdStateOutput *state, RzOutputMode mode)
Initialize a RzCmdStateOutput structure and its inner fields based on the provided mode.
RZ_API void rz_cmd_state_output_set_columnsf(RzCmdStateOutput *state, const char *fmt,...)
Specify the columns of the command output.
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 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 void rz_cons_newline(void)
RZ_API void rz_cons_break_pop(void)
RZ_API void rz_cons_break_push(RzConsBreak cb, void *user)
RZ_API int rz_cons_printf(const char *format,...)
RZ_API const char * rz_cons_get_buffer(void)
Return the current RzCons buffer.
RZ_API int rz_cons_get_cur_line(void)
RZ_API void rz_cons_flush(void)
RZ_API bool rz_cons_is_breaked(void)
RZ_API void rz_cons_println(const char *str)
RZ_API void rz_cons_gotoxy(int x, int y)
RZ_API void rz_cons_pop(void)
RZ_API void rz_cons_push(void)
RZ_API void rz_core_pdb_info_print(RZ_NONNULL RzCore *core, RZ_NONNULL RzTypeDB *db, RZ_NONNULL RzPdb *pdb, RZ_NONNULL RzCmdStateOutput *state)
Print parsed PDB file info.
RZ_API RzPdb * rz_core_pdb_load_info(RZ_NONNULL RzCore *core, RZ_NONNULL const char *file)
Parse PDB file info and integrate with typedb.
static static fork const void static count static fd const char const char static newpath const char static path const char path
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 key
RZ_API RzBinDwarfDebugAbbrev * rz_bin_dwarf_parse_abbrev(RzBinFile *binfile)
RZ_API void rz_bin_dwarf_debug_abbrev_free(RzBinDwarfDebugAbbrev *da)
RZ_API void rz_bin_dwarf_line_info_free(RzBinDwarfLineInfo *li)
RZ_API void rz_bin_dwarf_loc_free(HtUP *loc_table)
RZ_API RzList * rz_bin_dwarf_parse_aranges(RzBinFile *binfile)
RZ_API RzBinDwarfDebugInfo * rz_bin_dwarf_parse_info(RzBinFile *binfile, RzBinDwarfDebugAbbrev *da)
Parses .debug_info section.
RZ_API HtUP * rz_bin_dwarf_parse_loc(RzBinFile *binfile, int addr_size)
Parses out the .debug_loc section into a table that maps each list as offset of a list -> LocationLis...
RZ_API void rz_bin_dwarf_debug_info_free(RzBinDwarfDebugInfo *inf)
RZ_API RzBinDwarfLineInfo * rz_bin_dwarf_parse_line(RzBinFile *binfile, RZ_NULLABLE RzBinDwarfDebugInfo *info, RzBinDwarfLineInfoMask mask)
RZ_API void rz_analysis_dwarf_process_info(const RzAnalysis *analysis, RzAnalysisDwarfContext *ctx)
Parses type and function information out of DWARF entries and stores them to the sdb for further use.
size_t map(int syms, int left, int len)
RZ_API void rz_flag_item_set_comment(RzFlagItem *item, const char *comment)
RZ_API RzFlagItem * rz_flag_set_next(RzFlag *f, const char *name, ut64 off, ut32 size)
RZ_API RzFlagItem * rz_flag_get(RzFlag *f, const char *name)
RZ_API RzFlagItem * rz_flag_set(RzFlag *f, const char *name, ut64 off, ut32 size)
RZ_API bool rz_flag_unset(RzFlag *f, RzFlagItem *item)
RZ_API void rz_flag_item_set_realname(RzFlagItem *item, const char *realname)
RZ_API char * sdb_fmt(const char *fmt,...)
unsigned short prefix[65536]
RZ_API RZ_OWN char * rz_hash_cfg_calculate_small_block_string(RZ_NONNULL RzHash *rh, RZ_NONNULL const char *name, RZ_NONNULL const ut8 *buffer, ut64 bsize, RZ_NULLABLE ut32 *size, bool invert)
RZ_API RZ_BORROW const RzHashPlugin * rz_hash_plugin_by_name(RZ_NONNULL RzHash *rh, RZ_NONNULL const char *name)
RZ_API void rz_analysis_hint_clear(RzAnalysis *a)
RZ_API void rz_analysis_hint_set_bits(RzAnalysis *a, ut64 addr, int bits)
RZ_API void rz_analysis_hint_set_size(RzAnalysis *a, ut64 addr, ut64 size)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API const KEY_TYPE bool * found
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
RZ_API RZ_OWN char * rz_demangler_java(RZ_NULLABLE const char *symbol)
Demangles java symbols.
static void list(RzEgg *egg)
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
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 dup
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
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
static const char struct stat static buf struct stat static buf static vhangup int status
#define ls_foreach(list, it, pos)
#define header(is_bt, len_min, ret_op)
RZ_API void MACH0_() patch_relocs(RzBinFile *bf, struct MACH0_(obj_t) *obj)
Patching of external relocs in a sparse overlay buffer.
RZ_API Sdb * sdb_ns_path(Sdb *s, const char *path, int create)
RZ_API Sdb * sdb_ns(Sdb *s, const char *name, int create)
RZ_API int sdb_num_add(Sdb *s, const char *key, ut64 v, ut32 cas)
RZ_API ut64 sdb_num_get(Sdb *s, const char *key, ut32 *cas)
RZ_API void rz_bin_pdb_free(RzPdb *pdb)
Free PDB instance.
static int is_arm(RzBinPEObj *bin)
#define RZ_ANALYSIS_ARCHINFO_ALIGN
#define RZ_ANALYSIS_ARCHINFO_MAX_OP_SIZE
#define RZ_ANALYSIS_ARCHINFO_MIN_OP_SIZE
#define rz_warn_if_reached()
#define rz_warn_if_fail(expr)
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
RZ_API ut8 * rz_base64_decode_dyn(const char *in, int len)
#define RZ_BIN_DBG_RELOCS
#define RZ_BIN_DBG_STRIPPED
#define RZ_BIN_METH_VIRTUAL
#define RZ_BIN_ENTRY_TYPE_PREINIT
#define RZ_BIN_TYPE_OBJECT_STR
#define RZ_BIN_METH_PUBLIC
#define RZ_BIN_TYPE_NOTYPE_STR
#define RZ_BIN_TYPE_METH_STR
#define RZ_BIN_ENTRY_TYPE_FINI
@ RZ_BIN_SPECIAL_SYMBOL_MAIN
#define RZ_BIN_ENTRY_TYPE_INIT
static bool rz_bin_reloc_storage_targets_available(RzBinRelocStorage *storage)
return true iff there is at least one reloc in the storage with a target address
#define RZ_BIN_ENTRY_TYPE_PROGRAM
static bool rz_bin_reloc_has_target(RzBinReloc *reloc)
#define RZ_BIN_METH_CONST
#define RZ_BIN_BIND_GLOBAL_STR
#define RZ_BIN_METH_STATIC
#define RZ_BIN_METH_PRIVATE
#define RZ_BIN_METH_PROTECTED
#define RZ_BIN_TYPE_FILE_STR
#define RZ_BIN_TYPE_SECTION_STR
#define RZ_BIN_DBG_LINENUMS
#define RZ_BIN_TYPE_SPECIAL_SYM_STR
@ RZ_BIN_DWARF_LINE_INFO_MASK_OPS
@ RZ_BIN_DWARF_LINE_INFO_MASK_LINES
RZ_API st64 rz_buf_write_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL const ut8 *buf, ut64 len)
Write len bytes of the buffer at the specified address.
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_io_fd(RZ_NONNULL void *iob, int fd)
Creates a new buffer wrapping a file descriptor accessed through RzIOBind.
RZ_API void rz_buf_free(RzBuffer *b)
Free all internal data hold by the buffer and the buffer.
enum rz_cmd_status_t RzCmdStatus
@ RZ_CMD_STATUS_OK
command handler exited in the right way
@ RZ_CMD_STATUS_NONEXISTINGCMD
command does not exist
@ RZ_CMD_STATUS_ERROR
command handler had issues while running (e.g. allocation error, etc.)
#define RZ_FLAGS_FS_IMPORTS
#define RZ_FLAGS_FS_SYMBOLS_SECTIONS
#define RZ_FLAGS_FS_STRINGS
#define RZ_FLAGS_FS_CLASSES
#define RZ_FLAGS_FS_SECTIONS
#define RZ_FLAGS_FS_RELOCS
#define RZ_FLAGS_FS_SYMBOLS
#define RZ_FLAGS_FS_SEGMENTS
#define RZ_FLAGS_FS_RESOURCES
RZ_API const char * rz_file_dos_basename(RZ_BORROW RZ_NONNULL const char *path)
RZ_API bool rz_file_exists(const char *str)
RZ_API char * rz_file_dirname(const char *path)
RZ_API RZ_OWN char * rz_file_path_join(RZ_NONNULL const char *s1, RZ_NULLABLE const char *s2)
Concatenate two paths to create a new one with s1+s2 with the correct path separator.
#define RZ_FLAG_NAME_SIZE
RZ_API char * rz_hex_bin2strdup(const ut8 *in, int len)
RZ_API bool rz_io_read_at(RzIO *io, ut64 addr, ut8 *buf, int len)
RZ_API RzIODesc * rz_io_open_at(RzIO *io, const char *uri, int flags, int mode, ut64 at, RZ_NULLABLE RZ_OUT RzIOMap **map)
Open a file and directly map it at the given offset.
RZ_API ut64 rz_io_desc_size(RzIODesc *desc)
RZ_API RzIOMap * rz_io_map_add_batch(RzIO *io, int fd, int flags, ut64 delta, ut64 addr, ut64 size)
RZ_API RzIOMap * rz_io_map_get(RzIO *io, ut64 addr)
RZ_API RzIODesc * rz_io_desc_get(RzIO *io, int fd)
RZ_API int rz_io_fd_get_current(RzIO *io)
RZ_API RzIODesc * rz_io_open_nomap(RzIO *io, const char *uri, int flags, int mode)
RZ_API bool rz_io_use_fd(RzIO *io, int fd)
RZ_API int rz_io_pread_at(RzIO *io, ut64 paddr, ut8 *buf, int len)
RZ_API bool rz_io_desc_is_dbg(RzIODesc *desc)
RZ_API bool rz_io_desc_close(RzIODesc *desc)
#define RZ_LOG_WARN(fmtstr,...)
#define RZ_LOG_ERROR(fmtstr,...)
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 char * rz_num_units(char *buf, size_t len, ut64 number)
RZ_API RZ_OWN char * rz_path_system(RZ_NULLABLE const char *path)
Return the full system path of the given subpath path.
RZ_API void pj_raw(PJ *j, const char *k)
RZ_API PJ * pj_j(PJ *j, const char *k)
RZ_API PJ * pj_ko(PJ *j, const char *k)
RZ_API PJ * pj_ka(PJ *j, const char *k)
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_n(PJ *j, ut64 n)
RZ_API PJ * pj_kr(PJ *j, const char *k, const ut8 *v, size_t v_len)
RZ_API PJ * pj_kn(PJ *j, const char *k, ut64 n)
RZ_API PJ * pj_kN(PJ *j, const char *k, st64 n)
RZ_API int rz_regex_match(const char *pattern, const char *flags, const char *text)
RZ_API bool rz_spaces_push(RzSpaces *sp, const char *name)
RZ_API bool rz_spaces_pop(RzSpaces *sp)
RZ_API int rz_str_utf16_to_utf8(ut8 *dst, int len_dst, const ut8 *src, int len_src, bool little_endian)
#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)
static const char * rz_str_get(const char *str)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API RZ_BORROW char * rz_str_trim_tail(RZ_NONNULL char *str)
Removes whitespace characters (space, tab, newline etc.) from the end of a string and replaces them w...
RZ_API char * rz_str_escape_utf8_keep_printable(const char *buf, RzStrEscOptions *opt)
RZ_API const char * rz_str_rchr(const char *base, const char *p, int ch)
RZ_API const char * rz_str_bool(int b)
RZ_API bool rz_str_is_utf8(RZ_NONNULL const char *str)
Returns true if the input string is correctly UTF-8-encoded.
RZ_API void rz_str_case(char *str, bool up)
RZ_API const char * rz_str_enc_as_string(RzStrEnc enc)
static const char * rz_str_get_null(const char *str)
#define RZ_STR_ISEMPTY(x)
RZ_API char * rz_str_escape_utf8(const char *buf, RzStrEscOptions *opt)
RZ_API char * rz_str_replace(char *str, const char *key, const char *val, int g)
RZ_API int rz_str_replace_ch(char *s, char a, char b, bool g)
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_list_join(RzList *str, const char *sep)
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
RZ_API RZ_OWN char * rz_strbuf_drain_nofree(RzStrBuf *sb)
RZ_API const char * rz_strbuf_set(RzStrBuf *sb, const char *s)
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
RZ_API bool rz_strbuf_append(RzStrBuf *sb, const char *s)
RZ_API const char * rz_strbuf_initf(RzStrBuf *sb, const char *fmt,...)
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
RZ_API void rz_strbuf_free(RzStrBuf *sb)
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API bool rz_strbuf_is_empty(RzStrBuf *sb)
RZ_API void rz_table_hide_header(RzTable *t)
RZ_API void rz_table_add_rowf(RzTable *t, const char *fmt,...)
RZ_API void rz_table_free(RzTable *t)
RZ_API bool rz_table_query(RzTable *t, const char *q)
RZ_API void rz_table_add_row_columnsf(RzTable *t, const char *fmt,...)
RZ_API void rz_table_set_columnsf(RzTable *t, const char *fmt,...)
Specify the types and names of the referenced table.
RZ_API char * rz_table_tostring(RzTable *t)
RZ_API RzTable * rz_table_new(void)
RZ_API RzTableColumnType * rz_table_type(const char *name)
#define RZ_JOIN_3_PATHS(p1, p2, p3)
RzOutputMode
Enum to describe the way data are printed.
@ RZ_OUTPUT_MODE_LONG_JSON
@ RZ_OUTPUT_MODE_QUIETEST
@ RZ_OUTPUT_MODE_STANDARD
#define RZ_BETWEEN(x, y, z)
#define UT64_ADD_OVFCHK(x, y)
RZ_API int * rz_utf_block_list(const ut8 *str, int len, int **freq_list)
RZ_API const char * rz_utf_block_name(int idx)
#define rz_vector_foreach(vec, it)
static void ** rz_pvector_push(RzPVector *vec, void *x)
RZ_API void rz_vector_free(RzVector *vec)
#define rz_pvector_foreach(vec, it)
RZ_API Sdb * sdb_new(const char *path, const char *name, int lock)
RZ_API void sdb_close(Sdb *s)
RZ_API char * sdb_get(Sdb *s, const char *key, ut32 *cas)
RZ_API bool sdb_merge(Sdb *d, Sdb *s)
RZ_API bool sdb_free(Sdb *s)
RZ_API const char * sdb_const_get(Sdb *s, const char *key, ut32 *cas)
RZ_API SdbList * sdb_foreach_list(Sdb *s, bool sorted)
static char * sdbkv_key(const SdbKv *kv)
static char * sdbkv_value(const SdbKv *kv)
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 flags
Line info of all compilation units from the entire debug_line section.
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>\\"
ut32 n_threads
Total number of search threads.
ut64 current_address
Thread related search address (current).
ut32 percentage
Progress made by the search thread.
ut32 thread_idx
Sesarch thread number.
ut64 end_address
Thread related search address (end).
ut64 candidate
Candidate physical base address.
ut32 score
Score of the candidate address.
ut64 baseaddr
where the linker maps the binary in memory
XX curplugin == o->plugin.
RZ_DEPRECATE Sdb * sdb
deprecated, put info in C structures instead of this
int fd
when used in combination with RzIO, this refers to the io fd.
struct rz_bin_xtr_plugin_t * curxtr
Description of a single memory mapping into virtual memory from a binary.
RzBinObjectLoadOptions opts
RzBinSourceLineInfo * lines
RZ_DEPRECATE RZ_BORROW Sdb * kv
deprecated, put info in C structures instead of this (holds a copy of another pointer....
RzBinRelocStorage * relocs
void(* header)(RzBinFile *bf)
char *(* signature)(RzBinFile *bf, bool json)
Efficient storage of relocations to query by address.
ut64 paddr
the paddr where the value should be patched into
ut64 vaddr
the vaddr where the value should be patched into
ut64 target_vaddr
the target address that the patched reloc points to
RzBinSourceLineSample * samples
All source line references for given adresses.
A single sample of source line info for a specific address.
Store some display name from RzBinSymbol.
char * methname
methods [class]::[method]
char * demname
demangled raw symbol name
char * methflag
methods flag sym.[class].[method]
char * nameflag
flag name for symbol
char * symbolname
display symbol name
char * classname
classname
char * libname
name of the lib this symbol is specific to, if any
char * demflag
flag name for demangled symbol
Represent the output state of a command handler.
union rz_cmd_state_output_t::@259 d
RzPVector extra_files
additional files opened during mapping, for example for zeroed maps
void * user
Uninterpreted data to be injected from outside.
RZ_API size_t rz_th_request_physical_cores(size_t max_cores)
Returns the maximum number of cores available regardless of the number of cores requested....
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const z80_opcode fd[]