summaryrefslogtreecommitdiff
path: root/src/analysis/disass
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-11-29 09:33:00 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-11-29 09:33:00 (GMT)
commit97d1cc10210cf4ec237e1d9a8b23b120ddef47c5 (patch)
treebe02d0c99cd02917ca31541f4ff0aafa9b9903fc /src/analysis/disass
parentb4d1a25a22371fa67c5d73bc8fcca08e045556f3 (diff)
Displayed segments in the disassembly view.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@429 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/disass')
-rw-r--r--src/analysis/disass/output.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/analysis/disass/output.c b/src/analysis/disass/output.c
index a6d7845..2007f48 100644
--- a/src/analysis/disass/output.c
+++ b/src/analysis/disass/output.c
@@ -70,13 +70,15 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form
GBufferLine *line;
+ GBinPortion **portions; /* Morceaux d'encadrement */
+ size_t portions_count; /* Taille de cette liste */
+ size_t portion_index; /* Prochaine portion à traiter */
GBinSymbol **symbols; /* Symboles à représenter */
size_t sym_count; /* Qté de symboles présents */
-
-
size_t sym_index; /* Prochain symbole non traité */
+ const vmpa2t *paddr; /* Adresse de portion */
GDbComment *comment; /* Commentaire à ajouter */
@@ -91,11 +93,15 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form
output = g_asm_output_new();
- symbols = g_binary_format_get_symbols(format, &sym_count);
+
+ portions = g_exe_format_get_portions_at_level(format, -1, &portions_count);
+ portion_index = 0;
+ symbols = g_binary_format_get_symbols(format, &sym_count);
sym_index = 0;
+
//GDbCollection *g_loaded_binary_find_collection(GLoadedBinary *, DBFeatures);
@@ -133,6 +139,22 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form
#endif
+ iaddr = get_mrange_addr(g_arch_instruction_get_range(iter));
+
+ while (portion_index < portions_count)
+ {
+ paddr = get_mrange_addr(g_binary_portion_get_range(portions[portion_index]));
+
+ if (cmp_vmpa_by_phy(iaddr, paddr) != 0)
+ break;
+
+ g_binary_portion_print(portions[portion_index], buffer, msize);
+
+ portion_index++;
+
+ }
+
+
line = g_arch_instruction_print(iter, buffer, msize, content, ASX_INTEL);
@@ -178,6 +200,9 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form
}
+
+ /* free portions... */
+
g_object_unref(G_OBJECT(output));
}