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
|
//! ELF type definitions
pub const Header = extern struct {
magic: [4]u8,
class: u8,
data: u8,
version: u8,
osabi: u8,
abiversion: u8,
padding: [7]u8,
type: u16,
machine: u16,
version2: u32,
entry: u64,
phoff: u64,
shoff: u64,
flags: u32,
ehsize: u16,
phentsize: u16,
phnum: u16,
shentsize: u16,
shnum: u16,
shstrndx: u16,
};
pub const ProgramHeader = extern struct {
type: u32,
flags: u32,
offset: u64,
vaddr: u64,
paddr: u64,
filesz: u64,
memsz: u64,
alignment: u64,
};
pub const Info = struct {
entry_point: u64,
program_headers: []const ProgramHeader,
};
|