commit 01fa94c59bee5c39464a2dc4df6acd26c7a3d45a parent d27c2fc659c4cc374cebce88f5bf490a4b281f13 Author: Matsuda Kenji <info@mtkn.jp> Date: Thu, 28 Mar 2024 18:40:45 +0900 update elf structs Diffstat:
M | utils.h | | | 28 | ++++++++++++++++++++++------ |
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/utils.h b/utils.h @@ -20,15 +20,31 @@ int efi_printf(char *fmt, ...); // ELF header. typedef struct { - UINTN entry; - UINTN ehsize; // ELF header's size. - UINTN phoff; - UINT16 phentsize; - UINT16 phnum; + unsigned char ident[16]; + UINT16 type; + UINT16 machine; + UINT32 version; + UINTN entry; + UINTN phoff; + UINTN shoff; + UINT32 flags; + UINT16 ehsize; // ELF header's size. + UINT16 phentsize; + UINT16 phnum; + UINT16 shentsize; + UINT16 shnum; + UINT16 shstrndx; } ElfHdr; typedef struct { - + UINT32 type; + UINT32 flags; + UINTN offset; + UINTN vaddr; + UINTN paddr; + UINT64 filesz; + UINT64 memsz; + UINT64 align; } Phdr; // Read_elf_hdr reads elf header and populates hdr struct.