diff options
| author | Cyrille Bagard <nocbos@gmail.com> | 2018-08-02 22:25:15 (GMT) | 
|---|---|---|
| committer | Cyrille Bagard <nocbos@gmail.com> | 2018-08-02 22:25:15 (GMT) | 
| commit | 8c84aa2e41305fd388b7dac49f29ae17ee0554fb (patch) | |
| tree | 52830a7d896e2d9272e7c71677c72ce9d62cf26c /plugins/readelf/strtab.c | |
| parent | 30fc2ba22b469e38bc40e47f517988e418c178f3 (diff) | |
Introduced symbols dedicated to strings.
Diffstat (limited to 'plugins/readelf/strtab.c')
| -rw-r--r-- | plugins/readelf/strtab.c | 16 | 
1 files changed, 3 insertions, 13 deletions
| diff --git a/plugins/readelf/strtab.c b/plugins/readelf/strtab.c index e8d0f45..3cbe353 100644 --- a/plugins/readelf/strtab.c +++ b/plugins/readelf/strtab.c @@ -29,6 +29,7 @@  #include <arch/raw.h> +#include <format/strsym.h>  #include <plugins/elf/section.h> @@ -67,7 +68,6 @@ static void parse_elf_string_table(GElfFormat *format, GPreloadInfo *info, const      bool inserted;                          /* Bilan d'une insertion       */      const mrange_t *irange;                 /* Espace occupé par une chaîne*/      GBinSymbol *symbol;                     /* Symbole à intégrer          */ -    char *label;                            /* Désignation de la chaîne    */      length = get_mrange_length(range); @@ -112,23 +112,13 @@ static void parse_elf_string_table(GElfFormat *format, GPreloadInfo *info, const              {                  irange = g_arch_instruction_get_range(instr); -                symbol = g_binary_symbol_new(irange, STP_RO_STRING); +                symbol = g_string_symbol_new_read_only(base, irange, SET_GUESS);                  g_binary_format_add_symbol(base, symbol);                  /* Jointure avec la chaîne précédente ? */                  if (cut) -                { -                    copy_vmpa(&pos, get_mrange_addr(range)); -                    advance_vmpa(&pos, i); - -                    label = create_string_label(base, get_mrange_addr(irange), end - i); - -                    g_binary_symbol_set_alt_label(symbol, label); - -                    free(label); - -                } +                    g_string_symbol_build_label(G_STR_SYMBOL(symbol), base);              } | 
