From e703ca18e81a62bfba259ef2bfe6ae16ec35972f Mon Sep 17 00:00:00 2001 From: Philip Craig Date: Sun, 1 Jun 2025 14:38:23 +1000 Subject: [PATCH] read/macho: delete unused DyldCacheImageInfo::file_offset This is leftover from before subcaches were supported. --- src/read/macho/dyld_cache.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/read/macho/dyld_cache.rs b/src/read/macho/dyld_cache.rs index a59876e..fb140f7 100644 --- a/src/read/macho/dyld_cache.rs +++ b/src/read/macho/dyld_cache.rs @@ -908,24 +908,14 @@ impl macho::DyldCacheHeader { impl macho::DyldCacheImageInfo { /// 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 { - let address = self.address.get(endian); - mappings - .address_to_file_offset(address) - .read_error("Invalid dyld cache image address") - } } impl macho::DyldCacheMappingAndSlideInfo {