diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2014-07-31 05:53:06 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2014-07-31 05:53:06 (GMT) |
commit | a5d8e3fc30cda2e13d30f099e93ab1b182fdc0bd (patch) | |
tree | cf183906b2301cd3c726af820292fd0f2458bfa1 /src/analysis | |
parent | dc436357ff29158dddd836d368d152d42d5b086b (diff) |
Improved the way code is decoded by avoiding to propagate the base address everywhere.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@385 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/disass/fetch.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/analysis/disass/fetch.c b/src/analysis/disass/fetch.c index 162e4f8..17eea6a 100644 --- a/src/analysis/disass/fetch.c +++ b/src/analysis/disass/fetch.c @@ -102,14 +102,14 @@ GArchInstruction *disassemble_binary_parts(const GLoadedBinary *binary, GBinPart #endif start = pos; - pos = 0; + len += start; while (pos < len) { - addr = base + pos; + addr = base + (pos - start); - instr = g_arch_processor_decode_instruction(proc, context, &bin_data[start], - &pos, len, start, addr, format); + instr = g_arch_processor_decode_instruction(proc, context, bin_data, + &pos, len, addr, format); g_arch_instruction_add_to_list(&result, instr); #ifdef DEBUG @@ -120,7 +120,7 @@ GArchInstruction *disassemble_binary_parts(const GLoadedBinary *binary, GBinPart #endif if (pos < len) - gtk_extended_status_bar_update_activity(statusbar, id, (done + pos) * 1.0 / sum); + gtk_extended_status_bar_update_activity(statusbar, id, (done + pos - start) * 1.0 / sum); } @@ -131,7 +131,7 @@ GArchInstruction *disassemble_binary_parts(const GLoadedBinary *binary, GBinPart g_binary_part_set_checkup(parts[i], valid, db); #endif - done += len; + done += (len - start); gtk_extended_status_bar_update_activity(statusbar, id, done * 1.0 / sum); } |