mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-04 12:36:30 +00:00
Show column headers in RBin info (r2con) (#11444)
This commit is contained in:
parent
95f75f3aa9
commit
9b69f8261f
@ -179,6 +179,10 @@ static void _print_strings(RCore *r, RList *list, int mode, int va) {
|
|||||||
r_flag_space_set (r->flags, "strings");
|
r_flag_space_set (r->flags, "strings");
|
||||||
r_cons_break_push (NULL, NULL);
|
r_cons_break_push (NULL, NULL);
|
||||||
}
|
}
|
||||||
|
if (IS_MODE_NORMAL (mode)) {
|
||||||
|
r_cons_printf ("[Strings]\n");
|
||||||
|
r_cons_printf ("Num Vaddr Paddr Len Size Section Type String\n");
|
||||||
|
}
|
||||||
RBinString b64 = {0};
|
RBinString b64 = {0};
|
||||||
r_list_foreach (list, iter, string) {
|
r_list_foreach (list, iter, string) {
|
||||||
const char *section_name, *type_string;
|
const char *section_name, *type_string;
|
||||||
@ -325,7 +329,7 @@ static void _print_strings(RCore *r, RList *list, int mode, int va) {
|
|||||||
r_cons_printf ("%03u 0x%08"PFMT64x" 0x%08"
|
r_cons_printf ("%03u 0x%08"PFMT64x" 0x%08"
|
||||||
PFMT64x" %3u %3u "
|
PFMT64x" %3u %3u "
|
||||||
"(%s) %5s %s",
|
"(%s) %5s %s",
|
||||||
string->ordinal, paddr, vaddr,
|
string->ordinal, paddr, vaddr,
|
||||||
string->length, string->size,
|
string->length, string->size,
|
||||||
section_name, type_string, str);
|
section_name, type_string, str);
|
||||||
#endif
|
#endif
|
||||||
@ -1653,6 +1657,7 @@ static int bin_imports(RCore *r, int mode, int va, const char *name) {
|
|||||||
r_cons_println ("fs imports");
|
r_cons_println ("fs imports");
|
||||||
} else if (IS_MODE_NORMAL (mode)) {
|
} else if (IS_MODE_NORMAL (mode)) {
|
||||||
r_cons_println ("[Imports]");
|
r_cons_println ("[Imports]");
|
||||||
|
r_cons_println ("Num Vaddr Bind Type Name");
|
||||||
}
|
}
|
||||||
r_list_foreach (imports, iter, import) {
|
r_list_foreach (imports, iter, import) {
|
||||||
if (name && strcmp (import->name, name)) {
|
if (name && strcmp (import->name, name)) {
|
||||||
@ -1876,6 +1881,9 @@ static int bin_symbols_internal(RCore *r, int mode, ut64 laddr, int va, ut64 at,
|
|||||||
r_cons_printf (printHere ? "" : "[Symbols]\n");
|
r_cons_printf (printHere ? "" : "[Symbols]\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (IS_MODE_NORMAL (mode)) {
|
||||||
|
r_cons_printf ("Num Paddr Vaddr Bind Type Size Name\n");
|
||||||
|
}
|
||||||
|
|
||||||
r_list_foreach (symbols, iter, symbol) {
|
r_list_foreach (symbols, iter, symbol) {
|
||||||
ut64 addr = rva (r->bin, symbol->paddr, symbol->vaddr, va);
|
ut64 addr = rva (r->bin, symbol->paddr, symbol->vaddr, va);
|
||||||
@ -2172,7 +2180,7 @@ static int bin_sections(RCore *r, int mode, ut64 laddr, int va, ut64 at, const c
|
|||||||
if (!dup_chk_ht) {
|
if (!dup_chk_ht) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chksum && *chksum == '.') {
|
if (chksum && *chksum == '.') {
|
||||||
printHere = true;
|
printHere = true;
|
||||||
}
|
}
|
||||||
@ -2188,6 +2196,10 @@ static int bin_sections(RCore *r, int mode, ut64 laddr, int va, ut64 at, const c
|
|||||||
fd = r_core_file_cur_fd (r);
|
fd = r_core_file_cur_fd (r);
|
||||||
r_flag_space_set (r->flags, print_segments ? "segments" : "sections");
|
r_flag_space_set (r->flags, print_segments ? "segments" : "sections");
|
||||||
}
|
}
|
||||||
|
if (IS_MODE_NORMAL (mode)) {
|
||||||
|
r_cons_printf ("Nm Paddr Size Vaddr Memsz Perms %sName\n",
|
||||||
|
chksum ? "Checksum " : "");
|
||||||
|
}
|
||||||
r_list_foreach (sections, iter, section) {
|
r_list_foreach (sections, iter, section) {
|
||||||
char perms[] = "----";
|
char perms[] = "----";
|
||||||
int va_sect = va;
|
int va_sect = va;
|
||||||
@ -3388,7 +3400,7 @@ R_API int r_core_bin_info(RCore *core, int action, int mode, int va, RCoreBinFil
|
|||||||
if (filter && filter->name) {
|
if (filter && filter->name) {
|
||||||
name = filter->name;
|
name = filter->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// use our internal values for va
|
// use our internal values for va
|
||||||
va = va ? VA_TRUE : VA_FALSE;
|
va = va ? VA_TRUE : VA_FALSE;
|
||||||
#if 0
|
#if 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user