summaryrefslogtreecommitdiff
path: root/plugins/elf
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-07-08 21:54:13 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-07-08 21:54:13 (GMT)
commit21af77b7c44126c05b62319f99a679fc748b579e (patch)
tree07414fb7bb16cf60e2e827b507d1e5ffbb623414 /plugins/elf
parent6f3c4bc6ec571dcca8e25b9f82a0c2e72310900c (diff)
Cleaned the demangling system.
Diffstat (limited to 'plugins/elf')
-rw-r--r--plugins/elf/symbols.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/elf/symbols.c b/plugins/elf/symbols.c
index 90b9488..08d9377 100644
--- a/plugins/elf/symbols.c
+++ b/plugins/elf/symbols.c
@@ -232,6 +232,7 @@ static void register_elf_entry_point(GElfFormat *format, virt_t vaddr, phys_t le
static bool load_all_elf_basic_entry_points(GElfFormat *format)
{
+ GBinFormat *base; /* Autre version du format */
virt_t ep; /* Point d'entrée détecté */
GBinRoutine *routine; /* Routine à associer à un pt. */
elf_phdr dynamic; /* En-tête de programme DYNAMIC*/
@@ -244,13 +245,15 @@ static bool load_all_elf_basic_entry_points(GElfFormat *format)
uint32_t virt_32; /* Adresse virtuelle sur 32b */
uint64_t virt_64; /* Adresse virtuelle sur 64b */
+ base = G_BIN_FORMAT(format);
+
/* Point d'entrée principal éventuel */
ep = ELF_HDR(format, format->header, e_entry);
if (ep != 0x0)
{
- routine = try_to_demangle_routine("entry_point");
+ routine = g_binary_format_decode_routine(base, "entry_point");
register_elf_entry_point(format, ep, 0, routine);
}
@@ -267,7 +270,7 @@ static bool load_all_elf_basic_entry_points(GElfFormat *format)
if (ep != 0x0)
{
- routine = try_to_demangle_routine("init_function");
+ routine = g_binary_format_decode_routine(base, "init_function");
register_elf_entry_point(format, ep, 0, routine);
}
@@ -279,7 +282,7 @@ static bool load_all_elf_basic_entry_points(GElfFormat *format)
if (ep != 0x0)
{
- routine = try_to_demangle_routine("termination_function");
+ routine = g_binary_format_decode_routine(base, "termination_function");
register_elf_entry_point(format, ep, 0, routine);
}
@@ -332,7 +335,7 @@ static bool load_all_elf_basic_entry_points(GElfFormat *format)
{
snprintf(fullname, sizeof(fullname), "%s%u", prefix, i);
- routine = try_to_demangle_routine(fullname);
+ routine = g_binary_format_decode_routine(base, fullname);
register_elf_entry_point(fmt, ep, 0, routine);
}
@@ -403,7 +406,7 @@ static bool load_all_elf_basic_entry_points(GElfFormat *format)
if (ep != 0x0)
{
- routine = try_to_demangle_routine("plt_entry");
+ routine = g_binary_format_decode_routine(base, "plt_entry");
register_elf_entry_point(format, ep, 0, routine);
break;
}
@@ -526,7 +529,7 @@ static bool do_elf_symbol_loading(GElfLoading *loading, GElfFormat *format, bool
break;
}
- routine = try_to_demangle_routine(name);
+ routine = g_binary_format_decode_routine(base, name);
symbol = G_BIN_SYMBOL(routine);
init_mrange(&range, &addr, ELF_SYM(format, sym, st_size));