read/macho: delete unused DyldCacheImageInfo::file_offset

This is leftover from before subcaches were supported.
This commit is contained in:
Philip Craig
2025-06-01 14:38:23 +10:00
parent fd0e96500a
commit e703ca18e8
+2 -12
View File
@@ -908,24 +908,14 @@ impl<E: Endian> macho::DyldCacheHeader<E> {
impl<E: Endian> macho::DyldCacheImageInfo<E> {
/// The file system path of this image.
///
/// `data` should be the main cache file, not the subcache containing the image.
pub fn path<'data, R: ReadRef<'data>>(&self, endian: E, data: R) -> Result<&'data [u8]> {
let r_start = self.path_file_offset.get(endian).into();
let r_end = data.len().read_error("Couldn't get data len()")?;
data.read_bytes_at_until(r_start..r_end, 0)
.read_error("Couldn't read dyld cache image path")
}
/// Find the file offset of the image by looking up its address in the mappings.
pub fn file_offset<'data, R: ReadRef<'data>>(
&self,
endian: E,
mappings: &DyldCacheMappingSlice<'data, E, R>,
) -> Result<u64> {
let address = self.address.get(endian);
mappings
.address_to_file_offset(address)
.read_error("Invalid dyld cache image address")
}
}
impl<E: Endian> macho::DyldCacheMappingAndSlideInfo<E> {