diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-09-19 22:28:42 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-09-19 22:28:42 (GMT) |
commit | 0e3059731d9687027c913135b3b856596c49a689 (patch) | |
tree | d3c3754f95c90ae50168817e6248afee6873fbf3 /plugins/mobicore/mclf.c | |
parent | 18648e4e8763a3bc005d6fae51eae3d1528d7d29 (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/mobicore/mclf.c')
-rw-r--r-- | plugins/mobicore/mclf.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/mobicore/mclf.c b/plugins/mobicore/mclf.c index 99ff7ed..4ff44bb 100644 --- a/plugins/mobicore/mclf.c +++ b/plugins/mobicore/mclf.c @@ -56,6 +56,8 @@ static void g_mclf_format_refine_portions(const GMCLFFormat *, GBinPortion *); * * * Paramètres : content = contenu binaire à parcourir. * * parent = éventuel format exécutable déjà chargé. * +* unused = adresse non utilisée ici. * +* key = identifiant de format trouvé ou NULL. [OUT] * * * * Description : Indique si le format peut être pris en charge ici. * * * @@ -65,9 +67,9 @@ static void g_mclf_format_refine_portions(const GMCLFFormat *, GBinPortion *); * * ******************************************************************************/ -const char *mclf_is_matching(GBinContent *content, GExeFormat *parent) +FormatMatchStatus mclf_is_matching(GBinContent *content, GExeFormat *parent, void *unused, char **key) { - const char *result; /* Format détecté à renvoyer */ + FormatMatchStatus result; /* Bilan à renvoyer */ vmpa2t addr; /* Tête de lecture initiale */ bool status; /* Bilan des accès mémoire */ char magic[4]; /* Idenfiant standard */ @@ -78,7 +80,13 @@ const char *mclf_is_matching(GBinContent *content, GExeFormat *parent) status &= (memcmp(magic, MC_SERVICE_HEADER_MAGIC_STR, 4) == 0); - result = status ? "mclf" : NULL; + if (status) + { + result = FMS_MATCHED; + *key = strdup("mclf"); + } + else + result = FMS_UNKNOWN; return result; |