summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-05-07 16:34:44 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-05-07 16:34:44 (GMT)
commit3d28b198f12671e4933890a4b79933d064593ce3 (patch)
tree1fcf4bad79af94a3b14b349e9d68b61f88d5df8a /src
parent2fc5cc35c256d5bdbe72a1218082e91ddbc3e193 (diff)
Added debug code to avoid crashes with wrongly disassembled binaries.
Diffstat (limited to 'src')
-rw-r--r--src/analysis/disass/routines.c12
-rw-r--r--src/format/elf/symbols.c2
2 files changed, 13 insertions, 1 deletions
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);