summaryrefslogtreecommitdiff
path: root/plugins/elf
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-08-02 22:25:15 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-08-02 22:25:15 (GMT)
commit8c84aa2e41305fd388b7dac49f29ae17ee0554fb (patch)
tree52830a7d896e2d9272e7c71677c72ce9d62cf26c /plugins/elf
parent30fc2ba22b469e38bc40e47f517988e418c178f3 (diff)
Introduced symbols dedicated to strings.
Diffstat (limited to 'plugins/elf')
-rw-r--r--plugins/elf/strings.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/plugins/elf/strings.c b/plugins/elf/strings.c
index a14b389..4d6b5c8 100644
--- a/plugins/elf/strings.c
+++ b/plugins/elf/strings.c
@@ -36,6 +36,7 @@
#include <arch/raw.h>
#include <core/global.h>
#include <core/nproc.h>
+#include <format/strsym.h>
#include "elf-int.h"
@@ -285,7 +286,6 @@ static bool do_elf_string_loading(GElfLoading *loading, GElfFormat *format, phys
const mrange_t *range; /* Espace occupé par une chaîne*/
GBinSymbol *symbol; /* Symbole à intégrer */
bool cut; /* Coupure par étiquette ? */
- char *label; /* Désignation de la chaîne */
result = false;
@@ -355,7 +355,7 @@ static bool do_elf_string_loading(GElfLoading *loading, GElfFormat *format, phys
{
range = g_arch_instruction_get_range(instr);
- symbol = g_binary_symbol_new(range, STP_RO_STRING);
+ symbol = g_string_symbol_new_read_only(base, range, SET_GUESS);
g_binary_format_add_symbol(base, symbol);
/* Jointure avec la chaîne précédente ? */
@@ -366,14 +366,7 @@ static bool do_elf_string_loading(GElfLoading *loading, GElfFormat *format, phys
cut = (data[*iter - offset - 1] == '\0');
if (cut)
- {
- label = create_string_label(base, get_mrange_addr(range), end - *iter);
-
- g_binary_symbol_set_alt_label(symbol, label);
-
- free(label);
-
- }
+ g_string_symbol_build_label(G_STR_SYMBOL(symbol), base);
}