From 6d9cc73e983b5e950b21f172af2a727c8711cba8 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 4 Jul 2012 21:04:26 +0200 Subject: CPID/BDID are actually hex values --- include/libirecovery.h | 96 +++++++++++++++++++++++++------------------------- libirecovery.c | 6 ++-- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/include/libirecovery.h b/include/libirecovery.h index 84d8681..0118c8b 100644 --- a/include/libirecovery.h +++ b/include/libirecovery.h @@ -37,39 +37,39 @@ extern "C" { #define APPLE_VENDOR_ID 0x05AC -#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 CPID_IPHONE4 8930 -#define CPID_IPOD4G 8930 -#define CPID_APPLETV2 8930 -#define CPID_IPHONE42 8930 -#define CPID_IPAD21 8940 -#define CPID_IPAD22 8940 -#define CPID_IPAD23 8940 -#define CPID_IPHONE4S 8940 - -#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 BDID_IPHONE4 0 -#define BDID_IPOD4G 8 -#define BDID_APPLETV2 10 -#define BDID_IPHONE42 6 -#define BDID_IPAD21 4 -#define BDID_IPAD22 6 -#define BDID_IPAD23 2 -#define BDID_IPHONE4S 8 +#define CPID_UNKNOWN -1 +#define CPID_IPHONE2G 0x8900 +#define CPID_IPOD1G 0x8900 +#define CPID_IPHONE3G 0x8900 +#define CPID_IPOD2G 0x8720 +#define CPID_IPHONE3GS 0x8920 +#define CPID_IPOD3G 0x8922 +#define CPID_IPAD1G 0x8930 +#define CPID_IPHONE4 0x8930 +#define CPID_IPOD4G 0x8930 +#define CPID_APPLETV2 0x8930 +#define CPID_IPHONE42 0x8930 +#define CPID_IPAD21 0x8940 +#define CPID_IPAD22 0x8940 +#define CPID_IPAD23 0x8940 +#define CPID_IPHONE4S 0x8940 + +#define BDID_UNKNOWN -1 +#define BDID_IPHONE2G 0x00 +#define BDID_IPOD1G 0x02 +#define BDID_IPHONE3G 0x04 +#define BDID_IPOD2G 0x00 +#define BDID_IPHONE3GS 0x00 +#define BDID_IPOD3G 0x02 +#define BDID_IPAD1G 0x02 +#define BDID_IPHONE4 0x00 +#define BDID_IPOD4G 0x08 +#define BDID_APPLETV2 0x10 +#define BDID_IPHONE42 0x06 +#define BDID_IPAD21 0x04 +#define BDID_IPAD22 0x06 +#define BDID_IPAD23 0x02 +#define BDID_IPHONE4S 0x08 #define DEVICE_UNKNOWN -1 #define DEVICE_IPHONE2G 0 @@ -169,21 +169,21 @@ struct irecv_device { }; static struct irecv_device irecv_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 }, - { 7, "iPhone3,1", "n90ap", 0, 8930 }, - { 8, "iPod4,1", "n81ap", 8, 8930 }, - { 9, "AppleTV2,1", "k66ap", 10, 8930 }, - { 10, "iPhone3,3", "n92ap", 6, 8930 }, - { 11, "iPad2,1", "k93ap", 4, 8940 }, - { 12, "iPad2,2", "k94ap", 6, 8940 }, - { 13, "iPad2,3", "k95ap", 2, 8940 }, - { 14, "iPhone4,1", "n94ap", 8, 8940 }, + { 0, "iPhone1,1", "m68ap", 0x00, 0x8900 }, + { 1, "iPod1,1", "n45ap", 0x02, 0x8900 }, + { 2, "iPhone1,2", "n82ap", 0x04, 0x8900 }, + { 3, "iPod2,1", "n72ap", 0x00, 0x8720 }, + { 4, "iPhone2,1", "n88ap", 0x00, 0x8920 }, + { 5, "iPod3,1", "n18ap", 0x02, 0x8922 }, + { 6, "iPad1,1", "k48ap", 0x02, 0x8930 }, + { 7, "iPhone3,1", "n90ap", 0x00, 0x8930 }, + { 8, "iPod4,1", "n81ap", 0x08, 0x8930 }, + { 9, "AppleTV2,1", "k66ap", 0x10, 0x8930 }, + { 10, "iPhone3,3", "n92ap", 0x06, 0x8930 }, + { 11, "iPad2,1", "k93ap", 0x04, 0x8940 }, + { 12, "iPad2,2", "k94ap", 0x06, 0x8940 }, + { 13, "iPad2,3", "k95ap", 0x02, 0x8940 }, + { 14, "iPhone4,1", "n94ap", 0x08, 0x8940 }, { -1, NULL, NULL, -1, -1 } }; diff --git a/libirecovery.c b/libirecovery.c index d6b1c5b..e99c16a 100644 --- a/libirecovery.c +++ b/libirecovery.c @@ -1077,7 +1077,7 @@ irecv_error_t irecv_get_cpid(irecv_client_t client, unsigned int* cpid) { if (client->mode == kWTFMode) { char s_cpid[8] = {0,}; strncpy(s_cpid, client->serial, 4); - if (sscanf(s_cpid, "%d", cpid) != 1) { + if (sscanf(s_cpid, "%x", cpid) != 1) { *cpid = 0; return IRECV_E_UNKNOWN_ERROR; } @@ -1089,7 +1089,7 @@ irecv_error_t irecv_get_cpid(irecv_client_t client, unsigned int* cpid) { *cpid = 0; return IRECV_E_UNKNOWN_ERROR; } - sscanf(cpid_string, "CPID:%d", cpid); + sscanf(cpid_string, "CPID:%x", cpid); return IRECV_E_SUCCESS; } @@ -1102,7 +1102,7 @@ irecv_error_t irecv_get_bdid(irecv_client_t client, unsigned int* bdid) { *bdid = 0; return IRECV_E_UNKNOWN_ERROR; } - sscanf(bdid_string, "BDID:%d", bdid); + sscanf(bdid_string, "BDID:%x", bdid); return IRECV_E_SUCCESS; } -- cgit v1.1-32-gdbae