A basic reader for ELF files.
More...
#include <reader.h>
A basic reader for ELF files.
◆ FromStream()
Creates an ElfReader from a stream.
- Returns
embed:rst:leading-asterisk
*
* .. pw-status-codes::
*
* OK: The reader was initialized successfully.
*
* DATA_LOSS: The input file was invalid.
*
* OUT_OF_RANGE: Input stream exhausted (EOF).
*
* UNIMPLEMENTED: Some aspect of the ELF file is not (yet) supported by
* this class, e.g., non-native endianness, or 64-bit ELF on a 32-bit
* host.
*
* May return other error codes from the underlying stream.
*
*
◆ ReadSection()
Result< std::vector< std::byte > > pw::elf::ElfReader::ReadSection |
( |
std::string_view |
name | ) |
|
Reads a section with the given name.
- Parameters
-
[in] | name | The name of the desired section. |
- Returns
embed:rst:leading-asterisk
*
* .. pw-status-codes::
*
* OK: Successfully read the desired section.
* The result value is a vector of the section data.
*
* NOT_FOUND: No section was found with the desired name.
*
* May return other error codes from the underlying stream.
*
*
◆ SeekToSection()
StatusWithSize pw::elf::ElfReader::SeekToSection |
( |
std::string_view |
name | ) |
|
|
inline |
Seeks the associated stream to the beginning of the data of the section with the given name.
- Parameters
-
[in] | name | The name of the desired section. |
- Returns
embed:rst:leading-asterisk
*
* .. pw-status-codes::
*
* OK: Successfully found the desired section and seeked the stream to
* it. The associated size is the size of the associated section.
*
* NOT_FOUND: No section was found with the desired name.
*
* May return other error codes from the underlying stream.
*
*
The documentation for this class was generated from the following file: