diff options
Diffstat (limited to 'src/gtkext')
| -rw-r--r-- | src/gtkext/gtkgraphdisplay.c | 14 | 
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gtkext/gtkgraphdisplay.c b/src/gtkext/gtkgraphdisplay.c index 8139b3a..ee3853f 100644 --- a/src/gtkext/gtkgraphdisplay.c +++ b/src/gtkext/gtkgraphdisplay.c @@ -31,6 +31,7 @@  #include "gtkbufferdisplay.h"  #include "gtkdisplaypanel-int.h"  #include "graph/cluster.h" +#include "../analysis/routine.h"  #include "../format/format.h"  #include "../gui/editem.h" @@ -615,6 +616,7 @@ static void gtk_graph_display_define_main_address(GtkGraphDisplay *display, cons      GExeFormat *format;                     /* Type de fichier chargé      */      GBinSymbol *symbol;                     /* Symbole présent à l'adresse */      bool found;                             /* Bilan des recherches        */ +    SymbolType type;                        /* Type de symbole rencontré   */      GBlockList *list;                       /* Liste de blocs basiques     */      gint right;                             /* Abscisse du coin droit      */      gint bottom;                            /* Ordonnée du coin inférieur  */ @@ -639,15 +641,17 @@ static void gtk_graph_display_define_main_address(GtkGraphDisplay *display, cons          if (!found)              goto ggddma_done; -        if (g_binary_symbol_get_routine(symbol) == NULL) -            goto ggddma_done; +        type = g_binary_symbol_get_target_type(symbol); + +        if (type != STP_ROUTINE && type != STP_ENTRY_POINT) +            goto ggddma_bad_type;          display->routine = symbol;          g_object_ref(G_OBJECT(symbol));          display->highlighted = init_segment_content_list(); -        list = g_binary_routine_get_basic_blocks(g_binary_symbol_get_routine(symbol)); +        list = g_binary_routine_get_basic_blocks(G_BIN_ROUTINE(symbol));          display->cluster = bootstrap_graph_cluster(GTK_DISPLAY_PANEL(display)->binary,                                                     list, display->highlighted); @@ -673,6 +677,10 @@ static void gtk_graph_display_define_main_address(GtkGraphDisplay *display, cons          gtk_graph_display_update_support_margins(display, &allocation); + ggddma_bad_type: + +        g_object_unref(G_OBJECT(symbol)); +   ggddma_done:          change_editor_items_current_view_content(GTK_DISPLAY_PANEL(display));  | 
