summaryrefslogtreecommitdiff
path: root/src/format/elf
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-10-01 15:55:39 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-10-01 15:55:39 (GMT)
commitd51fef170f00602744e55a8fdb21a3c7d196696a (patch)
tree5f51c1cdb09669da974c1b99d280a4e7078aab7f /src/format/elf
parent9aa5b354e83825e2d9843aea742aa62221a2130b (diff)
Rewritten the whole support of DEX file format.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@581 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/elf')
-rw-r--r--src/format/elf/elf.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/format/elf/elf.c b/src/format/elf/elf.c
index 50df077..ea1f1ff 100644
--- a/src/format/elf/elf.c
+++ b/src/format/elf/elf.c
@@ -76,7 +76,7 @@ static bool g_elf_format_translate_offset_into_vmpa(const GElfFormat *, phys_t,
static bool g_elf_format_translate_address_into_vmpa(const GElfFormat *, virt_t, vmpa2t *);
/* Fournit l'emplacement d'une section donnée. */
-bool g_elf_format_get_section_range_by_name(const GElfFormat *, const char *, mrange_t *);
+static bool g_elf_format_get_section_range_by_name(const GElfFormat *, const char *, mrange_t *);
@@ -149,6 +149,9 @@ static void g_elf_format_class_init(GElfFormatClass *klass)
exe = G_EXE_FORMAT_CLASS(klass);
+ exe->get_machine = (get_target_machine_fc)g_elf_format_get_target_machine;
+ 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;
@@ -171,12 +174,6 @@ static void g_elf_format_class_init(GElfFormatClass *klass)
static void g_elf_format_init(GElfFormat *format)
{
- GExeFormat *exe_format; /* Format parent à constituer */
-
- exe_format = G_EXE_FORMAT(format);
-
- exe_format->get_machine = (get_target_machine_fc)g_elf_format_get_target_machine;
- exe_format->refine_portions = (refine_portions_fc)g_elf_format_refine_portions;
}
@@ -393,9 +390,9 @@ static void g_elf_format_refine_portions(const GElfFormat *format, GBinPortion *
new = g_binary_portion_new(background);
- sprintf(desc, "%s \"%s\"",
- _("Segment"),
- get_elf_program_type_desc(ELF_PHDR(format, phdr, p_type)));
+ snprintf(desc, MAX_PORTION_DESC, "%s \"%s\"",
+ _("Segment"),
+ get_elf_program_type_desc(ELF_PHDR(format, phdr, p_type)));
g_binary_portion_set_desc(new, desc);
@@ -532,7 +529,7 @@ static bool g_elf_format_translate_address_into_vmpa(const GElfFormat *format, v
* *
******************************************************************************/
-bool g_elf_format_get_section_range_by_name(const GElfFormat *format, const char *name, mrange_t *range)
+static bool g_elf_format_get_section_range_by_name(const GElfFormat *format, const char *name, mrange_t *range)
{
bool result; /* Bilan à retourner */
phys_t offset; /* Position physique de section*/