This commit is contained in:
gbrochar 2024-10-28 14:01:34 +01:00
parent 88ed6d1ad9
commit 71c9d7703f
2 changed files with 6 additions and 0 deletions

View File

@ -140,6 +140,9 @@ int nm64(t_mapped_file mapped_file, char *path, t_verbosity verbosity, t_orderin
if (get_header64(mapped_file, &header) == FT_NM_FAILURE) {
return FT_NM_FAILURE;
}
if (header.e_ehsize != 64) {
return FT_NM_FAILURE;
}
uint64_t addr = header.e_shoff + header.e_shentsize * header.e_shstrndx;
Elf64_Shdr *shstrtb;
if (!(shstrtb = (Elf64_Shdr *)fetch(mapped_file, addr, header.e_shentsize))) {

View File

@ -140,6 +140,9 @@ int nm32(t_mapped_file mapped_file, char *path, t_verbosity verbosity, t_orderin
if (get_header32(mapped_file, &header) == FT_NM_FAILURE) {
return FT_NM_FAILURE;
}
if (header.e_ehsize != 52) {
return FT_NM_FAILURE;
}
uint32_t addr = header.e_shoff + header.e_shentsize * header.e_shstrndx;
Elf32_Shdr *shstrtb;
if (!(shstrtb = (Elf32_Shdr *)fetch(mapped_file, addr, header.e_shentsize))) {