diff options
Diffstat (limited to 'plugins/ropgadgets')
-rw-r--r-- | plugins/ropgadgets/plugin.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/plugins/ropgadgets/plugin.c b/plugins/ropgadgets/plugin.c index c4c33dc..836717c 100644 --- a/plugins/ropgadgets/plugin.c +++ b/plugins/ropgadgets/plugin.c @@ -70,27 +70,34 @@ static void mcb_plugins_list_rop_gadgets(GtkMenuItem *, gpointer); G_MODULE_EXPORT bool chrysalide_plugin_init(GPluginModule *plugin) { bool result; /* Bilan à retourner */ - GObject *ref; /* Espace de référencements */ - GtkContainer *menubar; /* Support pour éléments */ + GtkBuilder *builder; /* Constructeur principal */ + GtkMenuItem *item; /* Menu à compléter */ + GtkContainer *menu; /* Support pour éléments */ GtkWidget *submenuitem; /* Sous-élément de menu */ result = false; - ref = G_OBJECT(get_editor_window()); - if (ref == NULL) goto no_editor; + builder = get_editor_builder(); + if (builder == NULL) + { + result = true; + goto no_editor; + } - menubar = GTK_CONTAINER(g_object_get_data(ref, "menubar_plugins")); - if (menubar == NULL) goto no_menubar; + item = GTK_MENU_ITEM(gtk_builder_get_object(builder, "binary")); + if (item == NULL) goto no_binary_menu; - submenuitem = qck_create_menu_item(ref, "mnu_plugins_ropgadgets", _("List ROP gadgets"), + menu = GTK_CONTAINER(gtk_menu_item_get_submenu(item)); + + submenuitem = qck_create_menu_item(G_OBJECT(item), "binary_ropgadgets", _("List ROP gadgets"), G_CALLBACK(mcb_plugins_list_rop_gadgets), NULL); - gtk_container_add(GTK_CONTAINER(menubar), submenuitem); + gtk_container_add(GTK_CONTAINER(menu), submenuitem); result = true; - no_menubar: + no_binary_menu: - g_object_unref(ref); + g_object_unref(G_OBJECT(builder)); no_editor: |