summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/binary.c3
-rw-r--r--src/analysis/disass/disassembler.c14
-rw-r--r--src/analysis/disass/disassembler.h2
3 files changed, 9 insertions, 10 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c
index 21b4b14..73070b1 100644
--- a/src/analysis/binary.c
+++ b/src/analysis/binary.c
@@ -664,7 +664,8 @@ void g_openida_binary_analyse(GOpenidaBinary *binary)
}
}
- binary->disass_buffer = disassemble_binary(binary, parts, parts_count, &binary->instrs);
+ disassemble_binary(binary, parts, parts_count,
+ &binary->instrs, &binary->disass_buffer);
/* TODO : remme ! */
ack_completed_disassembly(NULL, binary);
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c
index 75e411f..872dc09 100644
--- a/src/analysis/disass/disassembler.c
+++ b/src/analysis/disass/disassembler.c
@@ -371,18 +371,18 @@ static void build_disass_prologue(GCodeBuffer *buffer, const char *filename, con
* parts = parties binaires à désassembler. *
* count = nombre de parties à traiter. *
* instrs = liste des instructions chargées. [OUT] *
+* buffer = tampon de code mis en place. [OUT] *
* *
* Description : Procède au désassemblage d'un contenu binaire donné. *
* *
-* Retour : Tampon de code mis en place. *
+* Retour : - *
* *
* Remarques : - *
* *
******************************************************************************/
-GCodeBuffer *disassemble_binary(GOpenidaBinary *binary, GBinPart **parts, size_t parts_count, GArchInstruction **instrs)
+void disassemble_binary(GOpenidaBinary *binary, GBinPart **parts, size_t parts_count, GArchInstruction **instrs, GCodeBuffer **buffer)
{
- GCodeBuffer *result; /* Tampon constitué à renvoyer */
const uint8_t *data; /* Données binaires brutes */
off_t length; /* Quantité de ces données */
GDelayedDisassembly *disass; /* Désassemblage à mener */
@@ -393,12 +393,12 @@ GCodeBuffer *disassemble_binary(GOpenidaBinary *binary, GBinPart **parts, size_t
/* Déroulement de l'opération principale */
- result = g_code_buffer_new();
+ *buffer = g_code_buffer_new();
data = g_openida_binary_get_data(binary, &length);
- build_disass_prologue(result, g_openida_binary_get_filename(binary), data, length);
+ build_disass_prologue(*buffer, g_openida_binary_get_filename(binary), data, length);
- disass = g_delayed_disassembly_new(binary, parts, parts_count, result);
+ disass = g_delayed_disassembly_new(binary, parts, parts_count, *buffer);
queue = get_work_queue();
g_work_queue_schedule_work(queue, G_DELAYED_WORK(disass));
@@ -422,6 +422,4 @@ GCodeBuffer *disassemble_binary(GOpenidaBinary *binary, GBinPart **parts, size_t
}
- return result;
-
}
diff --git a/src/analysis/disass/disassembler.h b/src/analysis/disass/disassembler.h
index 54da069..2c5adef 100644
--- a/src/analysis/disass/disassembler.h
+++ b/src/analysis/disass/disassembler.h
@@ -31,7 +31,7 @@
/* Procède à la décompilation des routines d'un fichier donné. */
-GCodeBuffer *disassemble_binary(GOpenidaBinary *, GBinPart **parts, size_t parts_count, GArchInstruction **);
+void disassemble_binary(GOpenidaBinary *, GBinPart **parts, size_t parts_count, GArchInstruction **, GCodeBuffer **);