Go to the documentation of this file.
45 (*fmt) =
new ELF(image, size);
56 const Size maxSegments =
header->programHeaderEntryCount;
57 const Size maxRegions = *count;
58 Size numRegions = 0, numSegments = 0;
62 header->programHeaderEntryCount < 16))
68 for (;numRegions < maxRegions && numSegments < maxSegments; numSegments++)
76 regions[numRegions].dataOffset = segments[numSegments].
offset;
83 (*count) = numRegions;
static Result detect(const u8 *image, const Size size, ExecutableFormat **fmt)
Read ELF header from memory.
virtual ~ELF()
Class destructor.
#define ELF_INDEX_MAGIC3
Magic number byte 3 index.
ELF program segment in the executable file.
#define ELF_TYPE_EXEC
Executable file.
#define ELF_INDEX_MAGIC1
Magic number byte 1 index.
u32 fileSize
Segment file image size.
#define ELF_VERSION_CURRENT
Current version.
virtual Result entry(Address *entry) const
Lookup the program entry point.
#define ELF_MAGIC0
Magic number byte 0.
unsigned long Address
A memory address.
#define ELF_CLASS_32
32-bit objects.
u32 offset
Offset in the file of this segment.
#define ELF_MAGIC1
Magic number byte 1.
#define ELF_INDEX_CLASS
File class index.
SystemDescriptorHeader header
unsigned int Size
Any sane size indicator cannot go negative.
#define ELF_MAGIC2
Magic number byte 2.
#define ELF_INDEX_MAGIC0
Magic number byte 0 index.
#define ELF_MAGIC3
Magic number byte 3.
#define ELF_SEGMENT_LOAD
Loadable segment.
unsigned char u8
Unsigned 8-bit number.
virtual Result regions(Region *regions, Size *count) const
Reads out segments from the ELF program table.
u32 memorySize
Segment memory image size.
ELF(const u8 *image, const Size size)
Class constructor.
#define ELF_INDEX_MAGIC2
Magic number byte 2 index.
u32 virtualAddress
Virtual address start.