/// A trait for generic access to [`elf::Dyn32`] and [`elf::Dyn64`]. #[allow(missing_docs)] pubtraitDyn: Debug + Pod { type Word: Into<u64>; type Endian: endian::Endian;
/// Try to convert the tag to a `u32`. fn tag32(&self, endian: Self::Endian) -> Option<u32> { self.d_tag(endian).into().try_into().ok()
}
/// Try to convert the value to a `u32`. fn val32(&self, endian: Self::Endian) -> Option<u32> { self.d_val(endian).into().try_into().ok()
}
/// Return true if the value is an offset in the dynamic string table. fn is_string(&self, endian: Self::Endian) -> bool { iflet Some(tag) = self.tag32(endian) { match tag {
elf::DT_NEEDED
| elf::DT_SONAME
| elf::DT_RPATH
| elf::DT_RUNPATH
| elf::DT_AUXILIARY
| elf::DT_FILTER => true,
_ => false,
}
} else { false
}
}
/// Use the value to get a string in a string table. /// /// Does not check for an appropriate tag. fn string<'data>(
&self,
endian: Self::Endian,
strings: StringTable<'data>,
) -> Result<&'data [u8]> { self.val32(endian)
.and_then(|val| strings.get(val).ok())
.read_error("Invalid ELF dyn string")
}
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.