#[cfg(feature = "log")] use log::debug; #[cfg(feature = "alloc")] use scroll::{IOread, IOwrite, Pread, Pwrite, SizeWith};
/// ABI information. /// /// The descriptor consists of words: /// * word 0: OS descriptor /// * word 1: major version of the ABI /// * word 2: minor version of the ABI /// * word 3: subminor version of the ABI pubconst NT_GNU_ABI_TAG: u32 = 1;
/// Old name pubconst ELF_NOTE_ABI: u32 = NT_GNU_ABI_TAG; // Known OSes. These values can appear in word 0 of an // `NT_GNU_ABI_TAG` note section entry. pubconst ELF_NOTE_OS_LINUX: u32 = 0; pubconst ELF_NOTE_OS_GNU: u32 = 1; pubconst ELF_NOTE_OS_SOLARIS2: u32 = 2; pubconst ELF_NOTE_OS_FREEBSD: u32 = 3;
/// Synthetic `hwcap` information. /// /// The descriptor begins with two words: /// * word 0: number of entries /// * word 1: bitmask of enabled entries /// /// Then follow variable-length entries, one byte followed by a '\0'-terminated /// `hwcap` name string. The byte gives the bit number to test if enabled, /// `(1U << bit) & bitmask`. pubconst NT_GNU_HWCAP: u32 = 2;
/// Build ID bits as generated by ld --build-id. /// /// The descriptor consists of any nonzero number of bytes. pubconst NT_GNU_BUILD_ID: u32 = 3;
/// Version note generated by GNU gold containing a version string. pubconst NT_GNU_GOLD_VERSION: u32 = 4;
/// Program property note pubconst NT_GNU_PROPERTY_TYPE_0: u32 = 5;
///Contains copy of prstatus struct. pubconst NT_PRSTATUS: u32 = 1;
///Contains copy of prpsinfo struct. pubconst NT_PRPSINFO: u32 = 3;
///Fields of siginfo_t. pubconst NT_SIGINFO: u32 = 0x5349_4749;
///Description of mapped files. pubconst NT_FILE: u32 = 0x4649_4c45;
#[derive(Clone, Copy, Debug)] #[cfg_attr(feature = "alloc", derive(Pread, Pwrite, IOread, IOwrite, SizeWith))] #[repr(C)] /// Note section contents. Each entry in the note section begins with a header /// of a fixed form. pubstruct Nhdr32 { /// Length of the note's name (includes the terminator) pub n_namesz: u32, /// Length of the note's descriptor pub n_descsz: u32, /// Type of the note pub n_type: u32,
}
// Declare that this is a plain type. unsafeimpl plain::Plain for Nhdr32 {}
#[derive(Clone, Copy, Debug)] #[cfg_attr(feature = "alloc", derive(Pread, Pwrite, IOread, IOwrite, SizeWith))] #[repr(C)] /// Note section contents. Each entry in the note section begins with a header /// of a fixed form. pubstruct Nhdr64 { /// Length of the note's name (includes the terminator) pub n_namesz: u64, /// Length of the note's descriptor. pub n_descsz: u64, /// Type of the note. pub n_type: u64,
}
// Declare that this is a plain type. unsafeimpl plain::Plain for Nhdr64 {}
if_alloc! { usecrate::error; usecrate::container; use scroll::ctx; use alloc::vec::Vec;
/// An iterator over ELF binary notes in a note section or segment pubstruct NoteDataIterator<'a> { pub data: &'a [u8], pub size: usize, pub offset: usize, pub ctx: (usize, container::Ctx), // (alignment, ctx)
}
/// A 32/64 bit Note struct, with the name and desc pre-parsed #[derive(Debug)] pubstruct Note<'a> { /// The type of this note pub n_type: u32, /// NUL terminated string, where `namesz` includes the terminator pub name: &'a str, // needs padding such that namesz + padding % {wordsize} == 0 /// arbitrary data of length `descsz` pub desc: &'a [u8], // needs padding such that descsz + padding % {wordsize} == 0
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.