summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-01-21 20:51:27 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-01-21 21:23:58 (GMT)
commitdd33acbff36c0a3ae4618ac5021e74448cad5ce5 (patch)
tree834351b836760fc54533e2f39c4b8202e695c0e3 /src/analysis
parente3ee1abf12d7868f5eaf759e04a4b4911fcdfa91 (diff)
Defined some raw primitives to write or delete comments.
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/disass/disassembler.c20
-rw-r--r--src/analysis/disass/output.c6
2 files changed, 24 insertions, 2 deletions
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c
index 272529c..0fcc7f3 100644
--- a/src/analysis/disass/disassembler.c
+++ b/src/analysis/disass/disassembler.c
@@ -636,6 +636,9 @@ static void build_disass_prologue(GCodeBuffer *buffer, const char *filename, con
{
g_buffer_line_start_merge_at(line, BLC_PHYSICAL);
g_buffer_line_add_flag(line, BLF_WIDTH_MANAGER);
+
+ g_code_buffer_append_new_line(buffer, line);
+
}
managed = (line != NULL);
@@ -649,13 +652,19 @@ static void build_disass_prologue(GCodeBuffer *buffer, const char *filename, con
if (!managed)
g_buffer_line_add_flag(line, BLF_WIDTH_MANAGER);
+ g_code_buffer_append_new_line(buffer, line);
+
line = g_lang_output_continue_comments(output, buffer,
SL(_("Chrysalide is free software - © 2008-2015 Cyrille Bagard")));
g_buffer_line_start_merge_at(line, BLC_PHYSICAL);
+ g_code_buffer_append_new_line(buffer, line);
+
line = g_lang_output_continue_comments(output, buffer, NULL, 0);
g_buffer_line_start_merge_at(line, BLC_PHYSICAL);
+ g_code_buffer_append_new_line(buffer, line);
+
/* Fichier */
len = strlen(_("File: ")) + strlen(filename) + 1;
@@ -666,6 +675,8 @@ static void build_disass_prologue(GCodeBuffer *buffer, const char *filename, con
line = g_lang_output_continue_comments(output, buffer, content, len - 1);
g_buffer_line_start_merge_at(line, BLC_PHYSICAL);
+ g_code_buffer_append_new_line(buffer, line);
+
free(content);
/* Checksum SHA256 */
@@ -678,17 +689,24 @@ static void build_disass_prologue(GCodeBuffer *buffer, const char *filename, con
line = g_lang_output_continue_comments(output, buffer, content, len - 1);
g_buffer_line_start_merge_at(line, BLC_PHYSICAL);
+ g_code_buffer_append_new_line(buffer, line);
+
free(content);
/* Ligne de séparation */
line = g_lang_output_continue_comments(output, buffer, NULL, 0);
g_buffer_line_start_merge_at(line, BLC_PHYSICAL);
+ g_code_buffer_append_new_line(buffer, line);
/* Conclusion */
line = g_lang_output_end_comments(output, buffer);
- if (line != NULL) g_buffer_line_start_merge_at(line, BLC_PHYSICAL);
+ if (line != NULL)
+ {
+ g_buffer_line_start_merge_at(line, BLC_PHYSICAL);
+ g_code_buffer_append_new_line(buffer, line);
+ }
g_object_unref(G_OBJECT(output));
diff --git a/src/analysis/disass/output.c b/src/analysis/disass/output.c
index 67a3ce8..75444a5 100644
--- a/src/analysis/disass/output.c
+++ b/src/analysis/disass/output.c
@@ -210,13 +210,15 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form
{
init_mrange(&range, get_mrange_addr(g_binary_symbol_get_range(symbols[sym_index])), 0);
- line = g_code_buffer_append_new_line(buffer, &range);
+ line = g_code_buffer_prepare_new_line(buffer, &range);
+ g_buffer_line_add_flag(line, BLF_IS_LABEL);
g_buffer_line_fill_mrange(line, msize, msize);
g_buffer_line_start_merge_at(line, BLC_ASSEMBLY_HEAD);
g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, label, strlen(label), RTT_LABEL);
g_buffer_line_insert_text(line, BLC_ASSEMBLY_HEAD, ":", 1, RTT_PUNCT);
+ g_code_buffer_append_new_line(buffer, line);
}
@@ -288,6 +290,8 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form
}
+ g_code_buffer_append_new_line(buffer, line);
+
//gtk_extended_status_bar_update_activity(statusbar, id, (iaddr - start) * 1.0 / (end - start));