summaryrefslogtreecommitdiff
path: root/plugins/apihashing/classics
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-10-11 23:16:21 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-10-11 23:16:21 (GMT)
commitab6b87b7309e2d00926615f6557016bee6ab0b71 (patch)
treebf69b93d2f0548fc845e68ae1e8519bd33d1da24 /plugins/apihashing/classics
parent404097b7b07b336b427b3682ec2bc48d831cb2e9 (diff)
Add two new functions to ROST grammar: modpath and maxcommon.
Diffstat (limited to 'plugins/apihashing/classics')
-rw-r--r--plugins/apihashing/classics/ror13.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/plugins/apihashing/classics/ror13.c b/plugins/apihashing/classics/ror13.c
index 6e063f8..1b2421d 100644
--- a/plugins/apihashing/classics/ror13.c
+++ b/plugins/apihashing/classics/ror13.c
@@ -62,6 +62,9 @@ static uint32_t compute_ror13(const sized_binary_t *);
/* Transforme une séquence d'octets pour motif de recherche. */
static bool g_scan_ror13_modifier_transform(const GScanRor13Modifier *, const sized_binary_t *, size_t, sized_binary_t **, size_t *);
+/* Retrouve l'origine d'une correspondance à partir d'un indice. */
+static char *g_scan_ror13_modifier_get_path(const GScanRor13Modifier *, size_t *);
+
/* ---------------------------------------------------------------------------------- */
@@ -100,6 +103,7 @@ static void g_scan_ror13_modifier_class_init(GScanRor13ModifierClass *klass)
modifier->get_name = (get_scan_modifier_name_fc)g_scan_ror13_modifier_get_name;
modifier->transform = (transform_scan_token_fc)g_scan_ror13_modifier_transform;
+ modifier->get_path = (get_modifier_path)g_scan_ror13_modifier_get_path;
}
@@ -286,3 +290,34 @@ static bool g_scan_ror13_modifier_transform(const GScanRor13Modifier *modifier,
return result;
}
+
+
+/******************************************************************************
+* *
+* Paramètres : modifier = modificateur à consulter. *
+* index = indice de la combinaison ciblée. [OUT] *
+* *
+* Description : Retrouve l'origine d'une correspondance à partir d'un indice.*
+* *
+* Retour : Version humainement lisible de la combinaison. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static char *g_scan_ror13_modifier_get_path(const GScanRor13Modifier *modifier, size_t *index)
+{
+ char *result; /* Combinaison à retourner */
+
+ if (*index > 0)
+ {
+ result = NULL;
+ (*index)--;
+ }
+
+ else
+ result = strdup("rev");
+
+ return result;
+
+}