summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-08-13 19:19:40 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-08-13 19:19:40 (GMT)
commitf0ef296d23bcefffcfc292c5d8e6143d700f46fc (patch)
treecb40f1ce46810ed4e8e45c21481f415f2917ebc8 /src/analysis/disass
parente554e315b762d564b4e370fa77a26ef6a4a67ccc (diff)
Listed all errors occurred while loading a binary file.
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/area.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c
index b76b5ec..7939290 100644
--- a/src/analysis/disass/area.c
+++ b/src/analysis/disass/area.c
@@ -985,12 +985,15 @@ static void fill_mem_area(mem_area *area, mem_area *list, size_t count, GProcCon
{
const vmpa2t *addr; /* Début de la zone à traiter */
phys_t len; /* Taille de la zone à remplir */
+ bool err_trigger; /* Présence d'une instruction */
phys_t i; /* Boucle de parcours */
vmpa2t start; /* Adresse de départ de combles*/
addr = get_mrange_addr(&area->range);
len = get_mrange_length(&area->range);
+ err_trigger = true;
+
for (i = 0; i < len; i++)
{
if (is_range_empty_in_mem_area(area, i, 1))
@@ -1002,10 +1005,25 @@ static void fill_mem_area(mem_area *area, mem_area *list, size_t count, GProcCon
load_code_from_mem_area(area, list, count, ctx, &start, false, status, id);
if (is_range_empty_in_mem_area(area, i, 1))
+ {
+ if (area->is_exec && err_trigger)
+ {
+ g_arch_processor_add_error(area->proc, APE_DISASSEMBLY, &start,
+ _("Unable to disassemble code instruction"));
+
+ err_trigger = false;
+
+ }
+
load_data_from_mem_area(area, ctx, &start, status, id);
+ }
+
}
+ else
+ err_trigger = true;
+
assert(is_range_busy_in_mem_area(area, i, 1));
}