diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2010-06-14 23:39:03 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2010-06-14 23:39:03 (GMT) |
commit | 1e2aada1204d3da43fe075478df5bfaaece937b0 (patch) | |
tree | 99eb321808ddcc0364928adf9266f32a201d2b59 /src/analysis | |
parent | af7d2ea327d27200ad151d3e1ba0ee6d51b1ff62 (diff) |
Made the program stronger by handling more errors.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@167 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/binary.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c index 17fc172..d860efc 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -351,6 +351,7 @@ static GRenderingLine *disassemble_binary_parts(GDelayedDisassembly *disass, GBi for (i = 0; i < disass->count; i++) { g_binary_part_get_values(disass->parts[i], NULL, &len, NULL); + if (len > disass->binary->bin_length) continue; sum += len; } @@ -362,6 +363,8 @@ static GRenderingLine *disassemble_binary_parts(GDelayedDisassembly *disass, GBi { g_binary_part_get_values(disass->parts[i], &pos, &len, &base); + if (len > disass->binary->bin_length) continue; + /* Décodage des instructions */ start = pos; @@ -379,8 +382,6 @@ static GRenderingLine *disassemble_binary_parts(GDelayedDisassembly *disass, GBi /* Ajout des prototypes de fonctions */ - printf("BASE == 0x%08llx\n", base); - for (; k < count; k++) { routine_offset = g_binary_routine_get_address(routines[k]); |