diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-07-15 10:30:30 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-07-15 10:30:30 (GMT) |
commit | ba1ec43a4a376d30db5daf69f24a563f615bc428 (patch) | |
tree | 21ec75a152968d427caad894eba52861976ea69c /src/analysis | |
parent | 52d721c47cce927345cb5e66674ca2cc48d75349 (diff) |
Skipped out of bound routine when computing basic blocks.
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/disass/routines.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/analysis/disass/routines.c b/src/analysis/disass/routines.c index 5d6dc42..01a6e48 100644 --- a/src/analysis/disass/routines.c +++ b/src/analysis/disass/routines.c @@ -29,6 +29,7 @@ #include "loop.h" #include "rank.h" #include "../../glibext/delayed-int.h" +#include "../../gui/panels/log.h" @@ -305,6 +306,7 @@ void g_routines_study_handle_blocks(GRoutinesStudy *study, GBinRoutine *routine, const mrange_t *range; /* Couverture d'une routine */ const vmpa2t *start; /* Adresse de départ */ const instr_coverage *coverage; /* Instructions couvertes */ + VMPA_BUFFER(loc); /* Position de la routine */ dragon_knight *knight; /* Complexité de code posée */ GBlockList *blocks; /* Liste de blocs basiques */ @@ -317,6 +319,24 @@ void g_routines_study_handle_blocks(GRoutinesStudy *study, GBinRoutine *routine, coverage = g_arch_processor_find_coverage_by_address(study->proc, start); + /** + * Si aucune couverture adaptée n'est trouvée, c'est que la routine ne se + * trouve probablement pas dans le corps du binaire... + * + * Erreur d'interprétation ou adresse fixe ? En tout cas, sans instructions, + * il n'y a aucun traitement possible ici ! + */ + if (coverage == NULL) + { + vmpa2_to_string(start, MDS_UNDEFINED, loc, NULL); + + log_variadic_message(LMT_BAD_BINARY, _("Skipped out of bound routine '%s' @ %s"), + g_binary_routine_get_name(routine), loc); + + return; + + } + knight = begin_dragon_knight(study->proc, coverage, range, start); |