diff options
| author | Cyrille Bagard <nocbos@gmail.com> | 2019-07-20 15:59:12 (GMT) | 
|---|---|---|
| committer | Cyrille Bagard <nocbos@gmail.com> | 2019-07-20 15:59:12 (GMT) | 
| commit | f0682e7b195acbd4d83148f3829479d682f9ee9f (patch) | |
| tree | 39ec963de4b08dfde01cb621a48d14e01a365541 /src | |
| parent | 71db5a3a8a7a337ba63a47b6472baf99581d8400 (diff) | |
Marked some Dex strings as structural.
Diffstat (limited to 'src')
| -rw-r--r-- | src/format/strsym.c | 55 | ||||
| -rw-r--r-- | src/format/strsym.h | 8 | ||||
| -rw-r--r-- | src/gui/panels/strings.c | 3 | 
3 files changed, 66 insertions, 0 deletions
| diff --git a/src/format/strsym.c b/src/format/strsym.c index 4e8479e..ed38a6b 100644 --- a/src/format/strsym.c +++ b/src/format/strsym.c @@ -44,6 +44,8 @@ struct _GStrSymbol  {      GBinSymbol parent;                      /* A laisser en premier        */ +    bool structural;                        /* Nature d'emploi de la chaîne*/ +      StringEncodingType encoding;            /* Encodage de la chaîne liée  */      union @@ -150,6 +152,13 @@ static void g_string_symbol_class_init(GStrSymbolClass *klass)  static void g_string_symbol_init(GStrSymbol *symbol)  { +    symbol->structural = false; + +    symbol->encoding = SET_NONE; + +    symbol->string = NULL; + +    symbol->has_content = false;  } @@ -321,6 +330,10 @@ static void g_string_symbol_check_encoding(GStrSymbol *symbol)      switch (symbol->encoding)      { +        case SET_NONE: +            assert(false); +            break; +          case SET_ASCII:              break; @@ -378,6 +391,48 @@ static void g_string_symbol_check_encoding(GStrSymbol *symbol)  /******************************************************************************  *                                                                             * +*  Paramètres  : symbol = symbole à venir actualiser.                         * +*                                                                             * +*  Description : Définit si une chaîne de caractères est liée au format.      * +*                                                                             * +*  Retour      : -                                                            * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +void g_string_symbol_set_structural(GStrSymbol *symbol, bool status) +{ +    symbol->structural = status; + +} + + +/****************************************************************************** +*                                                                             * +*  Paramètres  : symbol = symbole à venir consulter.                          * +*                                                                             * +*  Description : Indique si une chaîne de caractères est liée au format.      * +*                                                                             * +*  Retour      : Indication sur l'emploi de la chaîne.                        * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +bool g_string_symbol_is_structural(const GStrSymbol *symbol) +{ +    bool result;                            /* Statut à retourner          */ + +    result = symbol->structural; + +    return result; + +} + + +/****************************************************************************** +*                                                                             *  *  Paramètres  : symbol = symbole à venir consulter.                          *  *                                                                             *  *  Description : Fournit l'encodage d'une chaîne de caractères.               * diff --git a/src/format/strsym.h b/src/format/strsym.h index 4a1404b..a4c7d58 100644 --- a/src/format/strsym.h +++ b/src/format/strsym.h @@ -39,6 +39,8 @@  /* Types de chaînes */  typedef enum _StringEncodingType  { +    SET_NONE,                               /* Valeur d'initialisation     */ +      SET_ASCII,                              /* Format brut                 */      SET_UTF_8,                              /* Format UTF-8                */      SET_MUTF_8,                             /* Format UTF-8 modifié        */ @@ -72,6 +74,12 @@ GBinSymbol *g_string_symbol_new_read_only(GBinFormat *, const mrange_t *, String  /* Crée un nouveau symbole pour chaîne de caractères. */  GBinSymbol *g_string_symbol_new_dynamic(const char *, const vmpa2t *, StringEncodingType); +/* Définit si une chaîne de caractères est liée au format. */ +void g_string_symbol_set_structural(GStrSymbol *, bool); + +/* Indique si une chaîne de caractères est liée au format. */ +bool g_string_symbol_is_structural(const GStrSymbol *); +  /* Fournit l'encodage d'une chaîne de caractères. */  StringEncodingType g_string_symbol_get_encoding(const GStrSymbol *); diff --git a/src/gui/panels/strings.c b/src/gui/panels/strings.c index a99b40c..879b37b 100644 --- a/src/gui/panels/strings.c +++ b/src/gui/panels/strings.c @@ -770,6 +770,9 @@ static void reload_strings_for_new_list_view(const GStringsPanel *panel, GtkStat          if (!G_IS_STR_SYMBOL(symbol))              goto rsfnlv_next; +        if (g_string_symbol_is_structural(G_STR_SYMBOL(symbol))) +            goto rsfnlv_next; +          range = g_binary_symbol_get_range(symbol);          addr = get_mrange_addr(range); | 
