summaryrefslogtreecommitdiff
path: root/rbutil/ipodpatcher
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/ipodpatcher')
-rw-r--r--rbutil/ipodpatcher/ipodio.h1
-rw-r--r--rbutil/ipodpatcher/ipodpatcher.c27
-rw-r--r--rbutil/ipodpatcher/ipodpatcher.h2
-rw-r--r--rbutil/ipodpatcher/main.c20
4 files changed, 30 insertions, 20 deletions
diff --git a/rbutil/ipodpatcher/ipodio.h b/rbutil/ipodpatcher/ipodio.h
index d0641faa2b..71cafc56f2 100644
--- a/rbutil/ipodpatcher/ipodio.h
+++ b/rbutil/ipodpatcher/ipodio.h
@@ -70,6 +70,7 @@ struct ipod_t {
int modelnum;
char* modelname;
char* modelstr;
+ char* targetname;
int macpod;
#ifdef WITH_BOOTOBJS
unsigned char* bootloader;
diff --git a/rbutil/ipodpatcher/ipodpatcher.c b/rbutil/ipodpatcher/ipodpatcher.c
index 6c60bae38d..6fcf0c8c27 100644
--- a/rbutil/ipodpatcher/ipodpatcher.c
+++ b/rbutil/ipodpatcher/ipodpatcher.c
@@ -158,25 +158,6 @@ void int2be(unsigned int val, unsigned char* addr)
((long)array[pos] | ((long)array[pos+1] << 8 ) |\
((long)array[pos+2] << 16 ) | ((long)array[pos+3] << 24 ))
-void display_partinfo(struct ipod_t* ipod)
-{
- int i;
- double sectors_per_MB = (1024.0*1024.0)/ipod->sector_size;
-
- printf("[INFO] Part Start Sector End Sector Size (MB) Type\n");
- for ( i = 0; i < 4; i++ ) {
- if (ipod->pinfo[i].start != 0) {
- printf("[INFO] %d %10ld %10ld %10.1f %s (0x%02x)\n",
- i,
- ipod->pinfo[i].start,
- ipod->pinfo[i].start+ipod->pinfo[i].size-1,
- ipod->pinfo[i].size/sectors_per_MB,
- get_parttype(ipod->pinfo[i].type),
- ipod->pinfo[i].type);
- }
- }
-}
-
int read_partinfo(struct ipod_t* ipod, int silent)
{
int i;
@@ -1127,6 +1108,7 @@ int getmodel(struct ipod_t* ipod, int ipod_version)
ipod->modelstr="3rd Generation";
ipod->modelnum = 7;
ipod->modelname = "ip3g";
+ ipod->targetname = "ipod3g";
#ifdef WITH_BOOTOBJS
ipod->bootloader = ipod3g;
ipod->bootloader_len = LEN_ipod3g;
@@ -1136,6 +1118,7 @@ int getmodel(struct ipod_t* ipod, int ipod_version)
ipod->modelstr="1st Generation Mini";
ipod->modelnum = 9;
ipod->modelname = "mini";
+ ipod->targetname = "ipodmini";
#ifdef WITH_BOOTOBJS
ipod->bootloader = ipodmini;
ipod->bootloader_len = LEN_ipodmini;
@@ -1145,6 +1128,7 @@ int getmodel(struct ipod_t* ipod, int ipod_version)
ipod->modelstr="4th Generation";
ipod->modelnum = 8;
ipod->modelname = "ip4g";
+ ipod->targetname = "ipod4g";
#ifdef WITH_BOOTOBJS
ipod->bootloader = ipod4g;
ipod->bootloader_len = LEN_ipod4g;
@@ -1154,6 +1138,7 @@ int getmodel(struct ipod_t* ipod, int ipod_version)
ipod->modelstr="Photo/Color";
ipod->modelnum = 3;
ipod->modelname = "ipco";
+ ipod->targetname = "ipodcolor";
#ifdef WITH_BOOTOBJS
ipod->bootloader = ipodcolor;
ipod->bootloader_len = LEN_ipodcolor;
@@ -1163,6 +1148,7 @@ int getmodel(struct ipod_t* ipod, int ipod_version)
ipod->modelstr="2nd Generation Mini";
ipod->modelnum = 11;
ipod->modelname = "mn2g";
+ ipod->targetname = "ipodmini2g";
#ifdef WITH_BOOTOBJS
ipod->bootloader = ipodmini2g;
ipod->bootloader_len = LEN_ipodmini2g;
@@ -1172,6 +1158,7 @@ int getmodel(struct ipod_t* ipod, int ipod_version)
ipod->modelstr="1st Generation Nano";
ipod->modelnum = 4;
ipod->modelname = "nano";
+ ipod->targetname = "ipodnano";
#ifdef WITH_BOOTOBJS
ipod->bootloader = ipodnano;
ipod->bootloader_len = LEN_ipodnano;
@@ -1181,6 +1168,7 @@ int getmodel(struct ipod_t* ipod, int ipod_version)
ipod->modelstr="Video (aka 5th Generation)";
ipod->modelnum = 5;
ipod->modelname = "ipvd";
+ ipod->targetname = "ipodvideo";
#ifdef WITH_BOOTOBJS
ipod->bootloader = ipodvideo;
ipod->bootloader_len = LEN_ipodvideo;
@@ -1189,6 +1177,7 @@ int getmodel(struct ipod_t* ipod, int ipod_version)
default:
ipod->modelname = NULL;
ipod->modelnum = 0;
+ ipod->targetname = NULL;
#ifdef WITH_BOOTOBJS
ipod->bootloader = NULL;
ipod->bootloader_len = 0;
diff --git a/rbutil/ipodpatcher/ipodpatcher.h b/rbutil/ipodpatcher/ipodpatcher.h
index c533f4c2dc..4c1eee58af 100644
--- a/rbutil/ipodpatcher/ipodpatcher.h
+++ b/rbutil/ipodpatcher/ipodpatcher.h
@@ -33,7 +33,7 @@ extern unsigned char* sectorbuf;
#define FILETYPE_INTERNAL 2
#endif
-void display_partinfo(struct ipod_t* ipod);
+char* get_parttype(int pt);
int read_partinfo(struct ipod_t* ipod, int silent);
int read_partition(struct ipod_t* ipod, int outfile);
int write_partition(struct ipod_t* ipod, int infile);
diff --git a/rbutil/ipodpatcher/main.c b/rbutil/ipodpatcher/main.c
index d183b9bc52..476aeff9d2 100644
--- a/rbutil/ipodpatcher/main.c
+++ b/rbutil/ipodpatcher/main.c
@@ -102,6 +102,26 @@ void print_usage(void)
#endif
}
+void display_partinfo(struct ipod_t* ipod)
+{
+ int i;
+ double sectors_per_MB = (1024.0*1024.0)/ipod->sector_size;
+
+ printf("[INFO] Part Start Sector End Sector Size (MB) Type\n");
+ for ( i = 0; i < 4; i++ ) {
+ if (ipod->pinfo[i].start != 0) {
+ printf("[INFO] %d %10ld %10ld %10.1f %s (0x%02x)\n",
+ i,
+ ipod->pinfo[i].start,
+ ipod->pinfo[i].start+ipod->pinfo[i].size-1,
+ ipod->pinfo[i].size/sectors_per_MB,
+ get_parttype(ipod->pinfo[i].type),
+ ipod->pinfo[i].type);
+ }
+ }
+}
+
+
int main(int argc, char* argv[])
{
#ifdef WITH_BOOTOBJS