diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-05-07 16:34:44 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-05-07 16:34:44 (GMT) |
commit | 3d28b198f12671e4933890a4b79933d064593ce3 (patch) | |
tree | 1fcf4bad79af94a3b14b349e9d68b61f88d5df8a | |
parent | 2fc5cc35c256d5bdbe72a1218082e91ddbc3e193 (diff) |
Added debug code to avoid crashes with wrongly disassembled binaries.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/analysis/disass/routines.c | 12 | ||||
-rw-r--r-- | src/format/elf/symbols.c | 2 |
3 files changed, 21 insertions, 1 deletions
@@ -1,3 +1,11 @@ +16-05-07 Cyrille Bagard <nocbos@gmail.com> + + * src/analysis/disass/routines.c: + Add debug code to avoid crashes with wrongly disassembled binaries. + + * src/format/elf/symbols.c + Extend a debug output. + 16-05-06 Cyrille Bagard <nocbos@gmail.com> * src/arch/arm/v7/Makefile.am: diff --git a/src/analysis/disass/routines.c b/src/analysis/disass/routines.c index 3e0aa71..94afbe4 100644 --- a/src/analysis/disass/routines.c +++ b/src/analysis/disass/routines.c @@ -304,6 +304,18 @@ void g_routines_study_handle_blocks(GRoutinesStudy *study, size_t index) knight = begin_dragon_knight(study->proc, coverage, range, start); + + /** + * FIXME + * L'état 'knight == NULL' peut avoir deux origines : + * - soit le binaire est mal-formé. + * - soit le désassemblage s'est mal déroulé. + * Dans les deux cas, on obtient un symbole qui n'a pas d'instruction de départ. + * A traiter autrement qu'en filtrant sur knight... + */ + if (knight == NULL) return; + + /* Traitement par blocs */ detect_loops_in_code(knight); diff --git a/src/format/elf/symbols.c b/src/format/elf/symbols.c index fa7cb8f..91a4b71 100644 --- a/src/format/elf/symbols.c +++ b/src/format/elf/symbols.c @@ -646,7 +646,7 @@ static bool load_elf_internal_symbols(GElfFormat *format) /* Routine */ - printf("SYM ADDING>> '%s'\n", name); + printf("SYM ADDING>> '%s' @ 0x%08x\n", name, (unsigned int)virt); routine = try_to_demangle_routine(name); |