summaryrefslogtreecommitdiff
path: root/src/analysis/disass
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/analysis/disass
parent2fc5cc35c256d5bdbe72a1218082e91ddbc3e193 (diff)
Added debug code to avoid crashes with wrongly disassembled binaries.
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/routines.c12
1 files changed, 12 insertions, 0 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);