diff options
Diffstat (limited to 'src/analysis/disass/disassembler.c')
-rw-r--r-- | src/analysis/disass/disassembler.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c index 4004de9..283914e 100644 --- a/src/analysis/disass/disassembler.c +++ b/src/analysis/disass/disassembler.c @@ -58,7 +58,7 @@ typedef struct _GDelayedDisassembly GDelayedWork parent; /* A laisser en premier */ const GOpenidaBinary *binary; /* Destinataire final */ - const GBinFormat *format; /* Format du binaire représenté*/ + const GExeFormat *format; /* Format du binaire représenté*/ GBinPart **parts; /* Parties binaires à traiter */ size_t count; /* Nombre de ces parties */ @@ -169,7 +169,7 @@ static GDelayedDisassembly *g_delayed_disassembly_new(const GOpenidaBinary *bina result = g_object_new(G_TYPE_DELAYED_DISASSEMBLY, NULL); result->binary = binary; - result->format = G_BIN_FORMAT(g_openida_binary_get_format(binary)); + result->format = g_openida_binary_get_format(binary); result->parts = parts; result->count = count; @@ -200,8 +200,7 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtSta size_t routines_count; /* Nombre de ces routines */ guint id; /* Identifiant de statut */ - routines = g_binary_format_get_routines(disass->format, &routines_count); - qsort(routines, routines_count, sizeof(GBinRoutine *), (__compar_fn_t)g_binary_routine_rcompare); + routines = g_binary_format_get_routines(G_BIN_FORMAT(disass->format), &routines_count); /* Première étape */ @@ -224,6 +223,8 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtSta id = gtk_extended_status_bar_push(statusbar, _("Finding remaining limits..."), true); + qsort(routines, routines_count, sizeof(GBinRoutine *), (__compar_fn_t)g_binary_routine_rcompare); + limit_all_routines(disass->lines, routines, routines_count, statusbar, id); gtk_extended_status_bar_remove(statusbar, id); @@ -232,7 +233,10 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtSta id = gtk_extended_status_bar_push(statusbar, _("Printing disassembled code..."), true); - print_disassembled_instructions(disass->buffer, disass->instrs, routines, routines_count); + qsort(routines, routines_count, sizeof(GBinRoutine *), (__compar_fn_t)g_binary_routine_compare); + + print_disassembled_instructions(disass->buffer, disass->format, disass->instrs, + routines, routines_count); gtk_extended_status_bar_remove(statusbar, id); |