mirror of
https://github.com/encounter/object.git
synced 2026-03-30 11:32:22 -07:00
read/macho: delete unused DyldCacheImageInfo::file_offset
This is leftover from before subcaches were supported.
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user