summaryrefslogtreecommitdiff
path: root/src/format/elf/elf.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-12-13 11:54:32 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-12-13 11:54:32 (GMT)
commit7468875c1022337efbff78069d715672ae083150 (patch)
tree0a8e5ce9cce113506a601539c9aa0a1b4ae48680 /src/format/elf/elf.c
parentc6409e2c6a390a7cca40da8572c93a5268e90a27 (diff)
Loaded and saved binary parts.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@140 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/elf/elf.c')
-rw-r--r--src/format/elf/elf.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/format/elf/elf.c b/src/format/elf/elf.c
index f32bce7..878bf51 100644
--- a/src/format/elf/elf.c
+++ b/src/format/elf/elf.c
@@ -62,6 +62,9 @@ static vmpa_t g_elf_format_get_entry_point(const GElfFormat *);
/* Fournit les références aux zones binaires à analyser. */
static GBinPart **g_elf_format_get_parts(const GElfFormat *, size_t *);
+/* Fournit l'adresse virtuelle correspondant à une position. */
+static bool g_elf_format_translate_offset_into_address(const GElfFormat *, off_t, vmpa_t *);
+
/******************************************************************************
@@ -136,6 +139,8 @@ static void g_elf_format_init(GElfFormat *format)
exe_format->get_entry_point = (get_entry_point_fc)g_elf_format_get_entry_point;
exe_format->get_parts = (get_parts_fc)g_elf_format_get_parts;
+ exe_format->translate = (translate_off_fc)g_elf_format_translate_offset_into_address;
+
}
@@ -486,3 +491,31 @@ static GBinPart **g_elf_format_get_parts(const GElfFormat *format, size_t *count
return result;
}
+
+
+/******************************************************************************
+* *
+* Paramètres : format = description de l'exécutable à consulter. *
+* pos = position dans le flux binaire à retrouver. *
+* addr = adresse virtuelle correspondante. [OUT] *
+* *
+* Description : Fournit l'adresse virtuelle correspondant à une position. *
+* *
+* Retour : Bilan de l'opération. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static bool g_elf_format_translate_offset_into_address(const GElfFormat *format, off_t pos, vmpa_t *addr)
+{
+ bool result; /* Bilan à retourner */
+
+ result = translate_offset_into_address_using_elf_sections(format, pos, addr);
+
+ if (!result)
+ /* TODO : prgm... */;
+
+ return result;
+
+}