ELF binary loader.
More...
#include <FileLoader_ELF.h>
ELF binary loader.
TODO: Longer comment.
Definition at line 43 of file FileLoader_ELF.h.
◆ FileLoader_ELF()
FileLoader_ELF::FileLoader_ELF |
( |
const string & |
filename | ) |
|
◆ ~FileLoader_ELF()
FileLoader_ELF::~FileLoader_ELF |
( |
| ) |
|
|
inline |
◆ DetectFileType()
string FileLoader_ELF::DetectFileType |
( |
unsigned char * |
buf, |
|
|
size_t |
buflen, |
|
|
float & |
matchness |
|
) |
| const |
|
virtual |
Attempt to detect file type.
- Parameters
-
buf | A buffer containing the header of the file. |
buflen | The length of the buffer. |
matchness | Set to a value between 0.0 and 1.0, indicating the match certainty. |
- Returns
- A file type description, if there was a match; otherwise an empty string.
Implements FileLoaderImpl.
Definition at line 117 of file FileLoader_ELF.cc.
References Elf32_Ehdr::e_ident, EI_CLASS, EI_MAG0, EI_MAG1, EI_MAG2, EI_MAG3, ELFCLASS32, ELFCLASS64, ELFMAG0, ELFMAG1, ELFMAG2, and ELFMAG3.
◆ LoadIntoComponent()
Loads the file into a Component.
- Parameters
-
component | The AddressDataBus component to load the file into. (This is usually a CPUComponent.) |
messages | An output stream where debug messages can be put. |
- Returns
- True if loading succeeded, false otherwise.
Implements FileLoaderImpl.
Definition at line 148 of file FileLoader_ELF.cc.
References Component::AsAddressDataBus(), Elf32_Ehdr::e_ident, EI_CLASS, EI_DATA, EI_MAG0, EI_MAG1, EI_MAG2, EI_MAG3, EI_VERSION, ELF_HEADER_VAR, ELFCLASS32, ELFCLASS64, ELFDATA2LSB, ELFDATA2MSB, ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3, ET_EXEC, EV_CURRENT, FileLoaderImpl::Filename(), and N_ELF_MACHINE_TYPES.
◆ RunUnitTests()
static void FileLoader_ELF::RunUnitTests |
( |
int & |
nSucceeded, |
|
|
int & |
nFailures |
|
) |
| |
|
static |
The documentation for this class was generated from the following files: