1#ifndef ARION_ELF_LOADER_HPP
2#define ARION_ELF_LOADER_HPP
12#define LINUX_64_VVAR_ADDR 0x7ffff7fba000
13#define LINUX_64_VVAR_SZ 0x4000
14#define LINUX_64_VDSO_ADDR 0x7ffff7fbe000
15#define LINUX_64_VDSO_SZ 0x2000
16#define LINUX_64_INTERP_ADDR 0x7ffff7fc0000
17#define LINUX_64_VSYSCALL_ADDR 0xffffffffff600000
18#define LINUX_64_VSYSCALL_ALIGN 0x1000
20#define LINUX_32_VVAR_ADDR 0xf7fba000
21#define LINUX_32_VVAR_SZ 0x4000
22#define LINUX_32_VDSO_ADDR 0xf7fbe000
23#define LINUX_32_VDSO_SZ 0x2000
24#define LINUX_32_INTERP_ADDR 0xf7fc0000
25#define LINUX_32_ARM_TRAPS_ADDR 0xffff0000
26#define LINUX_32_ARM_TRAPS_SIZE 0x1000
27#define LINUX_32_ARM_GETTLS_ADDR 0xffff0fe0
29#define LINUX_VVAR_PERMS 4
30#define LINUX_VDSO_PERMS 5
31#define LINUX_VSYSCALL_PERMS 1
32#define LINUX_ARM_TRAPS_PERMS 5
37#define LINUX_VDSO_KERNEL_VSYSCALL_OFF 0x570
144 std::unique_ptr<LNX_LOADER_PARAMS>
process()
override;
A Linux loader implementation responsible for parsing and mapping ELF binaries (executables and dynam...
Definition elf_loader.hpp:69
std::shared_ptr< ElfParser > interp_parser
Definition elf_loader.hpp:72
void setup_specific_auxv(std::shared_ptr< LNX_LOADER_PARAMS > params, uint16_t arch_sz) override
ElfLoader(std::weak_ptr< Arion > arion, std::shared_ptr< ElfParser > interp_parser, std::shared_ptr< ElfParser > prog_parser, const std::vector< std::string > program_args, const std::vector< std::string > program_env)
Definition elf_loader.hpp:126
ElfLoader(std::weak_ptr< Arion > arion, std::shared_ptr< ElfParser > prog_parser, const std::vector< std::string > program_args, const std::vector< std::string > program_env)
Definition elf_loader.hpp:137
void init_coredump_threads()
bool is_static
Flag indicating if the program is statically linked.
Definition elf_loader.hpp:76
std::shared_ptr< ElfParser > prog_parser
ELF parser for the program interpreter (dynamic linker).
Definition elf_loader.hpp:72
ADDR map_elf_segments(const std::shared_ptr< ElfParser > parser, ADDR load_addr)
std::unique_ptr< LNX_LOADER_PARAMS > process() override
bool is_pie
Flag indicating if the program is Position-Independent Executable (PIE).
Definition elf_loader.hpp:74
Abstract base class for Linux-specific executable loading and setup routines.
Definition lnx_loader.hpp:121
const std::vector< std::string > program_env
Vector of environment variables.
Definition lnx_loader.hpp:146
const std::vector< std::string > program_args
Vector of command-line arguments.
Definition lnx_loader.hpp:144
char _binary_vdso_bin_start[]
External symbol indicating the start of the embedded VDSO binary data.
char _binary_vdso_bin_end[]
External symbol indicating the end of the embedded VDSO binary data.
Definition arch_x86-64.hpp:11
uint64_t ADDR
Identifies a memory address.
Definition global_defs.hpp:36
Structure representing a kernel trap entry for the 32-bit ARM architecture.
Definition elf_loader.hpp:49
ARM_TRAP(std::string name, off_t off, std::vector< BYTE > code)
Definition elf_loader.hpp:63
std::vector< BYTE > code
The actual machine code bytes of the trap.
Definition elf_loader.hpp:55
std::string name
Name of the trap function (e.g., syscall).
Definition elf_loader.hpp:51
off_t off
Offset within the ARM traps page.
Definition elf_loader.hpp:53