summaryrefslogtreecommitdiff
path: root/src/analysis/decomp
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-12-20 00:28:36 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-12-20 00:28:36 (GMT)
commit56deaf395c65658102ef0111cfc072d65335331a (patch)
treeba6d6fd0dbc781e9ad3b3cf6b2eb529a7d7a6aa3 /src/analysis/decomp
parentd9fdfcf887a7a596a68db2500bb5e4d0b692abb6 (diff)
Begun to clean the code by moving the disassembling process into disass/.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@202 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/decomp')
-rw-r--r--src/analysis/decomp/decompiler.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/analysis/decomp/decompiler.c b/src/analysis/decomp/decompiler.c
index c446c0e..de1b6d2 100644
--- a/src/analysis/decomp/decompiler.c
+++ b/src/analysis/decomp/decompiler.c
@@ -1,6 +1,6 @@
/* OpenIDA - Outil d'analyse de fichiers binaires
- * decompiler.h - prototypes pour l'encadrement des phases de décompilation
+ * decompiler.c - encadrement des phases de décompilation
*
* Copyright (C) 2010 Cyrille Bagard
*
@@ -68,17 +68,20 @@ static void build_decomp_prologue(GCodeBuffer *buffer, const char *filename)
output = g_java_output_new();
+ line = g_lang_output_start_comments(output, buffer);
+ if (line != NULL) g_buffer_line_start_merge_at(line, BLC_ADDRESS);
+
/* Introduction */
- line = g_lang_output_write_comments(output, buffer,
- SL(_("Binary data decompiled by OpenIDA")));
+ line = g_lang_output_continue_comments(output, buffer,
+ SL(_("Binary data decompiled by OpenIDA")));
g_buffer_line_start_merge_at(line, BLC_ADDRESS);
- line = g_lang_output_write_comments(output, buffer,
- SL(_("OpenIDA is free software - © 2008-2010 Cyrille Bagard")));
+ line = g_lang_output_continue_comments(output, buffer,
+ SL(_("OpenIDA is free software - © 2008-2010 Cyrille Bagard")));
g_buffer_line_start_merge_at(line, BLC_ADDRESS);
- line = g_lang_output_write_comments(output, buffer, NULL, 0);
+ line = g_lang_output_continue_comments(output, buffer, NULL, 0);
g_buffer_line_start_merge_at(line, BLC_ADDRESS);
/* Fichier */
@@ -91,18 +94,22 @@ static void build_decomp_prologue(GCodeBuffer *buffer, const char *filename)
snprintf(content, len, "%s%s", _("File: "), filename);
- line = g_lang_output_write_comments(output, buffer, content, len - 1);
+ line = g_lang_output_continue_comments(output, buffer, content, len - 1);
g_buffer_line_start_merge_at(line, BLC_ADDRESS);
free(content);
- /* Lignes de séparation */
+ /* Ligne de séparation */
- line = g_lang_output_write_comments(output, buffer, NULL, 0);
+ line = g_lang_output_continue_comments(output, buffer, NULL, 0);
g_buffer_line_start_merge_at(line, BLC_ADDRESS);
- line = g_lang_output_write_comments(output, buffer, NULL, 0);
- g_buffer_line_start_merge_at(line, BLC_ADDRESS);
+ /* Conclusion */
+
+ line = g_lang_output_end_comments(output, buffer);
+ if (line != NULL) g_buffer_line_start_merge_at(line, BLC_ADDRESS);
+
+ g_object_unref(G_OBJECT(output));
}