summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-10-12 21:42:15 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-10-12 21:42:15 (GMT)
commitf393bbf6c8ca170dc17a41a386aef8bffab49591 (patch)
treedee24b1b58893415fbc8e94eb64d84aa78517533 /src/analysis
parentbd7816732508f5e1262b2292779db313d8969184 (diff)
Implement two extra modifiers for ROST: "lower" and "upper".
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/scan/core.c4
-rw-r--r--src/analysis/scan/patterns/modifiers/Makefile.am2
-rw-r--r--src/analysis/scan/patterns/modifiers/lower.c301
-rw-r--r--src/analysis/scan/patterns/modifiers/lower.h58
-rw-r--r--src/analysis/scan/patterns/modifiers/upper.c301
-rw-r--r--src/analysis/scan/patterns/modifiers/upper.h58
6 files changed, 724 insertions, 0 deletions
diff --git a/src/analysis/scan/core.c b/src/analysis/scan/core.c
index 867e084..7e1e462 100644
--- a/src/analysis/scan/core.c
+++ b/src/analysis/scan/core.c
@@ -47,8 +47,10 @@
#include "items/time/make.h"
#include "items/time/now.h"
#include "patterns/modifiers/hex.h"
+#include "patterns/modifiers/lower.h"
#include "patterns/modifiers/plain.h"
#include "patterns/modifiers/rev.h"
+#include "patterns/modifiers/upper.h"
#include "patterns/modifiers/wide.h"
#include "patterns/modifiers/xor.h"
@@ -143,8 +145,10 @@ bool load_all_known_scan_token_modifiers(void)
})
if (result) result = REGISTER_SCAN_MODIFIER(g_scan_hex_modifier_new());
+ if (result) result = REGISTER_SCAN_MODIFIER(g_scan_lower_modifier_new());
if (result) result = REGISTER_SCAN_MODIFIER(g_scan_plain_modifier_new());
if (result) result = REGISTER_SCAN_MODIFIER(g_scan_reverse_modifier_new());
+ if (result) result = REGISTER_SCAN_MODIFIER(g_scan_upper_modifier_new());
if (result) result = REGISTER_SCAN_MODIFIER(g_scan_wide_modifier_new());
if (result) result = REGISTER_SCAN_MODIFIER(g_scan_xor_modifier_new());
diff --git a/src/analysis/scan/patterns/modifiers/Makefile.am b/src/analysis/scan/patterns/modifiers/Makefile.am
index 96d549a..900e4e4 100644
--- a/src/analysis/scan/patterns/modifiers/Makefile.am
+++ b/src/analysis/scan/patterns/modifiers/Makefile.am
@@ -6,8 +6,10 @@ libanalysisscanpatternsmodifiers_la_SOURCES = \
hex.h hex.c \
list-int.h \
list.h list.c \
+ lower.h lower.c \
plain.h plain.c \
rev.h rev.c \
+ upper.h upper.c \
wide.h wide.c \
xor.h xor.c
diff --git a/src/analysis/scan/patterns/modifiers/lower.c b/src/analysis/scan/patterns/modifiers/lower.c
new file mode 100644
index 0000000..3904c52
--- /dev/null
+++ b/src/analysis/scan/patterns/modifiers/lower.c
@@ -0,0 +1,301 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * lower.c - transformation d'une séquence d'octets par passage en minuscules
+ *
+ * Copyright (C) 2023 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * Chrysalide 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.
+ *
+ * Chrysalide 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 "lower.h"
+
+
+#include <malloc.h>
+#include <string.h>
+
+
+#include "../modifier-int.h"
+
+
+
+/* ----------------------- RECHERCHE D'UN MOTIF DE TEXTE BRUT ----------------------- */
+
+
+/* Initialise la classe des transmissions en minuscules. */
+static void g_scan_lower_modifier_class_init(GScanLowerModifierClass *klass);
+
+/* Initialise une instance de transmission en minuscules. */
+static void g_scan_lower_modifier_init(GScanLowerModifier *);
+
+/* Supprime toutes les références externes. */
+static void g_scan_lower_modifier_dispose(GScanLowerModifier *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_scan_lower_modifier_finalize(GScanLowerModifier *);
+
+
+
+/* --------------------- IMPLEMENTATION DES FONCTIONS DE CLASSE --------------------- */
+
+
+/* Fournit le nom d'appel d'un modificateur pour motif. */
+static char *g_scan_lower_modifier_get_name(const GScanLowerModifier *);
+
+/* Transforme une séquence d'octets pour motif de recherche. */
+static bool g_scan_lower_modifier_transform(const GScanLowerModifier *, 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_lower_modifier_get_path(const GScanLowerModifier *, size_t *);
+
+
+
+/* ---------------------------------------------------------------------------------- */
+/* RECHERCHE D'UN MOTIF DE TEXTE BRUT */
+/* ---------------------------------------------------------------------------------- */
+
+
+/* Indique le type défini pour une transformation par bascule en minuscules. */
+G_DEFINE_TYPE(GScanLowerModifier, g_scan_lower_modifier, G_TYPE_SCAN_TOKEN_MODIFIER);
+
+
+/******************************************************************************
+* *
+* Paramètres : klass = classe à initialiser. *
+* *
+* Description : Initialise la classe des transmissions en minuscules. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_scan_lower_modifier_class_init(GScanLowerModifierClass *klass)
+{
+ GObjectClass *object; /* Autre version de la classe */
+ GScanTokenModifierClass *modifier; /* Version de classe parente */
+
+ object = G_OBJECT_CLASS(klass);
+
+ object->dispose = (GObjectFinalizeFunc/* ! */)g_scan_lower_modifier_dispose;
+ object->finalize = (GObjectFinalizeFunc)g_scan_lower_modifier_finalize;
+
+ modifier = G_SCAN_TOKEN_MODIFIER_CLASS(klass);
+
+ modifier->get_name = (get_scan_modifier_name_fc)g_scan_lower_modifier_get_name;
+
+ modifier->transform = (transform_scan_token_fc)g_scan_lower_modifier_transform;
+ modifier->get_path = (get_modifier_path)g_scan_lower_modifier_get_path;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : modifier = instance à initialiser. *
+* *
+* Description : Initialise une instance de transmission en minuscules. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_scan_lower_modifier_init(GScanLowerModifier *modifier)
+{
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : modifier = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_scan_lower_modifier_dispose(GScanLowerModifier *modifier)
+{
+ G_OBJECT_CLASS(g_scan_lower_modifier_parent_class)->dispose(G_OBJECT(modifier));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : modifier = instance d'objet GLib à traiter. *
+* *
+* Description : Procède à la libération totale de la mémoire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_scan_lower_modifier_finalize(GScanLowerModifier *modifier)
+{
+ G_OBJECT_CLASS(g_scan_lower_modifier_parent_class)->finalize(G_OBJECT(modifier));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : - *
+* *
+* Description : Construit un modificateur livrant des octets en minuscules. *
+* *
+* Retour : Mécanisme mis en place. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GScanTokenModifier *g_scan_lower_modifier_new(void)
+{
+ GScanTokenModifier *result; /* Structure à retourner */
+
+ result = g_object_new(G_TYPE_SCAN_LOWER_MODIFIER, NULL);
+
+ return result;
+
+}
+
+
+
+/* ---------------------------------------------------------------------------------- */
+/* IMPLEMENTATION DES FONCTIONS DE CLASSE */
+/* ---------------------------------------------------------------------------------- */
+
+
+/******************************************************************************
+* *
+* Paramètres : modifier = modificateur à consulter. *
+* *
+* Description : Fournit le nom d'appel d'un modificateur pour motif. *
+* *
+* Retour : Désignation humaine. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static char *g_scan_lower_modifier_get_name(const GScanLowerModifier *modifier)
+{
+ char *result; /* Désignation à retourner */
+
+ result = strdup("lower");
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : modifier = modificateur à solliciter. *
+* src = séquences d'octets à traiter. *
+* scount = quantité de ces séquences. *
+* dest = nouvelle(s) séquence(s) d'octets obtenue(s) [OUT] *
+* dcount = quantité de ces séquences. *
+* *
+* Description : Transforme une séquence d'octets pour motif de recherche. *
+* *
+* Retour : Bilan de l'opération : succès ou échec. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static bool g_scan_lower_modifier_transform(const GScanLowerModifier *modifier, const sized_binary_t *src, size_t scount, sized_binary_t **dest, size_t *dcount)
+{
+ bool result; /* Bilan d'opération à renvoyer*/
+ sized_binary_t *binary; /* Raccourci vers le stockage */
+ size_t i; /* Boucle de parcours #1 */
+ const sized_binary_t *_src; /* Source courante */
+ size_t k; /* Boucle de parcours #2 */
+
+ result = true;
+
+ *dcount = scount;
+ *dest = malloc(*dcount * sizeof(sized_binary_t));
+
+ binary = &(*dest)[0];
+
+ for (i = 0; i < scount; i++, binary++)
+ {
+ _src = src + i;
+
+ binary->len = _src->len;
+ binary->data = malloc(binary->len);
+
+ for (k = 0; k < _src->len; k++)
+ switch (_src->data[k])
+ {
+ case 'A' ... 'Z':
+ binary->data[k] = _src->data[k] + 0x20;
+ break;
+
+ default:
+ binary->data[k] = _src->data[k];
+ break;
+
+ }
+
+ }
+
+ 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_lower_modifier_get_path(const GScanLowerModifier *modifier, size_t *index)
+{
+ char *result; /* Combinaison à retourner */
+
+ if (*index > 0)
+ {
+ result = NULL;
+ (*index)--;
+ }
+
+ else
+ result = strdup("lower");
+
+ return result;
+
+}
diff --git a/src/analysis/scan/patterns/modifiers/lower.h b/src/analysis/scan/patterns/modifiers/lower.h
new file mode 100644
index 0000000..d361340
--- /dev/null
+++ b/src/analysis/scan/patterns/modifiers/lower.h
@@ -0,0 +1,58 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * lower.h - prototypes pour la transformation d'une séquence d'octets par passage en minuscules
+ *
+ * Copyright (C) 2023 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * Chrysalide 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.
+ *
+ * Chrysalide 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 _ANALYSIS_SCAN_PATTERNS_MODIFIERS_LOWER_H
+#define _ANALYSIS_SCAN_PATTERNS_MODIFIERS_LOWER_H
+
+
+#include <glib-object.h>
+
+
+#include "../modifier.h"
+
+
+
+#define G_TYPE_SCAN_LOWER_MODIFIER g_scan_lower_modifier_get_type()
+#define G_SCAN_LOWER_MODIFIER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_SCAN_LOWER_MODIFIER, GScanLowerModifier))
+#define G_IS_SCAN_LOWER_MODIFIER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_SCAN_LOWER_MODIFIER))
+#define G_SCAN_LOWER_MODIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_SCAN_LOWER_MODIFIER, GScanLowerModifierClass))
+#define G_IS_SCAN_LOWER_MODIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_SCAN_LOWER_MODIFIER))
+#define G_SCAN_LOWER_MODIFIER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_SCAN_LOWER_MODIFIER, GScanLowerModifierClass))
+
+
+/* Transformation d'une séquence d'octets par passage en minuscules (instance) */
+typedef GScanTokenModifier GScanLowerModifier;
+
+/* Transformation d'une séquence d'octets par passage en minuscules (classe) */
+typedef GScanTokenModifierClass GScanLowerModifierClass;
+
+
+/* Indique le type défini pour une transformation par bascule en minuscules. */
+GType g_scan_lower_modifier_get_type(void);
+
+/* Construit un modificateur livrant des octets en minuscules. */
+GScanTokenModifier *g_scan_lower_modifier_new(void);
+
+
+
+#endif /* _ANALYSIS_SCAN_PATTERNS_MODIFIERS_LOWER_H */
diff --git a/src/analysis/scan/patterns/modifiers/upper.c b/src/analysis/scan/patterns/modifiers/upper.c
new file mode 100644
index 0000000..9d1086b
--- /dev/null
+++ b/src/analysis/scan/patterns/modifiers/upper.c
@@ -0,0 +1,301 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * upper.c - transformation d'une séquence d'octets par passage en majuscules
+ *
+ * Copyright (C) 2023 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * Chrysalide 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.
+ *
+ * Chrysalide 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 "upper.h"
+
+
+#include <malloc.h>
+#include <string.h>
+
+
+#include "../modifier-int.h"
+
+
+
+/* ----------------------- RECHERCHE D'UN MOTIF DE TEXTE BRUT ----------------------- */
+
+
+/* Initialise la classe des transmissions en majuscules. */
+static void g_scan_upper_modifier_class_init(GScanUpperModifierClass *klass);
+
+/* Initialise une instance de transmission en majuscules. */
+static void g_scan_upper_modifier_init(GScanUpperModifier *);
+
+/* Supprime toutes les références externes. */
+static void g_scan_upper_modifier_dispose(GScanUpperModifier *);
+
+/* Procède à la libération totale de la mémoire. */
+static void g_scan_upper_modifier_finalize(GScanUpperModifier *);
+
+
+
+/* --------------------- IMPLEMENTATION DES FONCTIONS DE CLASSE --------------------- */
+
+
+/* Fournit le nom d'appel d'un modificateur pour motif. */
+static char *g_scan_upper_modifier_get_name(const GScanUpperModifier *);
+
+/* Transforme une séquence d'octets pour motif de recherche. */
+static bool g_scan_upper_modifier_transform(const GScanUpperModifier *, 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_upper_modifier_get_path(const GScanUpperModifier *, size_t *);
+
+
+
+/* ---------------------------------------------------------------------------------- */
+/* RECHERCHE D'UN MOTIF DE TEXTE BRUT */
+/* ---------------------------------------------------------------------------------- */
+
+
+/* Indique le type défini pour une transformation par bascule en majuscules. */
+G_DEFINE_TYPE(GScanUpperModifier, g_scan_upper_modifier, G_TYPE_SCAN_TOKEN_MODIFIER);
+
+
+/******************************************************************************
+* *
+* Paramètres : klass = classe à initialiser. *
+* *
+* Description : Initialise la classe des transmissions en majuscules. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_scan_upper_modifier_class_init(GScanUpperModifierClass *klass)
+{
+ GObjectClass *object; /* Autre version de la classe */
+ GScanTokenModifierClass *modifier; /* Version de classe parente */
+
+ object = G_OBJECT_CLASS(klass);
+
+ object->dispose = (GObjectFinalizeFunc/* ! */)g_scan_upper_modifier_dispose;
+ object->finalize = (GObjectFinalizeFunc)g_scan_upper_modifier_finalize;
+
+ modifier = G_SCAN_TOKEN_MODIFIER_CLASS(klass);
+
+ modifier->get_name = (get_scan_modifier_name_fc)g_scan_upper_modifier_get_name;
+
+ modifier->transform = (transform_scan_token_fc)g_scan_upper_modifier_transform;
+ modifier->get_path = (get_modifier_path)g_scan_upper_modifier_get_path;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : modifier = instance à initialiser. *
+* *
+* Description : Initialise une instance de transmission en majuscules. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_scan_upper_modifier_init(GScanUpperModifier *modifier)
+{
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : modifier = instance d'objet GLib à traiter. *
+* *
+* Description : Supprime toutes les références externes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_scan_upper_modifier_dispose(GScanUpperModifier *modifier)
+{
+ G_OBJECT_CLASS(g_scan_upper_modifier_parent_class)->dispose(G_OBJECT(modifier));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : modifier = instance d'objet GLib à traiter. *
+* *
+* Description : Procède à la libération totale de la mémoire. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_scan_upper_modifier_finalize(GScanUpperModifier *modifier)
+{
+ G_OBJECT_CLASS(g_scan_upper_modifier_parent_class)->finalize(G_OBJECT(modifier));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : - *
+* *
+* Description : Construit un modificateur livrant des octets en majuscules. *
+* *
+* Retour : Mécanisme mis en place. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GScanTokenModifier *g_scan_upper_modifier_new(void)
+{
+ GScanTokenModifier *result; /* Structure à retourner */
+
+ result = g_object_new(G_TYPE_SCAN_UPPER_MODIFIER, NULL);
+
+ return result;
+
+}
+
+
+
+/* ---------------------------------------------------------------------------------- */
+/* IMPLEMENTATION DES FONCTIONS DE CLASSE */
+/* ---------------------------------------------------------------------------------- */
+
+
+/******************************************************************************
+* *
+* Paramètres : modifier = modificateur à consulter. *
+* *
+* Description : Fournit le nom d'appel d'un modificateur pour motif. *
+* *
+* Retour : Désignation humaine. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static char *g_scan_upper_modifier_get_name(const GScanUpperModifier *modifier)
+{
+ char *result; /* Désignation à retourner */
+
+ result = strdup("upper");
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : modifier = modificateur à solliciter. *
+* src = séquences d'octets à traiter. *
+* scount = quantité de ces séquences. *
+* dest = nouvelle(s) séquence(s) d'octets obtenue(s) [OUT] *
+* dcount = quantité de ces séquences. *
+* *
+* Description : Transforme une séquence d'octets pour motif de recherche. *
+* *
+* Retour : Bilan de l'opération : succès ou échec. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static bool g_scan_upper_modifier_transform(const GScanUpperModifier *modifier, const sized_binary_t *src, size_t scount, sized_binary_t **dest, size_t *dcount)
+{
+ bool result; /* Bilan d'opération à renvoyer*/
+ sized_binary_t *binary; /* Raccourci vers le stockage */
+ size_t i; /* Boucle de parcours #1 */
+ const sized_binary_t *_src; /* Source courante */
+ size_t k; /* Boucle de parcours #2 */
+
+ result = true;
+
+ *dcount = scount;
+ *dest = malloc(*dcount * sizeof(sized_binary_t));
+
+ binary = &(*dest)[0];
+
+ for (i = 0; i < scount; i++, binary++)
+ {
+ _src = src + i;
+
+ binary->len = _src->len;
+ binary->data = malloc(binary->len);
+
+ for (k = 0; k < _src->len; k++)
+ switch (_src->data[k])
+ {
+ case 'a' ... 'z':
+ binary->data[k] = _src->data[k] - 0x20;
+ break;
+
+ default:
+ binary->data[k] = _src->data[k];
+ break;
+
+ }
+
+ }
+
+ 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_upper_modifier_get_path(const GScanUpperModifier *modifier, size_t *index)
+{
+ char *result; /* Combinaison à retourner */
+
+ if (*index > 0)
+ {
+ result = NULL;
+ (*index)--;
+ }
+
+ else
+ result = strdup("upper");
+
+ return result;
+
+}
diff --git a/src/analysis/scan/patterns/modifiers/upper.h b/src/analysis/scan/patterns/modifiers/upper.h
new file mode 100644
index 0000000..4666312
--- /dev/null
+++ b/src/analysis/scan/patterns/modifiers/upper.h
@@ -0,0 +1,58 @@
+
+/* Chrysalide - Outil d'analyse de fichiers binaires
+ * upper.h - prototypes pour la transformation d'une séquence d'octets par passage en majuscules
+ *
+ * Copyright (C) 2023 Cyrille Bagard
+ *
+ * This file is part of Chrysalide.
+ *
+ * Chrysalide 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.
+ *
+ * Chrysalide 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 _ANALYSIS_SCAN_PATTERNS_MODIFIERS_UPPER_H
+#define _ANALYSIS_SCAN_PATTERNS_MODIFIERS_UPPER_H
+
+
+#include <glib-object.h>
+
+
+#include "../modifier.h"
+
+
+
+#define G_TYPE_SCAN_UPPER_MODIFIER g_scan_upper_modifier_get_type()
+#define G_SCAN_UPPER_MODIFIER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_SCAN_UPPER_MODIFIER, GScanUpperModifier))
+#define G_IS_SCAN_UPPER_MODIFIER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_SCAN_UPPER_MODIFIER))
+#define G_SCAN_UPPER_MODIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_SCAN_UPPER_MODIFIER, GScanUpperModifierClass))
+#define G_IS_SCAN_UPPER_MODIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_SCAN_UPPER_MODIFIER))
+#define G_SCAN_UPPER_MODIFIER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_SCAN_UPPER_MODIFIER, GScanUpperModifierClass))
+
+
+/* Transformation d'une séquence d'octets par passage en majuscules (instance) */
+typedef GScanTokenModifier GScanUpperModifier;
+
+/* Transformation d'une séquence d'octets par passage en majuscules (classe) */
+typedef GScanTokenModifierClass GScanUpperModifierClass;
+
+
+/* Indique le type défini pour une transformation par bascule en majuscules. */
+GType g_scan_upper_modifier_get_type(void);
+
+/* Construit un modificateur livrant des octets en majuscules. */
+GScanTokenModifier *g_scan_upper_modifier_new(void);
+
+
+
+#endif /* _ANALYSIS_SCAN_PATTERNS_MODIFIERS_UPPER_H */