Dave Chapman | 79a1fb1 | 2007-02-08 23:57:41 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id: ipodpatcher.c 12237 2007-02-08 21:31:38Z dave $ |
| 9 | * |
| 10 | * Copyright (C) 2006-2007 Dave Chapman |
| 11 | * |
| 12 | * All files in this archive are subject to the GNU General Public License. |
| 13 | * See the file COPYING in the source tree root for full license agreement. |
| 14 | * |
| 15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 16 | * KIND, either express or implied. |
| 17 | * |
| 18 | ****************************************************************************/ |
| 19 | |
| 20 | #ifndef _IPODPATCHER_H |
| 21 | #define _IPODPATCHER_H |
| 22 | |
Dominik Riebeling | 3f65a70 | 2008-05-22 17:51:35 +0000 | [diff] [blame] | 23 | #ifdef __cplusplus |
| 24 | extern "C" { |
| 25 | #endif |
| 26 | |
Dave Chapman | 79a1fb1 | 2007-02-08 23:57:41 +0000 | [diff] [blame] | 27 | #include "ipodio.h" |
| 28 | |
| 29 | /* Size of buffer for disk I/O - 8MB is large enough for any version |
| 30 | of the Apple firmware, but not the Nano's RSRC image. */ |
| 31 | #define BUFFER_SIZE 8*1024*1024 |
Dominik Riebeling | d131a31 | 2008-06-17 17:52:13 +0000 | [diff] [blame^] | 32 | extern unsigned char* ipod_sectorbuf; |
| 33 | extern int ipod_verbose; |
Dave Chapman | 79a1fb1 | 2007-02-08 23:57:41 +0000 | [diff] [blame] | 34 | |
| 35 | #define FILETYPE_DOT_IPOD 0 |
| 36 | #define FILETYPE_DOT_BIN 1 |
| 37 | #ifdef WITH_BOOTOBJS |
| 38 | #define FILETYPE_INTERNAL 2 |
| 39 | #endif |
| 40 | |
Dave Chapman | a6d68bd | 2007-02-10 20:09:23 +0000 | [diff] [blame] | 41 | char* get_parttype(int pt); |
Dave Chapman | 79a1fb1 | 2007-02-08 23:57:41 +0000 | [diff] [blame] | 42 | int read_partinfo(struct ipod_t* ipod, int silent); |
| 43 | int read_partition(struct ipod_t* ipod, int outfile); |
| 44 | int write_partition(struct ipod_t* ipod, int infile); |
| 45 | int diskmove(struct ipod_t* ipod, int delta); |
| 46 | int add_bootloader(struct ipod_t* ipod, char* filename, int type); |
| 47 | int delete_bootloader(struct ipod_t* ipod); |
| 48 | int write_firmware(struct ipod_t* ipod, char* filename, int type); |
Dave Chapman | 427fff4 | 2007-04-13 23:28:20 +0000 | [diff] [blame] | 49 | int read_firmware(struct ipod_t* ipod, char* filename, int type); |
Dave Chapman | 79a1fb1 | 2007-02-08 23:57:41 +0000 | [diff] [blame] | 50 | int read_directory(struct ipod_t* ipod); |
| 51 | int list_images(struct ipod_t* ipod); |
| 52 | int getmodel(struct ipod_t* ipod, int ipod_version); |
| 53 | int ipod_scan(struct ipod_t* ipod); |
Dave Chapman | 35735c66 | 2007-07-27 20:51:36 +0000 | [diff] [blame] | 54 | int write_dos_partition_table(struct ipod_t* ipod); |
Dave Chapman | 6e79715 | 2007-09-08 23:27:49 +0000 | [diff] [blame] | 55 | int read_aupd(struct ipod_t* ipod, char* filename); |
| 56 | int write_aupd(struct ipod_t* ipod, char* filename); |
Dave Chapman | 79a1fb1 | 2007-02-08 23:57:41 +0000 | [diff] [blame] | 57 | off_t filesize(int fd); |
| 58 | |
Dominik Riebeling | 3f65a70 | 2008-05-22 17:51:35 +0000 | [diff] [blame] | 59 | #ifdef __cplusplus |
| 60 | } |
Dave Chapman | 79a1fb1 | 2007-02-08 23:57:41 +0000 | [diff] [blame] | 61 | #endif |
Dominik Riebeling | 3f65a70 | 2008-05-22 17:51:35 +0000 | [diff] [blame] | 62 | #endif |
| 63 | |