19 void* dest = (
void*)(base + (phdr->
p_vaddr - offset));
#define ELF64_AT_OFFSET(elf, offset)
Get a pointer to a location in the ELF file at the given offset.
#define ELF64_GET_PHDR(elf, index)
Get the program header at the given index from an ELF file.
void elf64_load_segments(const Elf64_File *elf, Elf64_Addr base, Elf64_Off offset)
Load all loadable segments of an ELF file into memory.
uint64_t Elf64_Off
ELF64 Unsigned file offset.
uint64_t Elf64_Addr
ELF64 Unsigned program address.
@ PT_LOAD
Loadable segment.
#define NULL
Pointer error value.
__UINTPTR_TYPE__ uintptr_t
Elf64_Half e_phnum
Number of entries in the program header table.
ELF File Helper structure.
Elf64_Ehdr * header
The data in the file, pointed to the start of the ELF header.
Elf64_Xword p_memsz
Size of segment in memory in bytes.
Elf64_Addr p_vaddr
Target virtual address in memory.
Elf64_Off p_offset
Segment file offset in bytes.
Elf64_Word p_type
Segment type.
Elf64_Xword p_filesz
Size of segment in file in bytes.