21 const uint8_t *input_as_bytes =
reinterpret_cast<uint8_t *
>(&input);
22 input = (((uint16_t)input_as_bytes[0]) << (le_input ? 0 : 8)) |
23 (((uint16_t)input_as_bytes[1]) << (le_input ? 8 : 0));
28 const uint8_t *input_as_bytes =
reinterpret_cast<uint8_t *
>(&input);
29 input = (((uint32_t)input_as_bytes[0]) << (le_input ? 0 : 24)) |
30 (((uint32_t)input_as_bytes[1]) << (le_input ? 8 : 16)) |
31 (((uint32_t)input_as_bytes[2]) << (le_input ? 16 : 8)) |
32 (((uint32_t)input_as_bytes[3]) << (le_input ? 24 : 0));
39 sizeof(
unsigned long long) == 8,
40 "unsigned long long expected to be 8 bytes");
41 const uint8_t *input_as_bytes =
reinterpret_cast<uint8_t *
>(&input);
42 input = (((
unsigned long long)input_as_bytes[0]) << (le_input ? 0 : 56)) |
43 (((
unsigned long long)input_as_bytes[1]) << (le_input ? 8 : 48)) |
44 (((
unsigned long long)input_as_bytes[2]) << (le_input ? 16 : 40)) |
45 (((
unsigned long long)input_as_bytes[3]) << (le_input ? 24 : 32)) |
46 (((
unsigned long long)input_as_bytes[4]) << (le_input ? 32 : 24)) |
47 (((
unsigned long long)input_as_bytes[5]) << (le_input ? 40 : 16)) |
48 (((
unsigned long long)input_as_bytes[6]) << (le_input ? 48 : 8)) |
49 (((
unsigned long long)input_as_bytes[7]) << (le_input ? 56 : 0));
Thrown when failing to deserialize a value from some low level format, like JSON or raw bytes.
std::size_t number_of_sections
elf_readert(std::istream &_in)
std::string get_string(std::streampos index) const
elf64_section_header_tablet elf64_section_header_table
bool has_section(const std::string &name) const
elf32_section_header_tablet elf32_section_header_table
std::string section_name(std::size_t index) const
std::streampos string_table_offset
std::streampos section_offset(std::size_t index) const
static void u32_to_native_endian_inplace(bool le_input, uint32_t &input)
static void u16_to_native_endian_inplace(bool le_input, uint16_t &input)
static void u64_to_native_endian_inplace(bool le_input, unsigned long long &input)
unsigned char e_ident[16]
unsigned char e_ident[16]