diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-01-31 00:55:26 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-01-31 00:55:26 (GMT) |
commit | 21a05df6423bdc13ca148ff2b96aec80bf7af2b2 (patch) | |
tree | 87043734800103178ee49e771dcacab18b19cc74 /src/format/elf/elf-int.c | |
parent | d246c98c515cb44c5bc4c742a674bae2e824872b (diff) |
Defined many entry points from many identified potential candidates.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@463 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/elf/elf-int.c')
-rw-r--r-- | src/format/elf/elf-int.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/format/elf/elf-int.c b/src/format/elf/elf-int.c index 677a9ef..a2ef9b2 100644 --- a/src/format/elf/elf-int.c +++ b/src/format/elf/elf-int.c @@ -251,6 +251,45 @@ bool read_elf_section_header(const GElfFormat *format, off_t pos, elf_shdr *sect * * * Paramètres : format = informations chargées à consulter. * * pos = position de début de lecture. [OUT] * +* dyn = structure lue à retourner. [OUT] * +* * +* Description : Procède à la lecture d'une entrée de type 'DYNAMIC' ELF. * +* * +* Retour : Bilan de l'opération. * +* * +* Remarques : - * +* * +******************************************************************************/ + +bool read_elf_dynamic_entry(const GElfFormat *format, off_t *pos, elf_dyn *dyn) +{ + bool result; /* Bilan à retourner */ + const bin_t *content; /* Contenu binaire à lire */ + off_t length; /* Taille totale du contenu */ + + content = G_BIN_FORMAT(format)->content; + length = G_BIN_FORMAT(format)->length; + + if (format->is_32b) + { + result = read_s32(&dyn->dyn32.d_tag, content, pos, length, format->endian); + result &= read_u32(&dyn->dyn32.d_un.d_val, content, pos, length, format->endian); + } + else + { + result = read_s64(&dyn->dyn64.d_tag, content, pos, length, format->endian); + result &= read_u64(&dyn->dyn64.d_un.d_val, content, pos, length, format->endian); + } + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : format = informations chargées à consulter. * +* pos = position de début de lecture. [OUT] * * sym = structure lue à retourner. [OUT] * * * * Description : Procède à la lecture d'un symbole ELF. * |