Fix #4095 - Export RBinSection info for mach0.la_symbol_ptr

This commit is contained in:
pancake 2016-02-16 02:58:29 +01:00
parent de4cbb47ad
commit 3140749266
3 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2009-2015 - pancake */
/* radare - LGPL - Copyright 2009-2016 - pancake */
#include <r_types.h>
#include <r_util.h>
@ -101,6 +101,15 @@ static RList* sections(RBinFile *arch) {
if (!(ptr = R_NEW0 (RBinSection)))
break;
strncpy (ptr->name, (char*)sections[i].name, R_BIN_SIZEOF_STRINGS);
if (strstr (ptr->name, "la_symbol_ptr")) {
#ifndef R_BIN_MACH064
const int sz = 4;
#else
const int sz = 8;
#endif
int len = sections[i].size / sz;
ptr->format = r_str_newf ("Cd %d[%d]", sz, len);
}
ptr->name[R_BIN_SIZEOF_STRINGS] = 0;
ptr->size = sections[i].size;
ptr->vsize = sections[i].size;

View File

@ -1446,6 +1446,9 @@ static int bin_sections(RCore *r, int mode, ut64 laddr, int va, ut64 at, const c
}
#endif
r_name_filter (section->name, 128);
if (section->format) {
r_core_cmdf (r, "%s @ 0x%"PFMT64x, section->format, section->vaddr);
}
if (r->bin->prefix) {
snprintf (str, sizeof(str)-1, "%s.section.%s",
r->bin->prefix, section->name);

View File

@ -280,6 +280,7 @@ typedef struct r_bin_section_t {
ut32 srwx;
// per section platform info
const char *arch;
char *format;
int bits;
bool has_strings;
bool add; // indicates when you want to add the section to io `S` command