diff options
Diffstat (limited to 'src/analysis/disass')
-rw-r--r-- | src/analysis/disass/output.c | 31 |
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)); } |