diff options
Diffstat (limited to 'src/analysis/scan/patterns/tokens/nodes/any.c')
-rw-r--r-- | src/analysis/scan/patterns/tokens/nodes/any.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/analysis/scan/patterns/tokens/nodes/any.c b/src/analysis/scan/patterns/tokens/nodes/any.c index e5fb1d7..6233cb4 100644 --- a/src/analysis/scan/patterns/tokens/nodes/any.c +++ b/src/analysis/scan/patterns/tokens/nodes/any.c @@ -196,7 +196,7 @@ GScanTokenNode *g_scan_token_node_any_new(const phys_t *min, const phys_t *max) * min = éventuelle quantité minimale à retrouver. * * max = éventuelle quantité maximale à retrouver. * * * -* Description : Met en place un un noeud pointant une série d'octets. * +* Description : Met en place un noeud pointant une série d'octets. * * * * Retour : Bilan de l'opération. * * * @@ -221,6 +221,9 @@ bool g_scan_token_node_any_create(GScanTokenNodeAny *any, const phys_t *min, con result = (any->min <= any->max); + if (result && any->min == any->max) + result = (any->min > 0); + } any->has_max = (max != NULL); @@ -230,6 +233,29 @@ bool g_scan_token_node_any_create(GScanTokenNodeAny *any, const phys_t *min, con } +/****************************************************************************** +* * +* Paramètres : any = séquence d'octets quelconques à étendre. * +* extra = étendue supplémentaire à intégrer. * +* * +* Description : Etend un noeud pointant une série d'octets. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_scan_token_node_any_merge(GScanTokenNodeAny *any, GScanTokenNodeAny *extra) +{ + any->min += extra->min; + + if (any->has_max && extra->has_max) + any->max += extra->max; + +} + + /* ---------------------------------------------------------------------------------- */ /* IMPLEMENTATION DES FONCTIONS DE CLASSE */ |