diff --git a/patterns/elf.hexpat b/patterns/elf.hexpat index a9708d3..7441916 100644 --- a/patterns/elf.hexpat +++ b/patterns/elf.hexpat @@ -1,5 +1,7 @@ #pragma MIME application/x-executable +#define EI_NIDENT 16 + using Elf32_Addr = u32; using Elf32_Half = u16; using Elf32_Off = u32; @@ -13,13 +15,13 @@ using Elf64_Sword = s32; using Elf64_Word = u32; struct Elf32_Ehdr { - Elf32_Word e_ident; + u8 e_ident[EI_NIDENT]; Elf32_Half e_type; Elf32_Half e_machine; Elf32_Word e_version; Elf32_Addr e_entry; - Elf32_Off e_phoff; - Elf32_Off e_shoff; + Elf32_Off e_phoff; + Elf32_Off e_shoff; Elf32_Word e_flags; Elf32_Half e_ehsize; Elf32_Half e_phentsize; @@ -30,7 +32,7 @@ struct Elf32_Ehdr { }; struct Elf64_Ehdr { - Elf64_Word e_ident; + u8 e_ident[EI_NIDENT]; Elf64_Half e_type; Elf64_Half e_machine; Elf64_Word e_version; @@ -46,4 +48,4 @@ struct Elf64_Ehdr { Elf64_Half e_shstrndx; }; -Elf64_Ehdr header @ 0x00; \ No newline at end of file +Elf64_Ehdr header @ 0x00;