summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-02-02 23:02:56 +0100
committerGravatar Nikias Bassen2012-02-02 23:02:56 +0100
commitfd719c0e287d56d9ce7ac5b96a499b18159c3550 (patch)
tree40f6920e889cb2b93dab72a435e2d29737592aa8
parent5238ca38754c6b3faba376a74d0f2a9110397a92 (diff)
downloadidevicerestore-fd719c0e287d56d9ce7ac5b96a499b18159c3550.tar.gz
idevicerestore-fd719c0e287d56d9ce7ac5b96a499b18159c3550.tar.bz2
ipsw: add ipsw_extract_restore_plist
-rw-r--r--src/ipsw.c12
-rw-r--r--src/ipsw.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/ipsw.c b/src/ipsw.c
index 19cf924..b9ebdff 100644
--- a/src/ipsw.c
+++ b/src/ipsw.c
@@ -200,6 +200,18 @@ int ipsw_extract_build_manifest(const char* ipsw, plist_t* buildmanifest, int *t
return -1;
}
+int ipsw_extract_restore_plist(const char* ipsw, plist_t* restore_plist) {
+ int size = 0;
+ char* data = NULL;
+
+ if (ipsw_extract_to_memory(ipsw, "Restore.plist", &data, &size) == 0) {
+ plist_from_xml(data, size, restore_plist);
+ return 0;
+ }
+
+ return -1;
+}
+
void ipsw_close(ipsw_archive* archive) {
if (archive != NULL) {
zip_unchange_all(archive->zip);
diff --git a/src/ipsw.h b/src/ipsw.h
index bd8ffc4..a77bc84 100644
--- a/src/ipsw.h
+++ b/src/ipsw.h
@@ -39,6 +39,7 @@ typedef struct {
int ipsw_extract_to_memory(const char* ipsw, const char* infile, char** pbuffer, uint32_t* psize);
int ipsw_extract_build_manifest(const char* ipsw, plist_t* buildmanifest, int *tss_enabled);
+int ipsw_extract_restore_plist(const char* ipsw, plist_t* restore_plist);
void ipsw_free_file(ipsw_file* file);
#ifdef __cplusplus