diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-03-11 13:06:06 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-03-11 13:06:06 (GMT) |
commit | 5f64b12f3359e5f2c923fb35d330cec4cb0f4a30 (patch) | |
tree | dc84ed05c4f43f240642e4efff50e78e4f35440a /src/format/elf/symbols.c | |
parent | 3a616243218104788fad9c1a3a9307c7972a461f (diff) |
Loaded the ELF header at a proper virtual address.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@488 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/elf/symbols.c')
-rw-r--r-- | src/format/elf/symbols.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/format/elf/symbols.c b/src/format/elf/symbols.c index 1c3da14..a4ef2bc 100644 --- a/src/format/elf/symbols.c +++ b/src/format/elf/symbols.c @@ -531,6 +531,7 @@ static bool annotate_elf_header(GElfFormat *format) const bin_t *content; /* Contenu binaire à lire */ off_t length; /* Taille totale du contenu */ vmpa2t *pos; /* Localisation des symboles */ + bool status; /* Bilan d'une récupération */ const char *text; /* Texte constant à insérer */ GArchInstruction *instr; /* Instruction décodée */ GArchOperand *operand; /* Opérande à venir modifier */ @@ -542,6 +543,9 @@ static bool annotate_elf_header(GElfFormat *format) pos = make_vmpa(0, 0x123); + status = translate_offset_into_vmpa_using_elf_programs(format, 0, pos); + assert(status); + /* ELFMAG (0) */ instr = g_raw_instruction_new_array_old(content, MDS_8_BITS, 4, pos, length, format->endian); @@ -954,6 +958,7 @@ static bool annotate_elf_program_header_table(GElfFormat *format) off_t length; /* Taille totale du contenu */ off_t offset; /* Tête de lecture du bbinaire */ vmpa2t *pos; /* Localisation des symboles */ + bool status; /* Bilan d'une récupération */ uint16_t e_phnum; /* Nombre d'éléments 'Program' */ uint16_t i; /* Boucle de parcours */ elf_phdr phdr; /* En-tête de programme ELF */ @@ -973,6 +978,9 @@ static bool annotate_elf_program_header_table(GElfFormat *format) pos = make_vmpa(offset, 0x5500); + status = translate_offset_into_vmpa_using_elf_programs(format, offset, pos); + assert(status); + e_phnum = ELF_HDR(format, format->header, e_phnum); for (i = 0; i < e_phnum; i++) @@ -1236,6 +1244,7 @@ static bool annotate_elf_section_header_table(GElfFormat *format) off_t offset; /* Tête de lecture du bbinaire */ elf_shdr strings; /* Section des descriptions */ vmpa2t *pos; /* Localisation des symboles */ + bool status; /* Bilan d'une récupération */ uint16_t e_shnum; /* Nombre d'éléments 'Program' */ uint16_t i; /* Boucle de parcours */ elf_shdr shdr; /* En-tête de programme ELF */ @@ -1257,7 +1266,10 @@ static bool annotate_elf_section_header_table(GElfFormat *format) offset = ELF_HDR(format, format->header, e_shoff); - pos = make_vmpa(offset, 0x9900); + pos = make_vmpa(offset, 0x99900); + + //status = translate_offset_into_vmpa_using_elf_programs(format, offset, pos); + //assert(status); e_shnum = ELF_HDR(format, format->header, e_shnum); |