2 ;;; Copyright (C) 2016 Jeremiah Orians
3 ;;; Copyright (C) 2017 Jan Nieuwenhuizen <janneke@gnu.org>
4 ;;; This file is part of stage0.
6 ;;; stage0 is free software: you an redistribute it and/or modify
7 ;;; it under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation, either version 3 of the License, or
9 ;;; (at your option) any later version.
11 ;;; stage0 is distributed in the hope that it will be useful,
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with stage0. If not, see <http://www.gnu.org/licenses/>.
19 ;;; elf32.hex3: 32 bit elf header in hex3
23 #X7F #x45 #X4C #x46 ; e_ident[EI_MAG0-3] ELF's magic number
25 #x01 ; e_ident[EI_CLASS] Indicating 32 bit
26 #x01 ; e_ident[EI_DATA] Indicating little endianness
27 #x01 ; e_ident[EI_VERSION] Indicating original elf
29 #x00 ; e_ident[EI_OSABI] Set at 0 because none cares
30 #x00 ; e_ident[EI_ABIVERSION] See above
32 #x00 #x00 #x00 #x00 #x00 #x00 #x00 ; e_ident[EI_PAD]
33 #x02 #x00 ; e_type Indicating Executable
34 #x03 #x00 ; e_machine Indicating AMD64
35 #x01 #x00 #x00 #x00 ; e_version Indicating original elf
37 #x54 #x80 #x04 #x08 ; e_entry Address of the entry point
38 #x34 #x00 #x00 #x00 ; e_phoff Address of program header table
39 #x00 #x00 #x00 #x00 ; e_shoff Address of section header table
41 #x00 #x00 #x00 #x00 ; e_flags
42 #x34 #x00 ; e_ehsize Indicating our 52 Byte header
44 #x20 #x00 ; e_phentsize size of a program header table
45 #x01 #x00 ; e_phnum number of entries in program table
47 #x00 #x00 ; e_shentsize size of a section header table
48 #x00 #x00 ; e_shnum number of entries in section table
50 #x00 #x00 ; e_shstrndx index of the section names
53 #x01 #x00 #x00 #x00 ; p_type
54 #x00 #x00 #x00 #x00 ; p_offset
56 #x00 #x80 #x04 #x08 ; p_vaddr
57 #x00 #x80 #x04 #x08 ; p_physaddr
60 ;;#x60 #x00 #x00 #x00 ; p_filesz
61 ;;#x60 #x00 #x00 #x00 ; p_memsz
63 ;#x65 #x01 #x00 #x00 ; p_filesz
64 ;#x65 #x01 #x00 #x00 ; p_memsz
66 #xff #xff #x00 #x00 ; p_filesz
67 #xff #xff #x00 #x00 ; p_memsz
70 #x07 #x00 #x00 #x00 ; p_flags
71 #x01 #x00 #x00 #x00 ; alignment
75 ;#xbb #x2a #x00 #x00 #x00 ; mov $42,%ebx
76 ;#xb8 #x01 #x00 #x00 #x00 ; mov $0x1,%eax
77 ;#xcd #x80 ; int $0x80
83 #\. #\c #\o #\m #\m #\e #\n #\t 0
84 #\. #\s #\h #\s #\t #\r #\t #\a #\b 0
85 #\. #\s #\y #\m #\t #\a #\b 0
86 #\. #\s #\t #\r #\t #\a #\b 0)