summaryrefslogtreecommitdiff
path: root/plugins
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
parent6f3c4bc6ec571dcca8e25b9f82a0c2e72310900c (diff)
Cleaned the demangling system.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/dex/pool.c4
-rw-r--r--plugins/elf/symbols.c15
-rw-r--r--plugins/mobicore/symbols.c2
3 files changed, 11 insertions, 10 deletions
diff --git a/plugins/dex/pool.c b/plugins/dex/pool.c
index 081c178..8c740bc 100644
--- a/plugins/dex/pool.c
+++ b/plugins/dex/pool.c
@@ -280,7 +280,6 @@ GDataType *get_type_from_dex_pool(GDexFormat *format, uint32_t index)
type_id_item type_id; /* Définition de la classe */
string_id_item str_id; /* Identifiant de chaîne */
string_data_item str_data; /* Description de chaîne */
- GCompDemangler *demangler; /* Accès plus lisible */
result = NULL;
@@ -309,8 +308,7 @@ GDataType *get_type_from_dex_pool(GDexFormat *format, uint32_t index)
if (!read_dex_string_data_item(format, &addr, &str_data))
goto gtfdp_error;
- demangler = G_BIN_FORMAT(format)->demangler;
- format->types[index] = g_compiler_demangler_decode_type(demangler, (char *)str_data.data);
+ format->types[index] = g_binary_format_decode_type(G_BIN_FORMAT(format), (char *)str_data.data);
}
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));
diff --git a/plugins/mobicore/symbols.c b/plugins/mobicore/symbols.c
index 5b612cc..df8d62f 100644
--- a/plugins/mobicore/symbols.c
+++ b/plugins/mobicore/symbols.c
@@ -114,7 +114,7 @@ static bool load_all_mclf_basic_entry_points(GMCLFFormat *format)
if (ep != 0x0)
{
- routine = try_to_demangle_routine("entry_point");
+ routine = g_binary_format_decode_routine(G_BIN_FORMAT(format), "entry_point");
register_mclf_entry_point(format, ep, 0, routine);
}