Arion 1.0.2-alpha
A high-performance C++ framework for emulating executable binaries.
 
Loading...
Searching...
No Matches
arion::LinuxBaremetalLoader Class Reference

A Linux loader implementation for baremetal (shellcode) injection/execution without a full ELF file structure. More...

#include <lnx_baremetal_loader.hpp>

Inheritance diagram for arion::LinuxBaremetalLoader:
arion::LinuxLoader

Public Member Functions

 LinuxBaremetalLoader (std::weak_ptr< Arion > arion, const std::vector< std::string > program_args, const std::vector< std::string > program_env)
 
std::unique_ptr< LNX_LOADER_PARAMSprocess () override
 

Protected Member Functions

void setup_specific_auxv (std::shared_ptr< LNX_LOADER_PARAMS > params, uint16_t arch_sz) override
 

Private Member Functions

ADDR map_code (std::vector< uint8_t > code)
 
 LinuxLoader (std::weak_ptr< Arion > arion, const std::vector< std::string > program_args, const std::vector< std::string > program_env)
 
void write_auxv_entry (AUXV auxv, uint64_t val)
 
ADDR map_stack (std::shared_ptr< LNX_LOADER_PARAMS > params, std::string path)
 
void init_main_thread (std::shared_ptr< LNX_LOADER_PARAMS > params, ADDR entry_addr)
 

Additional Inherited Members

- Private Attributes inherited from arion::LinuxLoader
std::weak_ptr< Arionarion
 Weak pointer back to the main Arion instance.
 
const std::vector< std::string > program_args
 Vector of command-line arguments.
 
const std::vector< std::string > program_env
 Vector of environment variables.
 

Detailed Description

A Linux loader implementation for baremetal (shellcode) injection/execution without a full ELF file structure.

Constructor & Destructor Documentation

◆ LinuxBaremetalLoader()

arion::LinuxBaremetalLoader::LinuxBaremetalLoader ( std::weak_ptr< Arion arion,
const std::vector< std::string >  program_args,
const std::vector< std::string >  program_env 
)
inline

Builder for LinuxBaremetalLoader instances.

Parameters
[in]arionWeak pointer to the Arion emulator instance.
[in]program_argsVector of command-line arguments.
[in]program_envVector of environment variables.

Member Function Documentation

◆ map_code()

ADDR arion::LinuxBaremetalLoader::map_code ( std::vector< uint8_t >  code)
private

Maps the raw machine code (shellcode) into the emulator's memory space.

Parameters
[in]codeVector of bytes representing the machine code.
Returns
The base virtual address where the code was mapped.

◆ process()

std::unique_ptr< LNX_LOADER_PARAMS > arion::LinuxBaremetalLoader::process ( )
overridevirtual

Processes the baremetal loading, mapping the code, setting up the stack, and finalizing the loader parameters.

Returns
A unique pointer to the finalized loader parameters (LNX_LOADER_PARAMS).

Implements arion::LinuxLoader.

◆ setup_specific_auxv()

void arion::LinuxBaremetalLoader::setup_specific_auxv ( std::shared_ptr< LNX_LOADER_PARAMS params,
uint16_t  arch_sz 
)
overrideprotectedvirtual

Sets up architecture-specific Auxiliary Vector (AUXV) entries before execution starts. This implementation is typically minimal for baremetal loading.

Parameters
[in]paramsShared pointer to the loader parameters structure.
[in]arch_szThe size of the architecture (32 or 64 bit).

Implements arion::LinuxLoader.


The documentation for this class was generated from the following file: