summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/disassembler.c12
-rw-r--r--src/analysis/disass/output.c20
2 files changed, 29 insertions, 3 deletions
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c
index ce2e6ff..c563b2e 100644
--- a/src/analysis/disass/disassembler.c
+++ b/src/analysis/disass/disassembler.c
@@ -625,13 +625,20 @@ static void build_disass_prologue(GCodeBuffer *buffer, const char *filename, con
{
GLangOutput *output; /* Modèle de sortie adéquat */
GBufferLine *line; /* Ligne de destination */
+ bool managed; /* Groupe déjà défini ? */
size_t len; /* Taille du texte */
char *content; /* Contenu textuel d'une ligne */
output = g_asm_output_new();
line = g_lang_output_start_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_buffer_line_add_flag(line, BLF_WIDTH_MANAGER);
+ }
+
+ managed = (line != NULL);
/* Introduction */
@@ -639,6 +646,9 @@ static void build_disass_prologue(GCodeBuffer *buffer, const char *filename, con
SL(_("Disassembly generated by Chrysalide")));
g_buffer_line_start_merge_at(line, BLC_PHYSICAL);
+ if (!managed)
+ g_buffer_line_add_flag(line, BLF_WIDTH_MANAGER);
+
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);
diff --git a/src/analysis/disass/output.c b/src/analysis/disass/output.c
index d698c71..727c34f 100644
--- a/src/analysis/disass/output.c
+++ b/src/analysis/disass/output.c
@@ -236,12 +236,29 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form
if (cmp_vmpa(iaddr, saddr) == 0)
{
-
/* Point d'entrée ? */
if (g_binary_symbol_get_target_type(symbols[sym_index]) == STP_ENTRY_POINT)
g_buffer_line_add_flag(line, BLF_ENTRYPOINT);
+ /* Début d'un groupe bien cohérent avec les alignements ? */
+
+ switch (g_binary_symbol_get_target_type(symbols[sym_index]))
+ {
+ case STP_ROUTINE:
+ case STP_OBJECT:
+ case STP_FUNCTION:
+ case STP_ENTRY_POINT:
+ case STP_STRING:
+ case STP_RO_STRING:
+ g_buffer_line_add_flag(line, BLF_WIDTH_MANAGER);
+ break;
+
+ default:
+ break;
+
+ }
+
/* Commentaire ? */
comment = g_binary_symbol_get_comment(symbols[sym_index]);
@@ -266,7 +283,6 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form
sym_index++;
-
}
}