FreeNOS
ELF.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2009 Niek Linnenbank
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __LIBEXEC_ELF_H
19#define __LIBEXEC_ELF_H
20
21#include <Types.h>
22#include <Factory.h>
23#include "ExecutableFormat.h"
24#include "ELFHeader.h"
25
37class ELF : public ExecutableFormat
38{
39 public:
40
47 ELF(const u8 *image, const Size size);
48
52 virtual ~ELF();
53
65 virtual Result regions(Region *regions, Size *count) const;
66 virtual Result regions32(Region *regions, Size *count) const;
67 virtual Result regions64(Region *regions, Size *count) const;
68
76 virtual Result entry(Address *entry) const;
77
87 static Result detect(const u8 *image, const Size size, ExecutableFormat **fmt);
88};
89
95#endif /* __LIBEXEC_ELF_H */
u32 entry[]
Definition IntelACPI.h:1
Executable and Linkable Format (ELF).
Definition ELF.h:38
virtual Result regions(Region *regions, Size *count) const
Reads out segments from the ELF program table.
Definition ELF.cpp:53
virtual Result regions64(Region *regions, Size *count) const
Definition ELF.cpp:97
static Result detect(const u8 *image, const Size size, ExecutableFormat **fmt)
Read ELF header from memory.
Definition ELF.cpp:30
virtual ~ELF()
Class destructor.
Definition ELF.cpp:26
virtual Result regions32(Region *regions, Size *count) const
Definition ELF.cpp:62
Abstraction class of various executable formats.
unsigned long Address
A memory address.
Definition Types.h:131
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128
unsigned char u8
Unsigned 8-bit number.
Definition Types.h:59