ROSE
0.9.6a
|
Enumerations | |
enum | Endianness { ORDER_UNSPECIFIED =0, ORDER_LSB, ORDER_MSB } |
Functions | |
Endianness | host_order () |
Byte order of host machine. More... | |
void | convert (void *bytes_, size_t nbytes, Endianness from, Endianness to) |
Convert data from one byte order to another in place. More... | |
int8_t | swap_bytes (int8_t n) |
Reverse bytes. More... | |
uint8_t | swap_bytes (uint8_t n) |
Reverse bytes. More... | |
int16_t | swap_bytes (int16_t n) |
Reverse bytes. More... | |
uint16_t | swap_bytes (uint16_t n) |
Reverse bytes. More... | |
int32_t | swap_bytes (int32_t n) |
Reverse bytes. More... | |
uint32_t | swap_bytes (uint32_t n) |
Reverse bytes. More... | |
int64_t | swap_bytes (int64_t n) |
Reverse bytes. More... | |
uint64_t | swap_bytes (uint64_t n) |
Reverse bytes. More... | |
int8_t | le_to_host (int8_t n) |
Convert a little-endian integer to host order. More... | |
uint8_t | le_to_host (uint8_t n) |
Convert a little-endian integer to host order. More... | |
int16_t | le_to_host (int16_t n) |
Convert a little-endian integer to host order. More... | |
uint16_t | le_to_host (uint16_t n) |
Convert a little-endian integer to host order. More... | |
int32_t | le_to_host (int32_t n) |
Convert a little-endian integer to host order. More... | |
uint32_t | le_to_host (uint32_t n) |
Convert a little-endian integer to host order. More... | |
int64_t | le_to_host (int64_t n) |
Convert a little-endian integer to host order. More... | |
uint64_t | le_to_host (uint64_t n) |
Convert a little-endian integer to host order. More... | |
void | host_to_le (unsigned h, uint8_t *n) |
Convert host order to little-endian. More... | |
void | host_to_le (unsigned h, uint16_t *n) |
Convert host order to little-endian. More... | |
void | host_to_le (unsigned h, uint32_t *n) |
Convert host order to little-endian. More... | |
void | host_to_le (rose_addr_t h, uint64_t *n) |
Convert host order to little-endian. More... | |
void | host_to_le (rose_rva_t h, uint32_t *n) |
Convert host order to little-endian. More... | |
void | host_to_le (rose_rva_t h, uint64_t *n) |
Convert host order to little-endian. More... | |
void | host_to_le (int h, int8_t *n) |
Convert host order to little-endian. More... | |
void | host_to_le (int h, int16_t *n) |
Convert host order to little-endian. More... | |
void | host_to_le (int h, int32_t *n) |
Convert host order to little-endian. More... | |
void | host_to_le (int64_t h, int64_t *n) |
Convert host order to little-endian. More... | |
uint8_t | be_to_host (uint8_t n) |
Convert a bit-endian integer to host order. More... | |
uint16_t | be_to_host (uint16_t n) |
Convert a bit-endian integer to host order. More... | |
uint32_t | be_to_host (uint32_t n) |
Convert a bit-endian integer to host order. More... | |
uint64_t | be_to_host (uint64_t n) |
Convert a bit-endian integer to host order. More... | |
int8_t | be_to_host (int8_t n) |
Convert a bit-endian integer to host order. More... | |
int16_t | be_to_host (int16_t n) |
Convert a bit-endian integer to host order. More... | |
int32_t | be_to_host (int32_t n) |
Convert a bit-endian integer to host order. More... | |
int64_t | be_to_host (int64_t n) |
Convert a bit-endian integer to host order. More... | |
void | host_to_be (unsigned h, uint8_t *n) |
Convert host order to big endian. More... | |
void | host_to_be (unsigned h, uint16_t *n) |
Convert host order to big endian. More... | |
void | host_to_be (unsigned h, uint32_t *n) |
Convert host order to big endian. More... | |
void | host_to_be (rose_addr_t h, uint64_t *n) |
Convert host order to big endian. More... | |
void | host_to_be (rose_rva_t h, uint32_t *n) |
Convert host order to big endian. More... | |
void | host_to_be (rose_rva_t h, uint64_t *n) |
Convert host order to big endian. More... | |
void | host_to_be (int h, int8_t *n) |
Convert host order to big endian. More... | |
void | host_to_be (int h, int16_t *n) |
Convert host order to big endian. More... | |
void | host_to_be (int h, int32_t *n) |
Convert host order to big endian. More... | |
void | host_to_be (int64_t h, int64_t *n) |
Convert host order to big endian. More... | |
uint8_t | disk_to_host (Endianness sex, uint8_t n) |
Convert call-specified order to host order. More... | |
uint16_t | disk_to_host (Endianness sex, uint16_t n) |
Convert call-specified order to host order. More... | |
uint32_t | disk_to_host (Endianness sex, uint32_t n) |
Convert call-specified order to host order. More... | |
uint64_t | disk_to_host (Endianness sex, uint64_t n) |
Convert call-specified order to host order. More... | |
int8_t | disk_to_host (Endianness sex, int8_t n) |
Convert call-specified order to host order. More... | |
int16_t | disk_to_host (Endianness sex, int16_t n) |
Convert call-specified order to host order. More... | |
int32_t | disk_to_host (Endianness sex, int32_t n) |
Convert call-specified order to host order. More... | |
int64_t | disk_to_host (Endianness sex, int64_t n) |
Convert call-specified order to host order. More... | |
void | host_to_disk (Endianness sex, unsigned h, uint8_t *np) |
Convert host order to caller-specified order. More... | |
void | host_to_disk (Endianness sex, unsigned h, uint16_t *np) |
Convert call-specified order to host order. More... | |
void | host_to_disk (Endianness sex, unsigned h, uint32_t *np) |
Convert call-specified order to host order. More... | |
void | host_to_disk (Endianness sex, rose_addr_t h, uint64_t *np) |
Convert call-specified order to host order. More... | |
void | host_to_disk (Endianness sex, rose_rva_t h, uint64_t *np) |
Convert call-specified order to host order. More... | |
void | host_to_disk (Endianness sex, int h, int8_t *np) |
Convert call-specified order to host order. More... | |
void | host_to_disk (Endianness sex, int h, int16_t *np) |
Convert call-specified order to host order. More... | |
void | host_to_disk (Endianness sex, int h, int32_t *np) |
Convert call-specified order to host order. More... | |
void | host_to_disk (Endianness sex, int64_t h, int64_t *np) |
Convert call-specified order to host order. More... | |
Enumerator | |
---|---|
ORDER_UNSPECIFIED |
Endianness is unspecified and unknown. |
ORDER_LSB |
Least significant byte first, i.e., little-endian. |
ORDER_MSB |
Most significant byte first, i.e., big-endian. |
Definition at line 7 of file ByteOrder.h.
Endianness ByteOrder::host_order | ( | ) |
Byte order of host machine.
Referenced by SgAsmElfFileHeader::parse().
void ByteOrder::convert | ( | void * | bytes_, |
size_t | nbytes, | ||
Endianness | from, | ||
Endianness | to | ||
) |
Convert data from one byte order to another in place.
int8_t ByteOrder::swap_bytes | ( | int8_t | n) |
Reverse bytes.
uint8_t ByteOrder::swap_bytes | ( | uint8_t | n) |
Reverse bytes.
int16_t ByteOrder::swap_bytes | ( | int16_t | n) |
Reverse bytes.
uint16_t ByteOrder::swap_bytes | ( | uint16_t | n) |
Reverse bytes.
int32_t ByteOrder::swap_bytes | ( | int32_t | n) |
Reverse bytes.
uint32_t ByteOrder::swap_bytes | ( | uint32_t | n) |
Reverse bytes.
int64_t ByteOrder::swap_bytes | ( | int64_t | n) |
Reverse bytes.
uint64_t ByteOrder::swap_bytes | ( | uint64_t | n) |
Reverse bytes.
int8_t ByteOrder::le_to_host | ( | int8_t | n) |
Convert a little-endian integer to host order.
Referenced by SgAsmLEFileHeader::ctor(), SgAsmNEFileHeader::ctor(), SgAsmNENameTable::ctor(), SgAsmNEModuleTable::ctor(), SgAsmNEEntryTable::ctor(), SgAsmNERelocTable::ctor(), SgAsmLENameTable::ctor(), SgAsmCoffSymbol::ctor(), SgAsmPESectionTableEntry::ctor(), SgAsmPEExportDirectory::ctor(), SgAsmPERVASizePair::ctor(), SgAsmNERelocEntry::ctor(), SgAsmNESectionTableEntry::ctor(), SgAsmLEFileHeader::is_LE(), SgAsmNEFileHeader::is_NE(), SgAsmPEFileHeader::is_PE(), SgAsmPEFileHeader::parse(), SgAsmDOSFileHeader::parse(), SgAsmElfEHFrameSection::parse(), SgAsmPEExportSection::parse(), SgAsmDOSExtendedHeader::parse(), SgAsmCoffSymbolTable::parse(), SgAsmPEImportDirectory::parse(), and SgAsmPEImportDirectory::parse_ilt_iat().
uint8_t ByteOrder::le_to_host | ( | uint8_t | n) |
Convert a little-endian integer to host order.
int16_t ByteOrder::le_to_host | ( | int16_t | n) |
Convert a little-endian integer to host order.
uint16_t ByteOrder::le_to_host | ( | uint16_t | n) |
Convert a little-endian integer to host order.
int32_t ByteOrder::le_to_host | ( | int32_t | n) |
Convert a little-endian integer to host order.
uint32_t ByteOrder::le_to_host | ( | uint32_t | n) |
Convert a little-endian integer to host order.
int64_t ByteOrder::le_to_host | ( | int64_t | n) |
Convert a little-endian integer to host order.
uint64_t ByteOrder::le_to_host | ( | uint64_t | n) |
Convert a little-endian integer to host order.
void ByteOrder::host_to_le | ( | unsigned | h, |
uint8_t * | n | ||
) |
Convert host order to little-endian.
Referenced by SgAsmPEFileHeader::encode(), SgAsmNEFileHeader::encode(), SgAsmDOSFileHeader::encode(), SgAsmDOSExtendedHeader::encode(), SgAsmCoffSymbol::encode(), SgAsmPEImportDirectory::encode(), SgAsmPESectionTableEntry::encode(), SgAsmPERVASizePair::encode(), SgAsmNESectionTableEntry::encode(), SgAsmElfEHFrameEntryFD::unparse(), SgAsmNENameTable::unparse(), SgAsmNEModuleTable::unparse(), SgAsmNEEntryTable::unparse(), SgAsmNERelocTable::unparse(), SgAsmLENameTable::unparse(), SgAsmElfEHFrameEntryCI::unparse(), SgAsmNERelocEntry::unparse(), and SgAsmPEImportDirectory::unparse_ilt_iat().
void ByteOrder::host_to_le | ( | unsigned | h, |
uint16_t * | n | ||
) |
Convert host order to little-endian.
void ByteOrder::host_to_le | ( | unsigned | h, |
uint32_t * | n | ||
) |
Convert host order to little-endian.
void ByteOrder::host_to_le | ( | rose_addr_t | h, |
uint64_t * | n | ||
) |
Convert host order to little-endian.
void ByteOrder::host_to_le | ( | rose_rva_t | h, |
uint32_t * | n | ||
) |
Convert host order to little-endian.
void ByteOrder::host_to_le | ( | rose_rva_t | h, |
uint64_t * | n | ||
) |
Convert host order to little-endian.
void ByteOrder::host_to_le | ( | int | h, |
int8_t * | n | ||
) |
Convert host order to little-endian.
void ByteOrder::host_to_le | ( | int | h, |
int16_t * | n | ||
) |
Convert host order to little-endian.
void ByteOrder::host_to_le | ( | int | h, |
int32_t * | n | ||
) |
Convert host order to little-endian.
void ByteOrder::host_to_le | ( | int64_t | h, |
int64_t * | n | ||
) |
Convert host order to little-endian.
uint8_t ByteOrder::be_to_host | ( | uint8_t | n) |
Convert a bit-endian integer to host order.
uint16_t ByteOrder::be_to_host | ( | uint16_t | n) |
Convert a bit-endian integer to host order.
uint32_t ByteOrder::be_to_host | ( | uint32_t | n) |
Convert a bit-endian integer to host order.
uint64_t ByteOrder::be_to_host | ( | uint64_t | n) |
Convert a bit-endian integer to host order.
int8_t ByteOrder::be_to_host | ( | int8_t | n) |
Convert a bit-endian integer to host order.
int16_t ByteOrder::be_to_host | ( | int16_t | n) |
Convert a bit-endian integer to host order.
int32_t ByteOrder::be_to_host | ( | int32_t | n) |
Convert a bit-endian integer to host order.
int64_t ByteOrder::be_to_host | ( | int64_t | n) |
Convert a bit-endian integer to host order.
void ByteOrder::host_to_be | ( | unsigned | h, |
uint8_t * | n | ||
) |
Convert host order to big endian.
void ByteOrder::host_to_be | ( | unsigned | h, |
uint16_t * | n | ||
) |
Convert host order to big endian.
void ByteOrder::host_to_be | ( | unsigned | h, |
uint32_t * | n | ||
) |
Convert host order to big endian.
void ByteOrder::host_to_be | ( | rose_addr_t | h, |
uint64_t * | n | ||
) |
Convert host order to big endian.
void ByteOrder::host_to_be | ( | rose_rva_t | h, |
uint32_t * | n | ||
) |
Convert host order to big endian.
void ByteOrder::host_to_be | ( | rose_rva_t | h, |
uint64_t * | n | ||
) |
Convert host order to big endian.
void ByteOrder::host_to_be | ( | int | h, |
int8_t * | n | ||
) |
Convert host order to big endian.
void ByteOrder::host_to_be | ( | int | h, |
int16_t * | n | ||
) |
Convert host order to big endian.
void ByteOrder::host_to_be | ( | int | h, |
int32_t * | n | ||
) |
Convert host order to big endian.
void ByteOrder::host_to_be | ( | int64_t | h, |
int64_t * | n | ||
) |
Convert host order to big endian.
uint8_t ByteOrder::disk_to_host | ( | Endianness | sex, |
uint8_t | n | ||
) |
Convert call-specified order to host order.
Referenced by SgAsmLEFileHeader::ctor(), SgAsmElfSectionTableEntry::ctor(), SgAsmElfSegmentTableEntry::ctor(), SgAsmLEPageTableEntry::ctor(), SgAsmLEEntryPoint::ctor(), SgAsmLESectionTableEntry::ctor(), SgAsmElfFileHeader::parse(), SgAsmElfEHFrameSection::parse(), SgAsmElfSymverSection::parse(), SgAsmElfSymverDefinedSection::parse(), SgAsmElfSymverNeededSection::parse(), SgAsmElfSymbol::parse(), SgAsmElfRelocEntry::parse(), SgAsmElfDynamicEntry::parse(), SgAsmElfNoteEntry::parse(), SgAsmElfSymverDefinedEntry::parse(), SgAsmElfSymverDefinedAux::parse(), SgAsmElfSymverNeededEntry::parse(), and SgAsmElfSymverNeededAux::parse().
uint16_t ByteOrder::disk_to_host | ( | Endianness | sex, |
uint16_t | n | ||
) |
Convert call-specified order to host order.
uint32_t ByteOrder::disk_to_host | ( | Endianness | sex, |
uint32_t | n | ||
) |
Convert call-specified order to host order.
uint64_t ByteOrder::disk_to_host | ( | Endianness | sex, |
uint64_t | n | ||
) |
Convert call-specified order to host order.
int8_t ByteOrder::disk_to_host | ( | Endianness | sex, |
int8_t | n | ||
) |
Convert call-specified order to host order.
int16_t ByteOrder::disk_to_host | ( | Endianness | sex, |
int16_t | n | ||
) |
Convert call-specified order to host order.
int32_t ByteOrder::disk_to_host | ( | Endianness | sex, |
int32_t | n | ||
) |
Convert call-specified order to host order.
int64_t ByteOrder::disk_to_host | ( | Endianness | sex, |
int64_t | n | ||
) |
Convert call-specified order to host order.
void ByteOrder::host_to_disk | ( | Endianness | sex, |
unsigned | h, | ||
uint8_t * | np | ||
) |
Convert host order to caller-specified order.
Referenced by SgAsmLEFileHeader::encode(), SgAsmElfFileHeader::encode(), SgAsmElfSymbol::encode(), SgAsmElfSectionTableEntry::encode(), SgAsmElfSegmentTableEntry::encode(), SgAsmElfRelocEntry::encode(), SgAsmElfDynamicEntry::encode(), SgAsmElfSymverDefinedEntry::encode(), SgAsmElfSymverDefinedAux::encode(), SgAsmElfSymverNeededEntry::encode(), SgAsmElfSymverNeededAux::encode(), SgAsmLEPageTableEntry::encode(), SgAsmLESectionTableEntry::encode(), SgAsmElfEHFrameSection::unparse(), SgAsmElfSymverSection::unparse(), SgAsmElfSymverDefinedSection::unparse(), SgAsmElfSymverNeededSection::unparse(), SgAsmElfNoteEntry::unparse(), and SgAsmLEEntryPoint::unparse().
void ByteOrder::host_to_disk | ( | Endianness | sex, |
unsigned | h, | ||
uint16_t * | np | ||
) |
Convert call-specified order to host order.
void ByteOrder::host_to_disk | ( | Endianness | sex, |
unsigned | h, | ||
uint32_t * | np | ||
) |
Convert call-specified order to host order.
void ByteOrder::host_to_disk | ( | Endianness | sex, |
rose_addr_t | h, | ||
uint64_t * | np | ||
) |
Convert call-specified order to host order.
void ByteOrder::host_to_disk | ( | Endianness | sex, |
rose_rva_t | h, | ||
uint64_t * | np | ||
) |
Convert call-specified order to host order.
void ByteOrder::host_to_disk | ( | Endianness | sex, |
int | h, | ||
int8_t * | np | ||
) |
Convert call-specified order to host order.
void ByteOrder::host_to_disk | ( | Endianness | sex, |
int | h, | ||
int16_t * | np | ||
) |
Convert call-specified order to host order.
void ByteOrder::host_to_disk | ( | Endianness | sex, |
int | h, | ||
int32_t * | np | ||
) |
Convert call-specified order to host order.
void ByteOrder::host_to_disk | ( | Endianness | sex, |
int64_t | h, | ||
int64_t * | np | ||
) |
Convert call-specified order to host order.