From ab4bff9f4281e541a617f4c6b84e2246bc74625d Mon Sep 17 00:00:00 2001 From: Andrei Makeev Date: Fri, 10 Mar 2023 10:03:36 +0000 Subject: [PATCH] patterns/elf: Treat SHT_SYMTAB as symbol tables (#91) ELF files: support static symbol tables --- patterns/elf.hexpat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patterns/elf.hexpat b/patterns/elf.hexpat index b39bfb8..4cda80b 100644 --- a/patterns/elf.hexpat +++ b/patterns/elf.hexpat @@ -637,7 +637,7 @@ struct Elf32_Shdr { } else if (sh_type == SHT::STRTAB) { String stringTable[while($ < (sh_offset + sh_size))] @ sh_offset; stringTableIndex = std::core::array_index(); - } else if (sh_type == SHT::DYNSYM) { + } else if (sh_type == SHT::SYMTAB || sh_type == SHT::DYNSYM) { Elf32_Sym symbolTable[sh_size / sh_entsize] @ sh_offset; } else if (sh_type == SHT::INIT_ARRAY || sh_type == SHT::FINI_ARRAY) { u32 pointer[while($ < (sh_offset + sh_size))] @ sh_offset; @@ -697,7 +697,7 @@ struct Elf64_Shdr { } else if (sh_type == SHT::STRTAB) { String stringTable[while($ < (sh_offset + sh_size))] @ sh_offset; stringTableIndex = std::core::array_index(); - } else if (sh_type == SHT::DYNSYM) { + } else if (sh_type == SHT::SYMTAB || sh_type == SHT::DYNSYM) { Elf64_Sym symbolTable[sh_size / sh_entsize] @ sh_offset; } else if (sh_type == SHT::INIT_ARRAY || sh_type == SHT::FINI_ARRAY) { u32 pointer[while($ < (sh_offset + sh_size))] @ sh_offset;