summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rbutil/sansapatcher/sansapatcher.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/rbutil/sansapatcher/sansapatcher.c b/rbutil/sansapatcher/sansapatcher.c
index 5cf7d8ae75..e3b105dcca 100644
--- a/rbutil/sansapatcher/sansapatcher.c
+++ b/rbutil/sansapatcher/sansapatcher.c
@@ -421,7 +421,7 @@ int is_sansa(struct sansa_t* sansa)
421 421
422 /* Load Sansa bootloader and check for "Sansa C200" magic string */ 422 /* Load Sansa bootloader and check for "Sansa C200" magic string */
423 if (sansa_seek_and_read(sansa, sansa->start + 0x200, sansa->sectorbuf, ppbl_length) < 0) { 423 if (sansa_seek_and_read(sansa, sansa->start + 0x200, sansa->sectorbuf, ppbl_length) < 0) {
424 fprintf(stderr,"[ERR] Seek and read to 0x%08llx in is_sansa failed.\n", 424 fprintf(stderr,"[ERR] Seek and read to 0x%08"PRIx64" in is_sansa failed.\n",
425 sansa->start+0x200); 425 sansa->start+0x200);
426 return -6; 426 return -6;
427 } 427 }
@@ -432,10 +432,10 @@ int is_sansa(struct sansa_t* sansa)
432 /* E200 */ 432 /* E200 */
433 sansa->targetname="e200"; 433 sansa->targetname="e200";
434 } 434 }
435 435
436 /* Check Main firmware header */ 436 /* Check Main firmware header */
437 if (sansa_seek_and_read(sansa, sansa->start+PPMI_OFFSET, sansa->sectorbuf, 0x200) < 0) { 437 if (sansa_seek_and_read(sansa, sansa->start+PPMI_OFFSET, sansa->sectorbuf, 0x200) < 0) {
438 fprintf(stderr,"[ERR] Seek to 0x%08llx in is_sansa failed.\n", 438 fprintf(stderr,"[ERR] Seek to 0x%"PRIx64" in is_sansa failed.\n",
439 sansa->start+PPMI_OFFSET); 439 sansa->start+PPMI_OFFSET);
440 return -5; 440 return -5;
441 } 441 }
@@ -447,7 +447,7 @@ int is_sansa(struct sansa_t* sansa)
447 447
448 /* Check main mi4 file header */ 448 /* Check main mi4 file header */
449 if (sansa_seek_and_read(sansa, sansa->start+PPMI_OFFSET+0x200, sansa->sectorbuf, 0x200) < 0) { 449 if (sansa_seek_and_read(sansa, sansa->start+PPMI_OFFSET+0x200, sansa->sectorbuf, 0x200) < 0) {
450 fprintf(stderr,"[ERR] Seek to 0x%08llx in is_sansa failed.\n", 450 fprintf(stderr,"[ERR] Seek to 0x%"PRIx64" in is_sansa failed.\n",
451 sansa->start+PPMI_OFFSET+0x200); 451 sansa->start+PPMI_OFFSET+0x200);
452 return -5; 452 return -5;
453 } 453 }
@@ -744,7 +744,7 @@ int sansa_add_bootloader(struct sansa_t* sansa, const unsigned char* bootloader,
744 /* Now write the whole thing back to the Sansa */ 744 /* Now write the whole thing back to the Sansa */
745 745
746 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET) < 0) { 746 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET) < 0) {
747 fprintf(stderr,"[ERR] Seek to 0x%08llx in add_bootloader failed.\n", 747 fprintf(stderr,"[ERR] Seek to 0x%08"PRIx64" in add_bootloader failed.\n",
748 sansa->start+PPMI_OFFSET); 748 sansa->start+PPMI_OFFSET);
749 return -5; 749 return -5;
750 } 750 }
@@ -781,7 +781,7 @@ int sansa_delete_bootloader(struct sansa_t* sansa)
781 /* Now write the whole thing back to the Sansa */ 781 /* Now write the whole thing back to the Sansa */
782 782
783 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET) < 0) { 783 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET) < 0) {
784 fprintf(stderr,"[ERR] Seek to 0x%08llx in add_bootloader failed.\n", 784 fprintf(stderr,"[ERR] Seek to 0x%08"PRIx64" in add_bootloader failed.\n",
785 sansa->start+PPMI_OFFSET); 785 sansa->start+PPMI_OFFSET);
786 return -5; 786 return -5;
787 } 787 }
@@ -812,7 +812,7 @@ int sansa_list_images(struct sansa_t* sansa)
812 812
813 ppmi_length = le2int(sansa->sectorbuf+4); 813 ppmi_length = le2int(sansa->sectorbuf+4);
814 814
815 printf("[INFO] Image 1 - %llu bytes\n",ppmi_length); 815 printf("[INFO] Image 1 - %"PRIu64" bytes\n",ppmi_length);
816 num = 1; 816 num = 1;
817 817
818 /* Look for an original firmware after the first image */ 818 /* Look for an original firmware after the first image */
@@ -857,7 +857,7 @@ int sansa_update_of(struct sansa_t* sansa, const char* filename)
857 857
858 if (get_mi4header(buf,&mi4header)!=0) { 858 if (get_mi4header(buf,&mi4header)!=0) {
859 /* We don't have a valid MI4 file after a bootloader, so do nothing. */ 859 /* We don't have a valid MI4 file after a bootloader, so do nothing. */
860 fprintf(stderr,"[ERR] No original firmware found at 0x%08llx\n", 860 fprintf(stderr,"[ERR] No original firmware found at 0x%08"PRIx64"\n",
861 sansa->start+PPMI_OFFSET+0x200+ppmi_length); 861 sansa->start+PPMI_OFFSET+0x200+ppmi_length);
862 return -1; 862 return -1;
863 } 863 }
@@ -896,7 +896,7 @@ int sansa_update_of(struct sansa_t* sansa, const char* filename)
896 896
897 /* Step 3 - write the OF to the Sansa */ 897 /* Step 3 - write the OF to the Sansa */
898 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET+0x200+ppmi_length) < 0) { 898 if (sansa_seek(sansa, sansa->start+PPMI_OFFSET+0x200+ppmi_length) < 0) {
899 fprintf(stderr,"[ERR] Seek to 0x%08llx in sansa_update_of failed.\n", 899 fprintf(stderr,"[ERR] Seek to 0x%08"PRIx64" in sansa_update_of failed.\n",
900 sansa->start+PPMI_OFFSET+0x200+ppmi_length); 900 sansa->start+PPMI_OFFSET+0x200+ppmi_length);
901 return -1; 901 return -1;
902 } 902 }
@@ -913,7 +913,7 @@ int sansa_update_of(struct sansa_t* sansa, const char* filename)
913 if (strcmp(sansa->targetname,"e200") == 0) { 913 if (strcmp(sansa->targetname,"e200") == 0) {
914 printf("[INFO] Resetting Original Firmware settings\n"); 914 printf("[INFO] Resetting Original Firmware settings\n");
915 if (sansa_seek(sansa, sansa->start+NVPARAMS_OFFSET+0x200) < 0) { 915 if (sansa_seek(sansa, sansa->start+NVPARAMS_OFFSET+0x200) < 0) {
916 fprintf(stderr,"[ERR] Seek to 0x%08llx in sansa_update_of failed.\n", 916 fprintf(stderr,"[ERR] Seek to 0x%08"PRIx64" in sansa_update_of failed.\n",
917 sansa->start+NVPARAMS_OFFSET+0x200); 917 sansa->start+NVPARAMS_OFFSET+0x200);
918 return -1; 918 return -1;
919 } 919 }
@@ -960,7 +960,7 @@ int sansa_update_ppbl(struct sansa_t* sansa, const char* filename)
960 960
961 /* Step 3 - write the bootloader to the Sansa */ 961 /* Step 3 - write the bootloader to the Sansa */
962 if (sansa_seek(sansa, sansa->start) < 0) { 962 if (sansa_seek(sansa, sansa->start) < 0) {
963 fprintf(stderr,"[ERR] Seek to 0x%08llx in sansa_update_ppbl failed.\n", sansa->start); 963 fprintf(stderr,"[ERR] Seek to 0x%08"PRIx64" in sansa_update_ppbl failed.\n", sansa->start);
964 return -1; 964 return -1;
965 } 965 }
966 966