Fixed ELF header pattern (#7)

* Fixed ELF header pattern

* Fix : missing pattern offset
This commit is contained in:
ThisALV
2020-12-21 21:03:59 +01:00
committed by GitHub
parent f93971dfe4
commit bec4233ff6

View File

@@ -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;
Elf64_Ehdr header @ 0x00;