diff options
Diffstat (limited to 'src/dialogs')
-rw-r--r-- | src/dialogs/Makefile.am | 3 | ||||
-rw-r--r-- | src/dialogs/binparts.c | 4 | ||||
-rw-r--r-- | src/dialogs/binparts.h | 12 | ||||
-rw-r--r-- | src/dialogs/plugins.c | 333 | ||||
-rw-r--r-- | src/dialogs/plugins.h | 40 |
5 files changed, 382 insertions, 10 deletions
diff --git a/src/dialogs/Makefile.am b/src/dialogs/Makefile.am index 22eaeac..2970d0a 100644 --- a/src/dialogs/Makefile.am +++ b/src/dialogs/Makefile.am @@ -3,7 +3,8 @@ lib_LIBRARIES = libdialogs.a libdialogs_a_SOURCES = \ binparts.h binparts.c \ - export.h export.c + export.h export.c \ + plugins.h plugins.c libdialogs_a_LDFLAGS = diff --git a/src/dialogs/binparts.c b/src/dialogs/binparts.c index a88232e..5f11700 100644 --- a/src/dialogs/binparts.c +++ b/src/dialogs/binparts.c @@ -1,8 +1,8 @@ /* OpenIDA - Outil d'analyse de fichiers binaires - * dlg_sections.h - boîte de dialogue permettant une sélection des sections + * binparts.h - boîte de dialogue permettant une sélection des sections * - * Copyright (C) 2008 Cyrille Bagard + * Copyright (C) 2009 Cyrille Bagard * * This file is part of OpenIDA. * diff --git a/src/dialogs/binparts.h b/src/dialogs/binparts.h index 8a86bf6..90f4737 100644 --- a/src/dialogs/binparts.h +++ b/src/dialogs/binparts.h @@ -1,8 +1,8 @@ /* OpenIDA - Outil d'analyse de fichiers binaires - * dlg_sections.h - prototypes pour la boîte de dialogue permettant une sélection des sections + * binparts.h - prototypes pour la boîte de dialogue permettant une sélection des sections * - * Copyright (C) 2008 Cyrille Bagard + * Copyright (C) 2009 Cyrille Bagard * * This file is part of OpenIDA. * @@ -21,8 +21,8 @@ */ -#ifndef _DLG_SECTIONS_H -#define _DLG_SECTIONS_H +#ifndef _DIALOGS_BINPARTS_H +#define _DIALOGS_BINPARTS_H #include <gtk/gtk.h> @@ -37,6 +37,4 @@ GtkWidget *create_sections_dialog(GOpenidaBinary *, GtkWindow *); - - -#endif /* _DLG_SECTIONS_H */ +#endif /* _DIALOGS_BINPARTS_H */ diff --git a/src/dialogs/plugins.c b/src/dialogs/plugins.c new file mode 100644 index 0000000..b5e045b --- /dev/null +++ b/src/dialogs/plugins.c @@ -0,0 +1,333 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * plugins.c - boîte de dialogue permettant une sélection des greffons + * + * Copyright (C) 2010 Cyrille Bagard + * + * This file is part of OpenIDA. + * + * OpenIDA is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * OpenIDA is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "plugins.h" + + + + + + +#define _(str) str + + + + + +/****************************************************************************** +* * +* Paramètres : binary = informations sur le binaire actuellement ouvert. * +* parent = fenêtre parente à surpasser. * +* * +* Description : Construit la fenêtre de sélection des sections. * +* * +* Retour : Adresse de la fenêtre mise en place. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GtkWidget *create_plugins_selection_dialog(GOpenidaBinary *binary, GtkWindow *parent) +{ + GtkWidget *result; /* Fenêtre à renvoyer */ + GObject *ref; /* Espace de référencements */ + + + + + GtkWidget *vbox1; + GtkWidget *hbox3; + GtkWidget *scrolledwindow1; + GtkWidget *treeview1; + GtkWidget *vbox2; + GtkWidget *vbuttonbox1; + GtkWidget *button7; + GtkWidget *image3; + GtkWidget *button8; + GtkWidget *image4; + GtkWidget *hseparator1; + GtkWidget *vbuttonbox2; + GtkWidget *button9; + GtkWidget *image5; + GtkWidget *button10; + GtkWidget *image6; + GtkWidget *scrolledwindow2; + GtkWidget *treeview2; + GtkWidget *expander1; + GtkWidget *hbox4; + GtkWidget *vbox3; + GtkWidget *label5; + GtkWidget *label8; + GtkWidget *label6; + GtkWidget *label9; + GtkWidget *label7; + GtkWidget *label10; + GtkWidget *frame1; + GtkWidget *alignment3; + GtkWidget *label12; + GtkWidget *label11; + GtkWidget *label3; + GtkWidget *hseparator2; + GtkWidget *hbuttonbox1; + GtkWidget *button1; + GtkWidget *alignment1; + GtkWidget *hbox1; + GtkWidget *image1; + GtkWidget *label1; + GtkWidget *button2; + GtkWidget *alignment2; + GtkWidget *hbox2; + GtkWidget *image2; + GtkWidget *label2; + + result = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_widget_set_size_request(result, 600, 400); + gtk_container_set_border_width(GTK_CONTAINER(result), 8); + gtk_window_set_title(GTK_WINDOW(result), _("Plugins selection")); + gtk_window_set_transient_for(GTK_WINDOW(result), parent); + gtk_window_set_default_size(GTK_WINDOW(result), 600, 400); + gtk_window_set_type_hint(GTK_WINDOW(result), GDK_WINDOW_TYPE_HINT_DIALOG); + + ref= G_OBJECT(result); + g_object_set_data(ref, "binary", binary); + + + + + vbox1 = gtk_vbox_new(FALSE, 8); + gtk_widget_show(vbox1); + gtk_container_add(GTK_CONTAINER(result), vbox1); + gtk_container_set_border_width(GTK_CONTAINER(vbox1), 8); + + hbox3 = gtk_hbox_new(FALSE, 8); + gtk_widget_show(hbox3); + gtk_box_pack_start(GTK_BOX(vbox1), hbox3, TRUE, TRUE, 0); + + scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL); + gtk_widget_show(scrolledwindow1); + gtk_box_pack_start(GTK_BOX(hbox3), scrolledwindow1, TRUE, TRUE, 0); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwindow1), GTK_SHADOW_IN); + + treeview1 = gtk_tree_view_new(); + gtk_widget_show(treeview1); + gtk_container_add(GTK_CONTAINER(scrolledwindow1), treeview1); + + vbox2 = gtk_vbox_new(TRUE, 0); + gtk_widget_show(vbox2); + gtk_box_pack_start(GTK_BOX(hbox3), vbox2, FALSE, FALSE, 0); + + vbuttonbox1 = gtk_vbutton_box_new(); + gtk_widget_show(vbuttonbox1); + gtk_box_pack_start(GTK_BOX(vbox2), vbuttonbox1, FALSE, FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbuttonbox1), 8); + gtk_button_box_set_layout(GTK_BUTTON_BOX(vbuttonbox1), GTK_BUTTONBOX_END); + gtk_box_set_spacing(GTK_BOX(vbuttonbox1), 8); + + button7 = gtk_button_new(); + gtk_widget_show(button7); + gtk_container_add(GTK_CONTAINER(vbuttonbox1), button7); + GTK_WIDGET_SET_FLAGS(button7, GTK_CAN_DEFAULT); + + image3 = gtk_image_new_from_stock("gtk-add", GTK_ICON_SIZE_BUTTON); + gtk_widget_show(image3); + gtk_container_add(GTK_CONTAINER(button7), image3); + + button8 = gtk_button_new(); + gtk_widget_show(button8); + gtk_container_add(GTK_CONTAINER(vbuttonbox1), button8); + GTK_WIDGET_SET_FLAGS(button8, GTK_CAN_DEFAULT); + + image4 = gtk_image_new_from_stock("gtk-remove", GTK_ICON_SIZE_BUTTON); + gtk_widget_show(image4); + gtk_container_add(GTK_CONTAINER(button8), image4); + + hseparator1 = gtk_hseparator_new(); + gtk_widget_show(hseparator1); + gtk_box_pack_start(GTK_BOX(vbox2), hseparator1, FALSE, FALSE, 0); + + vbuttonbox2 = gtk_vbutton_box_new(); + gtk_widget_show(vbuttonbox2); + gtk_box_pack_start(GTK_BOX(vbox2), vbuttonbox2, FALSE, FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbuttonbox2), 8); + gtk_box_set_spacing(GTK_BOX(vbuttonbox2), 8); + + button9 = gtk_button_new(); + gtk_widget_show(button9); + gtk_container_add(GTK_CONTAINER(vbuttonbox2), button9); + GTK_WIDGET_SET_FLAGS(button9, GTK_CAN_DEFAULT); + + image5 = gtk_image_new_from_stock("gtk-go-up", GTK_ICON_SIZE_BUTTON); + gtk_widget_show(image5); + gtk_container_add(GTK_CONTAINER(button9), image5); + + button10 = gtk_button_new(); + gtk_widget_show(button10); + gtk_container_add(GTK_CONTAINER(vbuttonbox2), button10); + GTK_WIDGET_SET_FLAGS(button10, GTK_CAN_DEFAULT); + + image6 = gtk_image_new_from_stock("gtk-go-down", GTK_ICON_SIZE_BUTTON); + gtk_widget_show(image6); + gtk_container_add(GTK_CONTAINER(button10), image6); + + scrolledwindow2 = gtk_scrolled_window_new(NULL, NULL); + gtk_widget_show(scrolledwindow2); + gtk_box_pack_start(GTK_BOX(hbox3), scrolledwindow2, TRUE, TRUE, 0); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwindow2), GTK_SHADOW_IN); + + treeview2 = gtk_tree_view_new(); + gtk_widget_show(treeview2); + gtk_container_add(GTK_CONTAINER(scrolledwindow2), treeview2); + + expander1 = gtk_expander_new(NULL); + gtk_widget_show(expander1); + gtk_box_pack_start(GTK_BOX(vbox1), expander1, FALSE, FALSE, 0); + gtk_expander_set_expanded(GTK_EXPANDER(expander1), TRUE); + + hbox4 = gtk_hbox_new(FALSE, 0); + gtk_widget_show(hbox4); + gtk_container_add(GTK_CONTAINER(expander1), hbox4); + + vbox3 = gtk_vbox_new(FALSE, 0); + gtk_widget_show(vbox3); + gtk_box_pack_start(GTK_BOX(hbox4), vbox3, TRUE, TRUE, 0); + + label5 = gtk_label_new(_("Author:")); + gtk_widget_show(label5); + gtk_box_pack_start(GTK_BOX(vbox3), label5, FALSE, FALSE, 0); + gtk_misc_set_alignment(GTK_MISC(label5), 0, 0.5); + + label8 = gtk_label_new(_("label8")); + gtk_widget_show(label8); + gtk_box_pack_start(GTK_BOX(vbox3), label8, FALSE, FALSE, 0); + + label6 = gtk_label_new(_("Version:")); + gtk_widget_show(label6); + gtk_box_pack_start(GTK_BOX(vbox3), label6, FALSE, FALSE, 0); + gtk_misc_set_alignment(GTK_MISC(label6), 0, 0.5); + + label9 = gtk_label_new(_("label9")); + gtk_widget_show(label9); + gtk_box_pack_start(GTK_BOX(vbox3), label9, FALSE, FALSE, 0); + + label7 = gtk_label_new(_("URL:")); + gtk_widget_show(label7); + gtk_box_pack_start(GTK_BOX(vbox3), label7, FALSE, FALSE, 0); + gtk_misc_set_alignment(GTK_MISC(label7), 0, 0.5); + + label10 = gtk_label_new(_("label10")); + gtk_widget_show(label10); + gtk_box_pack_start(GTK_BOX(vbox3), label10, FALSE, FALSE, 0); + + frame1 = gtk_frame_new(NULL); + gtk_widget_show(frame1); + gtk_box_pack_start(GTK_BOX(hbox4), frame1, TRUE, TRUE, 0); + gtk_frame_set_shadow_type(GTK_FRAME(frame1), GTK_SHADOW_NONE); + + alignment3 = gtk_alignment_new(0.5, 0.5, 1, 1); + gtk_widget_show(alignment3); + gtk_container_add(GTK_CONTAINER(frame1), alignment3); + gtk_alignment_set_padding(GTK_ALIGNMENT(alignment3), 0, 0, 12, 0); + + label12 = gtk_label_new(_("label12")); + gtk_widget_show(label12); + gtk_container_add(GTK_CONTAINER(alignment3), label12); + gtk_misc_set_alignment(GTK_MISC(label12), 0, 0); + + label11 = gtk_label_new(_("<b>Action</b>")); + gtk_widget_show(label11); + gtk_frame_set_label_widget(GTK_FRAME(frame1), label11); + gtk_label_set_use_markup(GTK_LABEL(label11), TRUE); + + label3 = gtk_label_new(_("<b>Details:</b>")); + gtk_widget_show(label3); + gtk_expander_set_label_widget(GTK_EXPANDER(expander1), label3); + gtk_label_set_use_markup(GTK_LABEL(label3), TRUE); + + hseparator2 = gtk_hseparator_new(); + gtk_widget_show(hseparator2); + gtk_box_pack_start(GTK_BOX(vbox1), hseparator2, FALSE, FALSE, 0); + + hbuttonbox1 = gtk_hbutton_box_new(); + gtk_widget_show(hbuttonbox1); + gtk_box_pack_start(GTK_BOX(vbox1), hbuttonbox1, FALSE, FALSE, 0); + gtk_button_box_set_layout(GTK_BUTTON_BOX(hbuttonbox1), GTK_BUTTONBOX_END); + gtk_box_set_spacing(GTK_BOX(hbuttonbox1), 8); + + button1 = gtk_button_new(); + gtk_widget_show(button1); + gtk_container_add(GTK_CONTAINER(hbuttonbox1), button1); + GTK_WIDGET_SET_FLAGS(button1, GTK_CAN_DEFAULT); + + alignment1 = gtk_alignment_new(0.5, 0.5, 0, 0); + gtk_widget_show(alignment1); + gtk_container_add(GTK_CONTAINER(button1), alignment1); + + hbox1 = gtk_hbox_new(FALSE, 2); + gtk_widget_show(hbox1); + gtk_container_add(GTK_CONTAINER(alignment1), hbox1); + + image1 = gtk_image_new_from_stock("gtk-apply", GTK_ICON_SIZE_BUTTON); + gtk_widget_show(image1); + gtk_box_pack_start(GTK_BOX(hbox1), image1, FALSE, FALSE, 0); + + label1 = gtk_label_new_with_mnemonic(_("Apply")); + gtk_widget_show(label1); + gtk_box_pack_start(GTK_BOX(hbox1), label1, FALSE, FALSE, 0); + + button2 = gtk_button_new(); + gtk_widget_show(button2); + gtk_container_add(GTK_CONTAINER(hbuttonbox1), button2); + GTK_WIDGET_SET_FLAGS(button2, GTK_CAN_DEFAULT); + + alignment2 = gtk_alignment_new(0.5, 0.5, 0, 0); + gtk_widget_show(alignment2); + gtk_container_add(GTK_CONTAINER(button2), alignment2); + + hbox2 = gtk_hbox_new(FALSE, 2); + gtk_widget_show(hbox2); + gtk_container_add(GTK_CONTAINER(alignment2), hbox2); + + image2 = gtk_image_new_from_stock("gtk-cancel", GTK_ICON_SIZE_BUTTON); + gtk_widget_show(image2); + gtk_box_pack_start(GTK_BOX(hbox2), image2, FALSE, FALSE, 0); + + label2 = gtk_label_new_with_mnemonic(_("Cancel")); + gtk_widget_show(label2); + gtk_box_pack_start(GTK_BOX(hbox2), label2, FALSE, FALSE, 0); + + + + + + + return result; + +} + + + + + + + + diff --git a/src/dialogs/plugins.h b/src/dialogs/plugins.h new file mode 100644 index 0000000..5de15ca --- /dev/null +++ b/src/dialogs/plugins.h @@ -0,0 +1,40 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * plugins.h - prototypes pour la boîte de dialogue permettant une sélection des greffons + * + * Copyright (C) 2010 Cyrille Bagard + * + * This file is part of OpenIDA. + * + * OpenIDA is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * OpenIDA is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef _DIALOGS_SECTIONS_H +#define _DIALOGS_SECTIONS_H + + +#include <gtk/gtk.h> + + +#include "../analysis/binary.h" + + + +/* Construit la fenêtre de sélection des sections. */ +GtkWidget *create_plugins_selection_dialog(GOpenidaBinary *, GtkWindow *); + + + +#endif /* _DLG_SECTIONS_H */ |