mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-03 10:51:01 +00:00
Use size or vsize consistently in iS. ##core
Now the size is virtual or physical consistently with the chosen address. This makes it possible to get correct ouput for `iS.` on addresses belonging to sections which have different `vsize` than `size` (like for example bss sections).
This commit is contained in:
parent
116b4a51c1
commit
b8e7e0d583
@ -3077,22 +3077,22 @@ static bool bin_sections(RCore *r, PJ *pj, int mode, ut64 laddr, int va, ut64 at
|
|||||||
r_list_foreach (sections, iter, section) {
|
r_list_foreach (sections, iter, section) {
|
||||||
char perms[] = "----";
|
char perms[] = "----";
|
||||||
int va_sect = va;
|
int va_sect = va;
|
||||||
ut64 addr;
|
ut64 addr, size;
|
||||||
|
|
||||||
if (va && !(section->perm & R_PERM_R)) {
|
if (va && !(section->perm & R_PERM_R)) {
|
||||||
va_sect = VA_NOREBASE;
|
va_sect = VA_NOREBASE;
|
||||||
}
|
}
|
||||||
addr = rva (r->bin, section->paddr, section->vaddr, va_sect);
|
addr = rva (r->bin, section->paddr, section->vaddr, va_sect);
|
||||||
|
size = va ? section->vsize : section->size;
|
||||||
if (name && strcmp (section->name, name)) {
|
if (name && strcmp (section->name, name)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (printHere && !(addr <= r->offset && r->offset < (addr + section->size))) {
|
if (printHere && !(addr <= r->offset && r->offset < (addr + size))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (at != UT64_MAX && (!section->size || !is_in_range (at, addr, section->size))) {
|
if (at != UT64_MAX && (!size || !is_in_range (at, addr, size))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3160,7 +3160,7 @@ static bool bin_sections(RCore *r, PJ *pj, int mode, ut64 laddr, int va, ut64 at
|
|||||||
str = r_str_newf ("%s.%s", type, section->name);
|
str = r_str_newf ("%s.%s", type, section->name);
|
||||||
}
|
}
|
||||||
r_name_filter (str, R_FLAG_NAME_SIZE);
|
r_name_filter (str, R_FLAG_NAME_SIZE);
|
||||||
ut64 size = r->io->va? section->vsize: section->size;
|
|
||||||
r_flag_set (r->flags, str, addr, size);
|
r_flag_set (r->flags, str, addr, size);
|
||||||
R_FREE (str);
|
R_FREE (str);
|
||||||
|
|
||||||
|
@ -75,3 +75,11 @@ EXPECT=<<EOF
|
|||||||
ffffffffffffffffffff
|
ffffffffffffffffffff
|
||||||
EOF
|
EOF
|
||||||
RUN
|
RUN
|
||||||
|
|
||||||
|
NAME=sections list here bss
|
||||||
|
FILE=bins/elf/analysis/main_wrong_sect
|
||||||
|
CMDS=iS.@0x00600914~bss~?
|
||||||
|
EXPECT=<<EOF
|
||||||
|
1
|
||||||
|
EOF
|
||||||
|
RUN
|
||||||
|
Loading…
Reference in New Issue
Block a user