diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-05-24 07:43:32 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-05-24 07:43:32 (GMT) |
commit | 08c45a8c7970403c3d658b1b0af9ac09f66b4a7e (patch) | |
tree | 25a8108e36b7328c266ba6e71647243dfd6b7cac /plugins/elf/format.c | |
parent | 7135e7944c91d2e8b787c8782375423b9a90ed5b (diff) |
Translated offsets and addresses with more accuracy.
Diffstat (limited to 'plugins/elf/format.c')
-rw-r--r-- | plugins/elf/format.c | 68 |
1 files changed, 4 insertions, 64 deletions
diff --git a/plugins/elf/format.c b/plugins/elf/format.c index 9e29a11..3394ba2 100644 --- a/plugins/elf/format.c +++ b/plugins/elf/format.c @@ -84,12 +84,6 @@ static bool g_elf_format_get_main_address(GElfFormat *, vmpa2t *); /* Etend la définition des portions au sein d'un binaire. */ static void g_elf_format_refine_portions(GElfFormat *); -/* Fournit l'emplacement correspondant à une position physique. */ -static bool g_elf_format_translate_offset_into_vmpa(const GElfFormat *, phys_t, vmpa2t *); - -/* Fournit l'emplacement correspondant à une position physique. */ -static bool g_elf_format_translate_address_into_vmpa(const GElfFormat *, virt_t, vmpa2t *); - /* Fournit l'emplacement d'une section donnée. */ static bool g_elf_format_get_section_range_by_name(const GElfFormat *, const char *, mrange_t *); @@ -167,8 +161,8 @@ static void g_elf_format_class_init(GElfFormatClass *klass) exe->get_main_addr = (get_main_addr_fc)g_elf_format_get_main_address; exe->refine_portions = (refine_portions_fc)g_elf_format_refine_portions; - exe->translate_phys = (translate_phys_fc)g_elf_format_translate_offset_into_vmpa; - exe->translate_virt = (translate_virt_fc)g_elf_format_translate_address_into_vmpa; + exe->translate_phys = (translate_phys_fc)g_exe_format_translate_offset_into_vmpa_using_portions; + exe->translate_virt = (translate_virt_fc)g_exe_format_translate_address_into_vmpa_using_portions; exe->get_range_by_name = (get_range_by_name_fc)g_elf_format_get_section_range_by_name; @@ -382,6 +376,8 @@ static bool g_elf_format_analyze(GElfFormat *format, wgroup_id_t gid, GtkStatusS /* Chargements des informations utiles */ + g_executable_format_setup_portions(exe, status); + /** * On inscrit les éléments préchargés avant tout ! * @@ -698,62 +694,6 @@ static void g_elf_format_refine_portions(GElfFormat *format) /****************************************************************************** * * * Paramètres : format = description de l'exécutable à consulter. * -* off = position physique à retrouver. * -* pos = position correspondante. [OUT] * -* * -* Description : Fournit l'emplacement correspondant à une position physique. * -* * -* Retour : Bilan de l'opération. * -* * -* Remarques : - * -* * -******************************************************************************/ - -static bool g_elf_format_translate_offset_into_vmpa(const GElfFormat *format, phys_t off, vmpa2t *pos) -{ - bool result; /* Bilan à retourner */ - - result = translate_offset_into_vmpa_using_elf_sections(format, off, pos); - - if (!result) - result = translate_offset_into_vmpa_using_elf_programs(format, off, pos); - - return result; - -} - - -/****************************************************************************** -* * -* Paramètres : format = description de l'exécutable à consulter. * -* addr = adresse virtuelle à retrouver. * -* pos = position correspondante. [OUT] * -* * -* Description : Fournit l'emplacement correspondant à une adresse virtuelle. * -* * -* Retour : Bilan de l'opération. * -* * -* Remarques : - * -* * -******************************************************************************/ - -static bool g_elf_format_translate_address_into_vmpa(const GElfFormat *format, virt_t addr, vmpa2t *pos) -{ - bool result; /* Bilan à retourner */ - - result = translate_address_into_vmpa_using_elf_sections(format, addr, pos); - - if (!result) - result = translate_address_into_vmpa_using_elf_programs(format, addr, pos); - - return result; - -} - - -/****************************************************************************** -* * -* Paramètres : format = description de l'exécutable à consulter. * * name = nom de la section recherchée. * * range = emplacement en mémoire à renseigner. [OUT] * * * |