summaryrefslogtreecommitdiff
path: root/plugins/ropgadgets/select.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-09-19 22:28:42 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-09-19 22:28:42 (GMT)
commit0e3059731d9687027c913135b3b856596c49a689 (patch)
treed3c3754f95c90ae50168817e6248afee6873fbf3 /plugins/ropgadgets/select.c
parent18648e4e8763a3bc005d6fae51eae3d1528d7d29 (diff)
Extended the prototype for matching formats in order to get it suitable for plugins.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@577 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/ropgadgets/select.c')
-rw-r--r--plugins/ropgadgets/select.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/ropgadgets/select.c b/plugins/ropgadgets/select.c
index 53995e5..2497dd1 100644
--- a/plugins/ropgadgets/select.c
+++ b/plugins/ropgadgets/select.c
@@ -1316,7 +1316,8 @@ static GBinFormat *load_external_format_for_rop_gadgets(GObject *ref)
GtkEntry *entry; /* Zone de saisie de texte */
const gchar *filename; /* Nom du fichier à charger */
GBinContent *content; /* Contenu binaire chargé */
- const char *target; /* Sous-traitance requise */
+ FormatMatchStatus status; /* Statut d'une reconnaissance */
+ char *target; /* Sous-traitance requise */
const char *desc; /* Description humaine associée*/
/* Récupération du nom de fichier */
@@ -1338,18 +1339,21 @@ static GBinFormat *load_external_format_for_rop_gadgets(GObject *ref)
/* Récupération du format de fichier associé */
- target = find_matching_format(content, NULL);
- desc = get_binary_format_name(target);
+ status = find_matching_format(content, NULL, &target);
- if (desc == NULL)
+ if (status != FMS_MATCHED)
{
g_object_unref(G_OBJECT(content));
push_status_printing_of_rop_search_step(ref, "format", _("unknown binary format"), false);
goto leffrg_error;
}
+ desc = get_binary_format_name(target);
+
result = load_new_named_format(target, content, NULL);
+ free(target);
+
if (result == NULL)
{
push_status_printing_of_rop_search_step(ref, "format", _("error while loading the binary"), false);