summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2011-10-12 13:31:00 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2011-10-12 13:31:00 (GMT)
commit044b4d6d7ba4de50cd4d05b92621900e929e2231 (patch)
tree70167cbd5c90d0f8b2fc967add38272d21de1e4f /src/analysis
parente8d2795d9ec2c8845641863fc42ce39f9e92906b (diff)
Processed skipped instructions and used contexts.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@212 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/disass/fetch.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/analysis/disass/fetch.c b/src/analysis/disass/fetch.c
index 5f93eba..2ac9f5c 100644
--- a/src/analysis/disass/fetch.c
+++ b/src/analysis/disass/fetch.c
@@ -62,6 +62,7 @@ GArchInstruction *disassemble_binary_parts(const GOpenidaBinary *binary, GBinPar
off_t len; /* Taille de cette même zone */
vmpa_t base; /* Adresse de la zone binaire */
off_t start; /* Conservation du pt de départ*/
+ GProcContext *context; /* Contexte pour le décodage */
vmpa_t addr; /* Adresse d'une instruction */
GArchInstruction *instr; /* Instruction décodée */
@@ -89,6 +90,8 @@ GArchInstruction *disassemble_binary_parts(const GOpenidaBinary *binary, GBinPar
if (len > bin_length) continue;
+ context = g_arch_processor_get_context(proc);
+
/* Décodage des instructions */
#ifdef DEBUG
@@ -103,13 +106,15 @@ GArchInstruction *disassemble_binary_parts(const GOpenidaBinary *binary, GBinPar
{
addr = base + pos;
- instr = g_arch_processor_decode_instruction(proc, &bin_data[start],
+ instr = g_arch_processor_decode_instruction(proc, context, &bin_data[start],
&pos, len, start, addr);
g_arch_instruction_add_to_list(&result, instr);
#ifdef DEBUG
- if (G_IS_DB_INSTRUCTION(instr)) db++;
- else valid++;
+ if (G_IS_DB_INSTRUCTION(instr) && !g_db_instruction_is_skipped(G_DB_INSTRUCTION(instr)))
+ db++;
+ else
+ valid++;
#endif
if (pos < len)
@@ -117,7 +122,12 @@ GArchInstruction *disassemble_binary_parts(const GOpenidaBinary *binary, GBinPar
}
+ if (context != NULL)
+ g_object_unref(context);
+
+#ifdef DEBUG
g_binary_part_set_checkup(parts[i], valid, db);
+#endif
done += len;
gtk_extended_status_bar_update_activity(statusbar, id, done * 1.0 / sum);