ReXGlue SDK
Loading...
Searching...
No Matches
rex::kernel::ELFModule Class Reference

#include <rex/kernel/module.h>

Inheritance diagram for rex::kernel::ELFModule:
[legend]

Public Member Functions

 ELFModule (FunctionDispatcher *function_dispatcher)
bool IsLoaded () const
const std::string & GetName () const override
bool IsExecutable () const override
const std::string & GetPath () const
u32 GetBaseAddress () const override
u32 GetImageSize () const override
u32 GetEntryPoint () const override
bool Load (const std::string_view name, const std::string_view path, const void *elf_addr, size_t elf_length)
bool Unload ()
Public Member Functions inherited from rex::kernel::GuestModule
 GuestModule (FunctionDispatcher *function_dispatcher)
kernel::GuestAddressSpace * GetAddressSpace () const
FunctionDispatcher * GetFunctionDispatcher () const
virtual u32 GetExportTableAddress () const
virtual u32 GetExceptionDirectoryRVA () const
virtual u32 GetExceptionDirectorySize () const
virtual u32 GetExceptionDirectoryAddress () const
bool IsExecutableAddress (u32 address) const
virtual std::span< const BinarySection > GetBinarySections () const
virtual const BinarySection * FindSectionByAddress (u32 address) const
virtual std::span< const BinarySymbol > GetBinarySymbols () const

Additional Inherited Members

Protected Attributes inherited from rex::kernel::GuestModule
FunctionDispatcher * function_dispatcher_ = nullptr
kernel::GuestAddressSpace * memory_ = nullptr
std::vector< BinarySection > binary_sections_
std::vector< BinarySymbol > binary_symbols_

Detailed Description

Loads libxenon executables.

Constructor & Destructor Documentation

◆ ELFModule()

rex::kernel::ELFModule::ELFModule ( FunctionDispatcher * function_dispatcher)
explicit

Builds an unloaded module.

Parameters
function_dispatcherThe dispatcher whose memory the module loads into.

Member Function Documentation

◆ GetBaseAddress()

u32 rex::kernel::ELFModule::GetBaseAddress ( ) const
inlineoverridevirtual

Returns the lowest guest address of the loaded segments, 0 before the image is loaded.

Reimplemented from rex::kernel::GuestModule.

◆ GetEntryPoint()

u32 rex::kernel::ELFModule::GetEntryPoint ( ) const
inlineoverridevirtual
Returns
The guest address, 0 by default.

Reimplemented from rex::kernel::GuestModule.

◆ GetImageSize()

u32 rex::kernel::ELFModule::GetImageSize ( ) const
inlineoverridevirtual
Returns
The size in bytes, 0 by default.

Reimplemented from rex::kernel::GuestModule.

◆ GetName()

const std::string & rex::kernel::ELFModule::GetName ( ) const
inlineoverridevirtual

◆ IsExecutable()

bool rex::kernel::ELFModule::IsExecutable ( ) const
overridevirtual

Reports whether the image has an entry point.

Implements rex::kernel::GuestModule.

◆ Load()

bool rex::kernel::ELFModule::Load ( const std::string_view name,
const std::string_view path,
const void * elf_addr,
size_t elf_length )

Copies the loadable segments of an ELF image into guest memory.

Parameters
elf_addrThe host address of the ELF image.
Returns
True on success, false when the data is not an ELF or has no entry point.

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