summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
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);