diff options
Diffstat (limited to 'src/analysis/scan/context-int.h')
| -rw-r--r-- | src/analysis/scan/context-int.h | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/analysis/scan/context-int.h b/src/analysis/scan/context-int.h index 654ecca..6135201 100644 --- a/src/analysis/scan/context-int.h +++ b/src/analysis/scan/context-int.h @@ -30,30 +30,23 @@ #include "expr.h" #include "../../common/fnv1a.h" +#include "../../glibext/umemslice.h" +//#define __USE_TABLE_FOR_MATCHES -#define ALLOCATION_STEP 10 -/* Mémorisation des correspondances partielles */ -typedef struct _atom_match_tracker_t -{ - phys_t *matches; /* Correspondances à confirmer */ - size_t allocated; /* Taille du talbeau préparé */ - size_t used; /* Nombre d'éléments présents */ - -} atom_match_tracker_t; +#ifndef __USE_TABLE_FOR_MATCHES -/* Mémorisation des correspondances complètes, par motif */ -typedef struct _full_match_tracker_t +/* Lien entre un motif et ses correspondances */ +typedef struct _matched_pattern_t { - GSearchPattern *pattern; /* Motif commun aux trouvailles*/ + const GSearchPattern *pattern; /* Motif recherché */ + GScanMatches *matches; /* Correspondances associées */ - GScanMatch **matches; /* Correspondances confirmées */ - size_t allocated; /* Taille du talbeau préparé */ - size_t used; /* Nombre d'éléments présents */ +} matched_pattern_t; -} full_match_tracker_t; +#endif /* Condition définissant une règle de correspondance */ typedef struct _rule_condition_t @@ -76,12 +69,17 @@ struct _GScanContext GBinContent *content; /* Contenu binaire traité */ bool scan_done; /* Phase d'analyse terminée ? */ - patid_t next_patid; /* Prochain indice utilisable */ - - atom_match_tracker_t *atom_trackers; /* Correspondances partielles */ + GUMemSlice *match_allocator; /* Suivi de correspondances */ + match_area_t **match_storages; /* Suivi de correspondances */ + size_t storages_count; /* Quantité de ces suivis */ - full_match_tracker_t **full_trackers; /* Correspondances confirmées */ +#ifdef __USE_TABLE_FOR_MATCHES + GHashTable *full_trackers; /* Correspondances confirmées */ +#else + matched_pattern_t *full_trackers; /* Correspondances confirmées */ + size_t full_allocated; /* Quantité d'éléments alloués */ size_t full_count; /* Quantité de correspondances */ +#endif bool global; /* Validation globale */ |
