diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-12-28 23:27:12 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-12-28 23:27:12 (GMT) |
commit | b57e8ef5522dcbe126157fc2c50fcf879aa7d743 (patch) | |
tree | 1ecfd9de39073fee3a2c1a4afa9ce5da574b26df /src/analysis/disass/output.c | |
parent | 276b75e6e9ff99a930bd36045e55b1117bb29579 (diff) |
Defined layers to register all kinds of binary portions.
Diffstat (limited to 'src/analysis/disass/output.c')
-rw-r--r-- | src/analysis/disass/output.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/analysis/disass/output.c b/src/analysis/disass/output.c index 727c34f..67a3ce8 100644 --- a/src/analysis/disass/output.c +++ b/src/analysis/disass/output.c @@ -56,6 +56,14 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *format, GArchProcessor *proc, const GArchInstruction *instrs, GBinRoutine * const *routines, size_t count, GtkExtStatusBar *statusbar, bstatus_id_t id) { GLangOutput *output; /* Modèle de sortie adéquat */ + GPortionLayer *layer; /* Couche première de portions */ + 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é */ + //GArchProcessor *proc; /* Architecture du binaire */ MemoryDataSize msize; /* Taille du bus d'adresses */ const GBinContent *content; /* Contenu binaire global */ @@ -74,13 +82,6 @@ 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 */ @@ -100,12 +101,12 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form output = g_asm_output_new(); + layer = g_exe_format_get_main_layer(format); - - portions = g_exe_format_get_portions_at_level(format, -1, &portions_count); + portions = g_portion_layer_collect_all_portions(layer, &portions_count); portion_index = 0; - symbols = g_binary_format_get_symbols(format, &sym_count); + symbols = g_binary_format_get_symbols(G_BIN_FORMAT(format), &sym_count); sym_index = 0; #if 0 @@ -294,7 +295,10 @@ void print_disassembled_instructions(GCodeBuffer *buffer, const GExeFormat *form g_object_unref(G_OBJECT(content)); - /* free portions... */ + if (portions != NULL) + free(portions); + + g_object_unref(G_OBJECT(layer)); g_object_unref(G_OBJECT(output)); |