From c871c591e36d2a4083e3dda4c70144a0321ce70f Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 2 Nov 2023 12:54:47 +0100 Subject: Extract OS component when using older ipsw archives Older ipsw archives have the root filesystem stored in compressed format rather than just "stored". The "Verifying Filesystem" step would then fail as compressed files are not seekable in ZIP files. This commit introduces a detection for this and has the filesystem extracted should it be required. If not using a cache path, the temp file used for extraction will be deleted after the procedure is completed. --- src/ipsw.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ipsw.h') diff --git a/src/ipsw.h b/src/ipsw.h index 96bcb62..56faf94 100644 --- a/src/ipsw.h +++ b/src/ipsw.h @@ -49,12 +49,15 @@ typedef int (*ipsw_send_cb)(void *ctx, void *data, size_t size); struct ipsw_file_handle { FILE* file; struct zip_file* zfile; + uint64_t size; + int seekable; }; typedef struct ipsw_file_handle* ipsw_file_handle_t; ipsw_file_handle_t ipsw_file_open(ipsw_archive_t, const char* path); void ipsw_file_close(ipsw_file_handle_t handle); +uint64_t ipsw_file_size(ipsw_file_handle_t handle); int64_t ipsw_file_read(ipsw_file_handle_t handle, void* buffer, size_t size); int ipsw_file_seek(ipsw_file_handle_t handle, int64_t offset, int whence); int64_t ipsw_file_tell(ipsw_file_handle_t handle); -- cgit v1.1-32-gdbae