From 4d74cd31751165b671eba9a1b0936718b7f39b52 Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Tue, 1 Jun 2010 16:13:25 -0400 Subject: Began major refactoring, not quite finished yet, this branch is probably broke --- src/idevicerestore.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index 3dcf1d5..f1861e9 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -22,10 +22,61 @@ #ifndef IDEVICERESTORE_H #define IDEVICERESTORE_H +#define info(...) printf(__VA_ARGS__) #define error(...) fprintf(stderr, __VA_ARGS__) -#define info(...) if(idevicerestore_debug >= 1) fprintf(stderr, __VA_ARGS__) -#define debug(...) if(idevicerestore_debug >= 2) fprintf(stderr, __VA_ARGS__) +#define debug(...) if(idevicerestore_debug >= 1) fprintf(stderr, __VA_ARGS__) +#define IPHONE2G_CPID 8900 +#define IPHONE3G_CPID 8900 +#define IPHONE3GS_CPID 8920 +#define IPOD1G_CPID 8900 +#define IPOD2G_CPID 8720 +#define IPOD3G_CPID 8922 +#define IPAD1G_CPID 8930 + +#define IPHONE2G_BDID 0 +#define IPHONE3G_BDID 4 +#define IPHONE3GS_BDID 0 +#define IPOD1G_BDID 2 +#define IPOD2G_BDID 0 +#define IPOD3G_BDID 2 +#define IPAD1G_BDID 2 + +typedef enum { + UNKNOWN_MODE = -1, + DFU_MODE = 0, + NORMAL_MODE = 1, + RECOVERY_MODE = 2, + RESTORE_MODE = 3 +} idevicerestore_mode_t; + +typedef enum { + UNKNOWN_DEVICE = -1, + IPHONE2G_DEVICE = 0, + IPHONE3G_DEVICE = 1, + IPHONE3GS_DEVICE = 2, + IPOD1G_DEVICE = 3, + IPOD2G_DEVICE = 4, + IPOD3G_DEVICE = 5, + IPAD1G_DEVICE = 6 +} idevicerestore_device_t; + +static char* idevicerestore_products[] = { + "iPhone1,1", + "iPhone1,2", + "iPhone2,1", + "iPod1,1", + "iPod2,1", + "iPod3,1", + "iPad1,1", + NULL +}; + +extern int idevicerestore_quit; extern int idevicerestore_debug; +extern int idevicerestore_custom; +extern int idevicerestore_verbose; +extern idevicerestore_mode_t idevicerestore_mode; +extern idevicerestore_device_t idevicerestore_device; #endif -- cgit v1.1-32-gdbae From 95d83e38a95c9cf28ffa59611149fbba242449c4 Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Thu, 3 Jun 2010 17:03:33 -0400 Subject: Continuing to refactor code and add support for other devices --- src/idevicerestore.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index f1861e9..40d5543 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -45,18 +45,18 @@ typedef enum { UNKNOWN_MODE = -1, DFU_MODE = 0, - NORMAL_MODE = 1, - RECOVERY_MODE = 2, - RESTORE_MODE = 3 + RECOVERY_MODE = 1, + RESTORE_MODE = 2, + NORMAL_MODE = 3, } idevicerestore_mode_t; typedef enum { UNKNOWN_DEVICE = -1, IPHONE2G_DEVICE = 0, IPHONE3G_DEVICE = 1, - IPHONE3GS_DEVICE = 2, - IPOD1G_DEVICE = 3, - IPOD2G_DEVICE = 4, + IPOD1G_DEVICE = 2, + IPOD2G_DEVICE = 3, + IPHONE3GS_DEVICE = 4, IPOD3G_DEVICE = 5, IPAD1G_DEVICE = 6 } idevicerestore_device_t; @@ -74,6 +74,7 @@ static char* idevicerestore_products[] = { extern int idevicerestore_quit; extern int idevicerestore_debug; +extern int idevicerestore_erase; extern int idevicerestore_custom; extern int idevicerestore_verbose; extern idevicerestore_mode_t idevicerestore_mode; -- cgit v1.1-32-gdbae From 5fe87e252c9c28a67277e21febb19027feb32372 Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Sat, 5 Jun 2010 05:11:41 -0400 Subject: Added long options and moved the function main source file function declarations into the header file for easier maintainance --- src/idevicerestore.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index 40d5543..adea68e 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -22,6 +22,9 @@ #ifndef IDEVICERESTORE_H #define IDEVICERESTORE_H +#include +#include + #define info(...) printf(__VA_ARGS__) #define error(...) fprintf(stderr, __VA_ARGS__) #define debug(...) if(idevicerestore_debug >= 1) fprintf(stderr, __VA_ARGS__) @@ -76,8 +79,23 @@ extern int idevicerestore_quit; extern int idevicerestore_debug; extern int idevicerestore_erase; extern int idevicerestore_custom; +extern int idevicerestore_exclude; extern int idevicerestore_verbose; extern idevicerestore_mode_t idevicerestore_mode; extern idevicerestore_device_t idevicerestore_device; +int check_mode(const char* uuid); +int check_device(const char* uuid); +void usage(int argc, char* argv[]); +int get_ecid(const char* uuid, uint64_t* ecid); +int get_bdid(const char* uuid, uint32_t* bdid); +int get_cpid(const char* uuid, uint32_t* cpid); +int extract_buildmanifest(const char* ipsw, plist_t* buildmanifest); +plist_t get_build_identity(plist_t buildmanifest, uint32_t identity); +int write_file(const char* filename, const void* data, size_t size); +int get_shsh_blobs(uint64_t ecid, plist_t build_identity, plist_t* tss); +int extract_filesystem(const char* ipsw, plist_t buildmanifest, char** filesystem); +int get_signed_component(char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size); + + #endif -- cgit v1.1-32-gdbae From 255b285d22056dde283d33511c14387ea92e28c0 Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Sat, 5 Jun 2010 18:09:06 -0400 Subject: Changed the device type to a structure array for cleaner code and cross state access --- src/idevicerestore.h | 95 +++++++++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 41 deletions(-) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index adea68e..af66892 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -29,60 +29,66 @@ #define error(...) fprintf(stderr, __VA_ARGS__) #define debug(...) if(idevicerestore_debug >= 1) fprintf(stderr, __VA_ARGS__) -#define IPHONE2G_CPID 8900 -#define IPHONE3G_CPID 8900 -#define IPHONE3GS_CPID 8920 -#define IPOD1G_CPID 8900 -#define IPOD2G_CPID 8720 -#define IPOD3G_CPID 8922 -#define IPAD1G_CPID 8930 +#define MODE_UNKNOWN -1 +#define MODE_DFU 0 +#define MODE_RECOVERY 1 +#define MODE_RESTORE 2 +#define MODE_NORMAL 3 -#define IPHONE2G_BDID 0 -#define IPHONE3G_BDID 4 -#define IPHONE3GS_BDID 0 -#define IPOD1G_BDID 2 -#define IPOD2G_BDID 0 -#define IPOD3G_BDID 2 -#define IPAD1G_BDID 2 +#define CPID_UNKNOWN -1 +#define CPID_IPHONE2G 8900 +#define CPID_IPOD1G 8900 +#define CPID_IPHONE3G 8900 +#define CPID_IPOD2G 8720 +#define CPID_IPHONE3GS 8920 +#define CPID_IPOD3G 8922 +#define CPID_IPAD1G 8930 -typedef enum { - UNKNOWN_MODE = -1, - DFU_MODE = 0, - RECOVERY_MODE = 1, - RESTORE_MODE = 2, - NORMAL_MODE = 3, -} idevicerestore_mode_t; +#define BDID_UNKNOWN -1 +#define BDID_IPHONE2G 0 +#define BDID_IPOD1G 2 +#define BDID_IPHONE3G 4 +#define BDID_IPOD2G 0 +#define BDID_IPHONE3GS 0 +#define BDID_IPOD3G 2 +#define BDID_IPAD1G 2 -typedef enum { - UNKNOWN_DEVICE = -1, - IPHONE2G_DEVICE = 0, - IPHONE3G_DEVICE = 1, - IPOD1G_DEVICE = 2, - IPOD2G_DEVICE = 3, - IPHONE3GS_DEVICE = 4, - IPOD3G_DEVICE = 5, - IPAD1G_DEVICE = 6 +#define DEVICE_UNKNOWN -1 +#define DEVICE_IPHONE2G 0 +#define DEVICE_IPOD1G 1 +#define DEVICE_IPHONE3G 2 +#define DEVICE_IPOD2G 3 +#define DEVICE_IPHONE3GS 4 +#define DEVICE_IPOD3G 5 +#define DEVICE_IPAD1G 6 + +typedef struct { + int device_id; + const char* product; + const char* model; + int board_id; + int chip_id; } idevicerestore_device_t; -static char* idevicerestore_products[] = { - "iPhone1,1", - "iPhone1,2", - "iPhone2,1", - "iPod1,1", - "iPod2,1", - "iPod3,1", - "iPad1,1", - NULL +static idevicerestore_device_t idevicerestore_devices[] = { + { 0, "iPhone1,1", "M68AP", 0, 8900 }, + { 1, "iPod1,1", "N45AP", 2, 8900 }, + { 2, "iPhone1,2", "N82AP", 4, 8900 }, + { 3, "iPod2,1", "N72AP", 0, 8720 }, + { 4, "iPhone2,1", "N88AP", 0, 8920 }, + { 5, "iPod3,1", "N18AP", 2, 8922 }, + { 6, "iPad1,1", "K48AP", 2, 8930 }, + { -1, NULL, NULL, -1, -1 } }; +extern int idevicerestore_mode; extern int idevicerestore_quit; extern int idevicerestore_debug; extern int idevicerestore_erase; extern int idevicerestore_custom; extern int idevicerestore_exclude; extern int idevicerestore_verbose; -extern idevicerestore_mode_t idevicerestore_mode; -extern idevicerestore_device_t idevicerestore_device; +extern idevicerestore_device_t* idevicerestore_device; int check_mode(const char* uuid); int check_device(const char* uuid); @@ -97,5 +103,12 @@ int get_shsh_blobs(uint64_t ecid, plist_t build_identity, plist_t* tss); int extract_filesystem(const char* ipsw, plist_t buildmanifest, char** filesystem); int get_signed_component(char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size); +inline static void debug_plist(plist_t plist) { + int size = 0; + char* data = NULL; + plist_to_xml(plist, &data, &size); + debug("%s", data); + free(data); +} #endif -- cgit v1.1-32-gdbae From a91e336c24a0d741e47be7adf0cd0b2beb20e5ab Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Mon, 7 Jun 2010 02:24:08 -0400 Subject: I really need to put more descriptive messages here, but im doing stuff all over the place --- src/idevicerestore.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index af66892..f92aad2 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -111,4 +111,18 @@ inline static void debug_plist(plist_t plist) { free(data); } +inline static void print_progress_bar(const char* operation, double progress) { + int i = 0; + if(progress < 0) return; + if(progress > 100) progress = 100; + info("\r%s [", operation); + for(i = 0; i < 50; i++) { + if(i < progress / 2) info("="); + else info(" "); + } + info("] %3.1f%%", progress); + if(progress == 100) info("\n"); + fflush(stdout); +} + #endif -- cgit v1.1-32-gdbae From 5346ce8f7cefe7b33dd8abc44e27cb0e0816f78b Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Mon, 7 Jun 2010 05:17:30 -0400 Subject: More small fixes and updated the TODO list --- src/idevicerestore.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index f92aad2..e4186c9 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -1,5 +1,5 @@ /* - * idevicerestore.g + * idevicerestore.h * Restore device firmware and filesystem * * Copyright (c) 2010 Joshua Hill. All Rights Reserved. @@ -22,7 +22,8 @@ #ifndef IDEVICERESTORE_H #define IDEVICERESTORE_H -#include +#include +#include #include #define info(...) printf(__VA_ARGS__) @@ -101,7 +102,7 @@ plist_t get_build_identity(plist_t buildmanifest, uint32_t identity); int write_file(const char* filename, const void* data, size_t size); int get_shsh_blobs(uint64_t ecid, plist_t build_identity, plist_t* tss); int extract_filesystem(const char* ipsw, plist_t buildmanifest, char** filesystem); -int get_signed_component(char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size); +int get_signed_component(const char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size); inline static void debug_plist(plist_t plist) { int size = 0; -- cgit v1.1-32-gdbae From 51b56ba5bf01af40835a43ad1104a7eff3160127 Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Tue, 8 Jun 2010 04:14:29 -0400 Subject: Added a new asr.c file to stick all stuff related to filesystem and abstract the restore process to allow for easier porting --- src/idevicerestore.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index e4186c9..20578a9 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -63,6 +63,16 @@ #define DEVICE_IPOD3G 5 #define DEVICE_IPAD1G 6 +typedef struct idevicerestore_entry { + char* name; + char* path; + char* filename; + char* blob_data; + uint32_t blob_size; + struct idevicerestore_entry* next; + struct idevicerestore_entry* prev; +} idevicerestore_entry_t; + typedef struct { int device_id; const char* product; @@ -70,7 +80,21 @@ typedef struct { int board_id; int chip_id; } idevicerestore_device_t; - +/* +typedef struct { + int mode; + idevice_t device; + irecv_client_t recovery; + restored_client_t restore; + lockdownd_client_t lockdown; + int erase; // 1 + int custom; // 2 + int exclude; // 4 + int verbose; // 8 + idevicerestore_device_t* idevicerestore_device; + idevicerestore_entry_t** entries; +} idevicerestore_context_t; +*/ static idevicerestore_device_t idevicerestore_devices[] = { { 0, "iPhone1,1", "M68AP", 0, 8900 }, { 1, "iPod1,1", "N45AP", 2, 8900 }, @@ -79,6 +103,7 @@ static idevicerestore_device_t idevicerestore_devices[] = { { 4, "iPhone2,1", "N88AP", 0, 8920 }, { 5, "iPod3,1", "N18AP", 2, 8922 }, { 6, "iPad1,1", "K48AP", 2, 8930 }, + { 6, "iPhone4,1", "XXXAP", 0, 0 }, { -1, NULL, NULL, -1, -1 } }; @@ -90,6 +115,7 @@ extern int idevicerestore_custom; extern int idevicerestore_exclude; extern int idevicerestore_verbose; extern idevicerestore_device_t* idevicerestore_device; +extern idevicerestore_entry_t** idevicerestore_entries; int check_mode(const char* uuid); int check_device(const char* uuid); @@ -100,6 +126,7 @@ int get_cpid(const char* uuid, uint32_t* cpid); int extract_buildmanifest(const char* ipsw, plist_t* buildmanifest); plist_t get_build_identity(plist_t buildmanifest, uint32_t identity); int write_file(const char* filename, const void* data, size_t size); +int read_file(const char* filename, char** data, uint32_t* size); int get_shsh_blobs(uint64_t ecid, plist_t build_identity, plist_t* tss); int extract_filesystem(const char* ipsw, plist_t buildmanifest, char** filesystem); int get_signed_component(const char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size); -- cgit v1.1-32-gdbae From 24afafe06f902bfd9f5652beb8797f24033c68bc Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Sun, 20 Jun 2010 22:02:18 -0400 Subject: Archived for historical reasons --- src/idevicerestore.h | 146 ++++++++------------------------------------------- 1 file changed, 21 insertions(+), 125 deletions(-) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index 20578a9..7e5873b 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -22,135 +22,31 @@ #ifndef IDEVICERESTORE_H #define IDEVICERESTORE_H -#include -#include -#include - -#define info(...) printf(__VA_ARGS__) -#define error(...) fprintf(stderr, __VA_ARGS__) -#define debug(...) if(idevicerestore_debug >= 1) fprintf(stderr, __VA_ARGS__) - -#define MODE_UNKNOWN -1 -#define MODE_DFU 0 -#define MODE_RECOVERY 1 -#define MODE_RESTORE 2 -#define MODE_NORMAL 3 - -#define CPID_UNKNOWN -1 -#define CPID_IPHONE2G 8900 -#define CPID_IPOD1G 8900 -#define CPID_IPHONE3G 8900 -#define CPID_IPOD2G 8720 -#define CPID_IPHONE3GS 8920 -#define CPID_IPOD3G 8922 -#define CPID_IPAD1G 8930 - -#define BDID_UNKNOWN -1 -#define BDID_IPHONE2G 0 -#define BDID_IPOD1G 2 -#define BDID_IPHONE3G 4 -#define BDID_IPOD2G 0 -#define BDID_IPHONE3GS 0 -#define BDID_IPOD3G 2 -#define BDID_IPAD1G 2 - -#define DEVICE_UNKNOWN -1 -#define DEVICE_IPHONE2G 0 -#define DEVICE_IPOD1G 1 -#define DEVICE_IPHONE3G 2 -#define DEVICE_IPOD2G 3 -#define DEVICE_IPHONE3GS 4 -#define DEVICE_IPOD3G 5 -#define DEVICE_IPAD1G 6 - -typedef struct idevicerestore_entry { - char* name; - char* path; - char* filename; - char* blob_data; - uint32_t blob_size; - struct idevicerestore_entry* next; - struct idevicerestore_entry* prev; -} idevicerestore_entry_t; +#ifdef __cplusplus +extern "C" { +#endif -typedef struct { - int device_id; - const char* product; - const char* model; - int board_id; - int chip_id; -} idevicerestore_device_t; -/* -typedef struct { - int mode; - idevice_t device; - irecv_client_t recovery; - restored_client_t restore; - lockdownd_client_t lockdown; - int erase; // 1 - int custom; // 2 - int exclude; // 4 - int verbose; // 8 - idevicerestore_device_t* idevicerestore_device; - idevicerestore_entry_t** entries; -} idevicerestore_context_t; -*/ -static idevicerestore_device_t idevicerestore_devices[] = { - { 0, "iPhone1,1", "M68AP", 0, 8900 }, - { 1, "iPod1,1", "N45AP", 2, 8900 }, - { 2, "iPhone1,2", "N82AP", 4, 8900 }, - { 3, "iPod2,1", "N72AP", 0, 8720 }, - { 4, "iPhone2,1", "N88AP", 0, 8920 }, - { 5, "iPod3,1", "N18AP", 2, 8922 }, - { 6, "iPad1,1", "K48AP", 2, 8930 }, - { 6, "iPhone4,1", "XXXAP", 0, 0 }, - { -1, NULL, NULL, -1, -1 } -}; +#include +#include -extern int idevicerestore_mode; -extern int idevicerestore_quit; -extern int idevicerestore_debug; -extern int idevicerestore_erase; -extern int idevicerestore_custom; -extern int idevicerestore_exclude; -extern int idevicerestore_verbose; -extern idevicerestore_device_t* idevicerestore_device; -extern idevicerestore_entry_t** idevicerestore_entries; +#include +#include "common.h" -int check_mode(const char* uuid); -int check_device(const char* uuid); void usage(int argc, char* argv[]); -int get_ecid(const char* uuid, uint64_t* ecid); -int get_bdid(const char* uuid, uint32_t* bdid); -int get_cpid(const char* uuid, uint32_t* cpid); -int extract_buildmanifest(const char* ipsw, plist_t* buildmanifest); -plist_t get_build_identity(plist_t buildmanifest, uint32_t identity); -int write_file(const char* filename, const void* data, size_t size); -int read_file(const char* filename, char** data, uint32_t* size); -int get_shsh_blobs(uint64_t ecid, plist_t build_identity, plist_t* tss); -int extract_filesystem(const char* ipsw, plist_t buildmanifest, char** filesystem); -int get_signed_component(const char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size); - -inline static void debug_plist(plist_t plist) { - int size = 0; - char* data = NULL; - plist_to_xml(plist, &data, &size); - debug("%s", data); - free(data); -} - -inline static void print_progress_bar(const char* operation, double progress) { - int i = 0; - if(progress < 0) return; - if(progress > 100) progress = 100; - info("\r%s [", operation); - for(i = 0; i < 50; i++) { - if(i < progress / 2) info("="); - else info(" "); - } - info("] %3.1f%%", progress); - if(progress == 100) info("\n"); - fflush(stdout); +int check_mode(struct idevicerestore_client_t* client); +int check_device(struct idevicerestore_client_t* client); +const char* get_build_name(plist_t build_identity, int identity); +int get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid); +int get_bdid(struct idevicerestore_client_t* client, uint32_t* bdid); +int get_cpid(struct idevicerestore_client_t* client, uint32_t* cpid); +int extract_buildmanifest(struct idevicerestore_client_t* client, const char* ipsw, plist_t* buildmanifest); +plist_t get_build_identity(struct idevicerestore_client_t* client, plist_t buildmanifest, uint32_t identity); +int get_shsh_blobs(struct idevicerestore_client_t* client, uint64_t ecid, plist_t build_identity, plist_t* tss); +int extract_filesystem(struct idevicerestore_client_t* client, const char* ipsw, plist_t buildmanifest, char** filesystem); +int get_signed_component(struct idevicerestore_client_t* client, const char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size); + +#ifdef __cplusplus } +#endif #endif -- cgit v1.1-32-gdbae From 930f4b350474435e011b9dca18424dd1c42ea353 Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Mon, 21 Jun 2010 03:47:54 -0400 Subject: Finally fixed the out of control problem --- src/idevicerestore.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index 7e5873b..1fadf15 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -29,7 +29,6 @@ extern "C" { #include #include -#include #include "common.h" void usage(int argc, char* argv[]); -- cgit v1.1-32-gdbae From 7edbc8417b760179337b507a6d957882b71dde2e Mon Sep 17 00:00:00 2001 From: Joshua Hill Date: Mon, 21 Jun 2010 04:50:40 -0400 Subject: Fixed a few more compile errors, everything should compile fine now, but i'm not sure if it will run yet --- src/idevicerestore.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index 1fadf15..d3d89a0 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -34,6 +34,7 @@ extern "C" { void usage(int argc, char* argv[]); int check_mode(struct idevicerestore_client_t* client); int check_device(struct idevicerestore_client_t* client); +int get_build_count(plist_t buildmanifest); const char* get_build_name(plist_t build_identity, int identity); int get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid); int get_bdid(struct idevicerestore_client_t* client, uint32_t* bdid); -- cgit v1.1-32-gdbae From 17627444b5d61449a638a7937326d852a2705a11 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Thu, 8 Jul 2010 19:14:19 +0200 Subject: Remove get_build_name() which was not working and has no real use --- src/idevicerestore.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index d3d89a0..407c0db 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -35,7 +35,6 @@ void usage(int argc, char* argv[]); int check_mode(struct idevicerestore_client_t* client); int check_device(struct idevicerestore_client_t* client); int get_build_count(plist_t buildmanifest); -const char* get_build_name(plist_t build_identity, int identity); int get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid); int get_bdid(struct idevicerestore_client_t* client, uint32_t* bdid); int get_cpid(struct idevicerestore_client_t* client, uint32_t* cpid); -- cgit v1.1-32-gdbae From bfd4f97062a89d046d73f9e7439ac5e74ef8dcdc Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 9 Jul 2010 03:44:40 +0200 Subject: Add function to retrieve a component path from a build identity --- src/idevicerestore.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index 407c0db..3213b0c 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -43,6 +43,7 @@ plist_t get_build_identity(struct idevicerestore_client_t* client, plist_t build int get_shsh_blobs(struct idevicerestore_client_t* client, uint64_t ecid, plist_t build_identity, plist_t* tss); int extract_filesystem(struct idevicerestore_client_t* client, const char* ipsw, plist_t buildmanifest, char** filesystem); int get_signed_component(struct idevicerestore_client_t* client, const char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size); +int build_identity_get_component_path(plist_t build_identity, const char* component, char** path); #ifdef __cplusplus } -- cgit v1.1-32-gdbae From 4090b98d9e8cdaada701ac320e20f7c8b0cf88f6 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 9 Jul 2010 03:47:42 +0200 Subject: Implement handling of devices which do not require a tss request This introduces passing around the "selected" build identity and fixes code logic issues to make idevicerestore work again. --- src/idevicerestore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/idevicerestore.h') diff --git a/src/idevicerestore.h b/src/idevicerestore.h index 3213b0c..f529b5b 100644 --- a/src/idevicerestore.h +++ b/src/idevicerestore.h @@ -42,7 +42,7 @@ int extract_buildmanifest(struct idevicerestore_client_t* client, const char* ip plist_t get_build_identity(struct idevicerestore_client_t* client, plist_t buildmanifest, uint32_t identity); int get_shsh_blobs(struct idevicerestore_client_t* client, uint64_t ecid, plist_t build_identity, plist_t* tss); int extract_filesystem(struct idevicerestore_client_t* client, const char* ipsw, plist_t buildmanifest, char** filesystem); -int get_signed_component(struct idevicerestore_client_t* client, const char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size); +int ipsw_get_component_by_path(const char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size); int build_identity_get_component_path(plist_t build_identity, const char* component, char** path); #ifdef __cplusplus -- cgit v1.1-32-gdbae