-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathelfboot.h
61 lines (51 loc) · 1.41 KB
/
elfboot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* File: elfboot.h
* Author: srl3gx@gmail.com
*
*
*/
#ifndef ELFBOOT_H
#define ELFBOOT_H
#ifdef __cplusplus
extern "C" {
#endif
struct elf_header {
char e_ident[8];
char padding[8];
unsigned short int e_type;
unsigned short int e_machine;
unsigned int e_version;
unsigned int e_entry;
unsigned int e_phoff;
unsigned int e_shoff;
unsigned int e_flags;
unsigned short int e_ehsize;
unsigned short int e_phnetsize;
unsigned short int e_phnum;
unsigned short int e_shentsize;
unsigned short int e_shnum;
unsigned short int e_shstrndx;
};
struct elfphdr {
unsigned int p_type;
unsigned int p_offset;
unsigned int p_vaddr;
unsigned int p_paddr;
unsigned int p_filesz;
unsigned int p_memsz;
unsigned int p_flags;
unsigned int p_align;
};
const char elf_magic[8] = {0x7F, 0x45, 0x4C, 0x46, 0x01, 0x01, 0x01, 0x61};
const int elf_header_size = 52;
const int elf_p_header_size = 32;
const int elf_magic_size = 8;
const unsigned int p_flags_ramdisk = 0x80000000;
const unsigned int p_flags_ipl = 0x40000000;
const unsigned int p_flags_cmdline = 0x20000000;
const unsigned int p_flags_rpm = 0x01000000;
const unsigned int p_flags_kernel = 0;
#ifdef __cplusplus
}
#endif
#endif /* ELFBOOT_H */