summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-05-10 20:44:30 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-05-10 20:44:30 (GMT)
commit90e0f7ac04c1622f226dda57a3329b6fe98307e8 (patch)
tree68313927f67ed3f1d903562e1760d32a902f775a /src/analysis/disass
parent8e76324b01e5b4979f346f0bc8c84372477a3d38 (diff)
Removed the link to binary content used for printing from instructions.
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/area.c3
-rw-r--r--src/analysis/disass/disassembler.c19
2 files changed, 10 insertions, 12 deletions
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c
index ed53b28..f4088e4 100644
--- a/src/analysis/disass/area.c
+++ b/src/analysis/disass/area.c
@@ -448,9 +448,6 @@ static bool mark_range_in_mem_area_as_processed(mem_area *area, GArchInstruction
area->instructions[offset] = instr;
g_atomic_pointer_add(&area->count, 1);
- /* Au passage, association du contenu */
- g_arch_instruction_set_global_content(instr, area->content);
-
mrimaap_exit:
/* Fin des choses sérieuses */
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c
index 0ffcccd..2f6b562 100644
--- a/src/analysis/disass/disassembler.c
+++ b/src/analysis/disass/disassembler.c
@@ -681,25 +681,28 @@ static void build_disass_prologue(GBufferCache *cache, const GBinFormat *format,
void disassemble_binary(GLoadedBinary *binary, GBufferCache **cache, disassembly_ack_fc ack)
{
GBinFormat *format; /* Format associé au binaire */
- GCodingLanguage *lang; /* Langage de sortie préféré */
GBinContent *content; /* Contenu bianire manipulé */
+ GCodingLanguage *lang; /* Langage de sortie préféré */
+ const char *desc; /* Désignation du binaire */
const gchar *checksum; /* Identifiant de binaire */
GDelayedDisassembly *disass; /* Désassemblage à mener */
GWorkQueue *queue; /* Gestionnaire de différés */
- *cache = g_buffer_cache_new();
-
format = G_BIN_FORMAT(g_loaded_binary_get_format(binary));
+ content = g_binary_format_get_content(format);
+
+ *cache = g_buffer_cache_new(content);
lang = g_asm_language_new();
- content = g_binary_format_get_content(format);
+ desc = g_binary_content_describe(content, true);
checksum = g_binary_content_get_checksum(content);
- g_object_unref(G_OBJECT(content));
- g_object_unref(G_OBJECT(format));
+ build_disass_prologue(*cache, format, lang, desc, checksum);
- build_disass_prologue(*cache, format, lang, g_binary_content_describe(content, true), checksum);
+ g_object_unref(G_OBJECT(lang));
+ g_object_unref(G_OBJECT(content));
+ g_object_unref(G_OBJECT(format));
disass = g_delayed_disassembly_new(binary, *cache);
g_signal_connect(disass, "work-completed", G_CALLBACK(ack), binary);
@@ -707,6 +710,4 @@ void disassemble_binary(GLoadedBinary *binary, GBufferCache **cache, disassembly
queue = get_work_queue();
g_work_queue_schedule_work(queue, G_DELAYED_WORK(disass), DEFAULT_WORK_GROUP);
- g_object_unref(G_OBJECT(lang));
-
}