diff options
Diffstat (limited to 'src/analysis/disass')
-rw-r--r-- | src/analysis/disass/area.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c index bdfb1b2..5478fe3 100644 --- a/src/analysis/disass/area.c +++ b/src/analysis/disass/area.c @@ -947,6 +947,12 @@ void insert_extra_symbol_into_mem_areas(mem_area *areas, size_t count, const GBi } + /** + * Un symbole (au sens large) ne peut avoir une adresse virtuelle que s'il + * est compris dans une zone chargée en mémoire (en toute logique). + */ + assert(has_virt_addr(get_mrange_addr(&area->range)) == has_virt_addr(addr)); + /* L'instruction est-elle accueillie dans son intégralité ? */ start = compute_vmpa_diff(get_mrange_addr(&area->range), addr); @@ -1238,7 +1244,7 @@ static void g_area_collector_do_compute(GAreaCollector *collector, GtkStatusStac } - void fill_gap(vmpa2t *old, vmpa2t *new, bool exec) + void fill_gap(vmpa2t *old, vmpa2t *new, bool alloc, bool exec) { phys_t diff; /* Espace entre bordures */ mem_area *area; /* Zone avec valeurs à éditer */ @@ -1252,6 +1258,9 @@ static void g_area_collector_do_compute(GAreaCollector *collector, GtkStatusStac if (diff > 0) { + if (!alloc) + reset_virt_addr(old); + /* Zone tampon à constituer */ *list = (mem_area *)realloc(*list, ++(*count) * sizeof(mem_area)); @@ -1326,7 +1335,7 @@ static void g_area_collector_do_compute(GAreaCollector *collector, GtkStatusStac if (on_track) { rights = (parent != NULL ? g_binary_portion_get_rights(parent) : PAC_NONE); - fill_gap(&prev, &border, rights & PAC_EXEC); + fill_gap(&prev, &border, rights != PAC_NONE, rights & PAC_EXEC); } else copy_vmpa(&prev, &border); @@ -1342,12 +1351,12 @@ static void g_area_collector_do_compute(GAreaCollector *collector, GtkStatusStac if (on_track) { rights = (parent != NULL ? g_binary_portion_get_rights(parent) : PAC_NONE); - fill_gap(&prev, &border, rights & PAC_EXEC); + fill_gap(&prev, &border, rights != PAC_NONE, rights & PAC_EXEC); compute_mrange_end_addr(range, &border); rights = g_binary_portion_get_rights(portion); - fill_gap(&prev, &border, rights & PAC_EXEC); + fill_gap(&prev, &border, rights != PAC_NONE, rights & PAC_EXEC); } else @@ -1367,7 +1376,7 @@ static void g_area_collector_do_compute(GAreaCollector *collector, GtkStatusStac if (on_track) { rights = (parent != NULL ? g_binary_portion_get_rights(parent) : PAC_NONE); - fill_gap(&prev, &border, rights & PAC_EXEC); + fill_gap(&prev, &border, rights != PAC_NONE, rights & PAC_EXEC); } else copy_vmpa(&prev, &border); |