diff options
author | Marvin Borner | 2020-08-01 15:59:39 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-01 15:59:39 +0200 |
commit | 115f4ff541839f7a97f9413e1ac3ff7695c24c9e (patch) | |
tree | d98602bba5a8b4321ae124d221f77e99008e9cd1 /src/inc | |
parent | 46fb7dcf479ac85361d8eaae5af3ea27a6b93a2d (diff) |
Switched to PIE flat binaries
Diffstat (limited to 'src/inc')
-rw-r--r-- | src/inc/elf.h | 61 | ||||
-rw-r--r-- | src/inc/load.h | 10 |
2 files changed, 10 insertions, 61 deletions
diff --git a/src/inc/elf.h b/src/inc/elf.h deleted file mode 100644 index c10ba4e..0000000 --- a/src/inc/elf.h +++ /dev/null @@ -1,61 +0,0 @@ -// MIT License, Copyright (c) 2020 Marvin Borner - -#ifndef ELF_H -#define ELF_H - -#include <def.h> - -#define ELF_MAG 0x7F // 0 -#define ELF_32 1 // 4: 32-bit Architecture -#define ELF_LITTLE 1 // 5: Little Endian -#define ELF_CURRENT 1 // 6: ELF Current Version -#define ELF_386 3 // header->machine x86 machine type - -#define ET_NONE 0 // Unkown type -#define ET_REL 1 // Relocatable file -#define ET_EXEC 2 // Executable file - -struct elf_header { - u8 ident[16]; - u16 type; - u16 machine; - u32 version; - u32 entry; - u32 phoff; - u32 shoff; - u32 flags; - u16 ehsize; - u16 phentsize; - u16 phnum; - u16 shentsize; - u16 shnum; - u16 shstrndx; -}; - -struct elf_section_header { - u32 name; - u32 type; - u32 flags; - u32 addr; - u32 offset; - u32 size; - u32 link; - u32 info; - u32 addralign; - u32 entsize; -}; - -struct elf_program_header { - u32 type; - u32 offset; - u32 vaddr; - u32 paddr; - u32 filesz; - u32 memsz; - u32 flags; - u32 align; -}; - -void elf_load(char *path); - -#endif diff --git a/src/inc/load.h b/src/inc/load.h new file mode 100644 index 0000000..afca249 --- /dev/null +++ b/src/inc/load.h @@ -0,0 +1,10 @@ +// MIT License, Copyright (c) 2020 Marvin Borner + +#ifndef LOAD_H +#define LOAD_H + +#include <def.h> + +void bin_load(char *path); + +#endif |