ELF binary loader. More...
#include <FileLoader_ELF.h>
Public Member Functions | |
FileLoader_ELF (const string &filename) | |
~FileLoader_ELF () | |
string | DetectFileType (unsigned char *buf, size_t buflen, float &matchness) const |
Attempt to detect file type. More... | |
bool | LoadIntoComponent (refcount_ptr< Component > component, ostream &messages) const |
Loads the file into a Component. More... | |
![]() | |
FileLoaderImpl (const string &filename) | |
Constructs a file loader. More... | |
virtual | ~FileLoaderImpl () |
![]() | |
ReferenceCountable () | |
Default constructor, which initializes the reference count to zero. More... | |
~ReferenceCountable () | |
Static Public Member Functions | |
static void | RunUnitTests (int &nSucceeded, int &nFailures) |
![]() | |
static void | RunUnitTests (int &nSucceeded, int &nFailures) |
Runs unit test cases. More... | |
Additional Inherited Members | |
![]() | |
const string & | Filename () const |
FileLoader_ELF::FileLoader_ELF | ( | const string & | filename | ) |
Definition at line 73 of file FileLoader_ELF.cc.
|
inline |
Definition at line 50 of file FileLoader_ELF.h.
References DetectFileType(), LoadIntoComponent(), and RunUnitTests().
|
virtual |
Attempt to detect file type.
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. |
Implements FileLoaderImpl.
Definition at line 79 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.
Referenced by ~FileLoader_ELF().
|
virtual |
Loads the file into a Component.
component | The AddressDataBus component to load the file into. (This is usually a CPUComponent.) |
messages | An output stream where debug messages can be put. |
Implements FileLoaderImpl.
Definition at line 110 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.
Referenced by ~FileLoader_ELF().
|
static |
Referenced by ~FileLoader_ELF().