summaryrefslogtreecommitdiffstats
path: root/src/ipsw.h
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2023-11-02 12:54:47 +0100
committerGravatar Nikias Bassen2023-11-02 12:54:47 +0100
commitc871c591e36d2a4083e3dda4c70144a0321ce70f (patch)
treece6a990c037c78a84a5d2f99038a7e98e1425bf6 /src/ipsw.h
parent4072cd965eab44993700b980d8848b46ec3be72e (diff)
downloadidevicerestore-c871c591e36d2a4083e3dda4c70144a0321ce70f.tar.gz
idevicerestore-c871c591e36d2a4083e3dda4c70144a0321ce70f.tar.bz2
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.
Diffstat (limited to 'src/ipsw.h')
-rw-r--r--src/ipsw.h3
1 files changed, 3 insertions, 0 deletions
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);