-
Notifications
You must be signed in to change notification settings - Fork 55
/
RiiConnect24Patcher.sh
executable file
·1227 lines (996 loc) · 33.3 KB
/
RiiConnect24Patcher.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env bash
# RiiConnect24 Patcher for Unix v1.2.1
#
# Copyright (C) 2024 Sketch, HTV04, and TheShadowEevee
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Print with word wrap
print () {
printf "${1}" | fold -s -w $(tput cols)
}
# Print string and wait for input to store in variable
input () {
print "${1}"
read -r ${2}
}
# Prints "Press any key to " + string given, and then a period, then wait for a key to be pressed
anykey () {
print "Press any key to ${1}."
read -n 1 -r
}
# Print title
title () {
print "${rc24_str}====${1}"
printf "=%.0s" $(seq 1 $(($(tput cols) - (${#1} + 4))))
print "\n\n"
}
# Print subtitle
subtitle () {
print "\055---${1}"
printf "\055%.0s" $(seq 1 $(($(tput cols) - (${#1} + 4))))
print "\n${2}\n"
printf "\055%.0s" $(seq 1 $(tput cols))
print "\n\n"
}
# Get file from SketchMaster2001's website
sketchget () {
curl --create-dirs -f -k -L -o "${2}" -S -s --user-agent "RiiConnect24 Patcher Unix ${ver}" --insecure https://patcher.rc24.xyz/update/RiiConnect24-Patcher_Unix/v1/${1}
}
# Get file from RiiConnect24 website and save it to output
rc24get () {
curl --create-dirs -f -k -L -o "${2}" -S -s --user-agent "RiiConnect24 Patcher Unix ${ver}" --insecure https://patcher.rc24.xyz/update/RiiConnect24-Patcher/v1/${1}
}
# Get cetk file from SketchMaster2001's website
sketchgetcetk () {
sketchget ${1}/${2}/cetk Temp/Files/Patcher/${1}/${2}/cetk
}
# Patch IOS
patchios () {
mkdir -p Temp/Working/Wii/IOS${1}
./Sharpii nusd -ios ${1} -v ${2} -o Temp/Working/Wii/IOS${1}/Temp.wad -wad -q
./Sharpii wad -u Temp/Working/Wii/IOS${1}/Temp.wad Temp/Working/Wii/IOS${1} -q
xdelta3 -d -f -s Temp/Working/Wii/IOS${1}/00000006.app Temp/Files/Patcher/Wii/IOS${1}/00000006.delta Temp/Working/Wii/IOS${1}/00000006_patched.app
mv -f Temp/Working/Wii/IOS${1}/00000006_patched.app Temp/Working/Wii/IOS${1}/00000006.app
./Sharpii wad -p Temp/Working/Wii/IOS${1} "${out_path}/WAD/IOS${1} (RiiConnect24).wad" -f -q
./Sharpii ios "${out_path}/WAD/IOS${1} (RiiConnect24).wad" -fs -es -np -vp -q
}
# Patch title
patchtitle () {
mkdir -p Temp/Working/${1}
if [ -f Temp/Files/Patcher/${1}/${region}/cetk ]
then
cp Temp/Files/Patcher/${1}/${region}/cetk Temp/Working/${1}
fi
./Sharpii nusd -id ${2}${region_hex} -v ${3} -o Temp/Working/${1} -wad -q
./Sharpii wad -u Temp/Working/${1}/${2}${region_hex}v${3}.wad Temp/Working/${1} -q
xdelta3 -d -f -s Temp/Working/${1}/${4}.app Temp/Files/Patcher/${1}/${region}/${4}.delta Temp/Working/${1}/${4}_patched.app
mv -f Temp/Working/${1}/${4}_patched.app Temp/Working/${1}/${4}.app
./Sharpii wad -p Temp/Working/${1} "${out_path}/WAD/${5} (${region}) (RiiConnect24).wad" -f -q
}
# Patch title with two patch files
patchtitle2 () {
mkdir -p Temp/Working/${1}
if [ -f Temp/Files/Patcher/${1}/${region}/cetk ]
then
cp Temp/Files/Patcher/${1}/${region}/cetk Temp/Working/${1}
fi
./Sharpii nusd -id ${2}${region_hex} -v ${3} -o Temp/Working/${1} -wad -q
./Sharpii wad -u Temp/Working/${1}/${2}${region_hex}v${3}.wad Temp/Working/${1} -q
xdelta3 -d -f -s Temp/Working/${1}/${4}.app Temp/Files/Patcher/${1}/${region}/${4}.delta Temp/Working/${1}/${4}_patched.app
xdelta3 -d -f -s Temp/Working/${1}/${5}.app Temp/Files/Patcher/${1}/${region}/${5}.delta Temp/Working/${1}/${5}_patched.app
mv -f Temp/Working/${1}/${4}_patched.app Temp/Working/${1}/${4}.app
mv -f Temp/Working/${1}/${5}_patched.app Temp/Working/${1}/${5}.app
./Sharpii wad -p Temp/Working/${1} "${out_path}/WAD/${6} (${region}) (RiiConnect24).wad" -f -q
}
# Patch title with vWii attributes
patchtitlevwii () {
mkdir -p Temp/Working/${1}
./Sharpii nusd -id ${2}${region_hex} -v ${3} -o Temp/Working/${1} -wad -q
./Sharpii wad -u Temp/Working/${1}/${2}${region_hex}v${3}.wad Temp/Working/${1} -q
xdelta3 -d -f -s Temp/Working/${1}/${4}.app Temp/Files/Patcher/${1}/${4}.delta Temp/Working/${1}/${4}_patched.app
mv -f Temp/Working/${1}/${4}_patched.app Temp/Working/${1}/${4}.app
./Sharpii wad -p Temp/Working/${1} "${out_path}/WAD/${5} vWii ${region} (RiiConnect24).wad" -f -q
}
patchwiiware() {
while true
do
clear
title "Preparing to patch a WiiWare Game"
print "You will now be taken to the Wiimmfi WiiWare Patcher. Make sure the WAD is in the \"rc24-data\" directory.\n\n1. Start Patching\n2. Back\n\n"
input "Choose: " choice
case ${choice} in
1)
sketchget "Wiimmfi-stuff/wiiwarepatcher.sh" "wiiwarepatcher.sh"
chmod +x wiiwarepatcher.sh
./wiiwarepatcher.sh
break
;;
2)
break
;;
esac
done
}
patchgameprep() {
while true
do
clear
title "Preparing to Patch a Wii Game"
print "This section will patch any Wii Game that is not a WiiWare Game. Make sure the ISO/WBFS is in the \"rc24-data\" directory.\n\n1. Start Patching\n2. Back\n\n"
input "Choose: " choice
case ${choice} in
1)
clear
title "Download Wiimmfi Patcher"
printf "Loading..."
sketchget "Wiimmfi-stuff/patch-images.sh" "patch-images.sh"
sketchget "Wiimmfi-stuff/bin/setup.sh" "bin/setup.sh"
chmod +x patch-images.sh
chmod +x bin/setup.sh
./patch-images.sh
break
;;
2)
break
;;
esac
done
}
# Try to detect SD card by looking for "apps" directory in its root
detectsd () {
for i in ${mount}/*/
do
if [ -d "${i}/apps" ]
then
out_path="${i}"
fi
done
}
# Change the output path manually
changeoutpath () {
clear
title "Change Output Path"
print "Current output path: ${out_path}\n\n"
input "Type in the new path to store files (i.e. ${mount}/Wii): " out_path
}
# Choose device to patch (to do: remove "prepare" from Wii and vWii options after uninstall mode added)
device () {
while true
do
clear
title "Choose Device"
print "Welcome to the RiiConnect24 Patcher!\nWith this program, you can patch your Wii or Wii U for use with RiiConnect24.\n\nSo, what device are we patching today?\n\n1. Wii\n2. vWii (Wii U)\n3. Dolphin\n\n"
input "Choose an option: " choice
case ${choice} in
1)
device=wii
wii
break
;;
2)
device=vwii
vwii
break
;;
3)
device=dolphin
dolphin
break
;;
esac
done
}
# Credits
credits () {
clear
title "Credits"
print "Credits:\n - Sketch, HTV04, and TheShadowEevee: Developers\n - TheShadowEevee: Sharpii-NetCore\n - person66, and leathl: Original Sharpii and libWiiSharp developers\n - KcrPL and Larsenv: Original RiiConnect24 Patcher developers\n - And you!\n\nSource code: https://github.com/RiiConnect24/RiiConnect24-Patcher\n\nRiiConnect24 website: https://rc24.xyz/\n\nBy Wii fans, for Wii fans!\n\n"
anykey "return to the main menu"
}
vffdownloader () {
clear
title "VFF Downloader for Dolphin"
print "Now loading...\n\n"
if command -v crontab >/dev/null 2>&1
then
sketchget VFF-Downloader-for-Dolphin.sh VFF-Downloader-for-Dolphin.sh
chmod +x VFF-Downloader-for-Dolphin.sh
./VFF-Downloader-for-Dolphin.sh
else
print "\"crontab\" command not found! Please install the \"crontab\" package using your package manager.\n\n"
anykey "continue"
fi
}
# Refresh patcher screen (updates screen after patcher phase is completed)
refresh () {
clear
if [ ${device} = wii ]
then
title "Installing RiiConnect24 (Wii)"
elif [ ${device} = vwii ]
then
title "Installing RiiConnect24 (vWii)"
elif [ ${device} = dolphin ]
then
title "Installing RiiConnect24 (Dolphin Emulator)"
fi
print "Now patching. This may take a few minutes, depending on your internet speed.\n\n"
if [ ${patch[0]} = 1 ]
then
if [ ${patched[0]} = 1 ]
then
print "[X] System Patches\n"
else
print "[ ] System Patches\n"
fi
fi
if [ ${patch[1]} = 1 ]
then
if [ ${patched[1]} = 1 ]
then
print "[X] Forecast and News Channels\n"
else
print "[ ] Forecast and News Channels\n"
fi
fi
if [ ${patch[2]} = 1 ]
then
if [ ${patched[2]} = 1 ]
then
print "[X] Check Mii Out/Mii Contest Channel\n"
else
print "[ ] Check Mii Out/Mii Contest Channel\n"
fi
fi
if [ ${patch[3]} = 1 ]
then
if [ ${patched[3]} = 1 ]
then
print "[X] Everybody Votes Channel\n"
else
print "[ ] Everybody Votes Channel\n"
fi
fi
if [ ${patch[4]} = 1 ]
then
if [ ${patched[4]} = 1 ]
then
print "[X] Nintendo Channel\n"
else
print "[ ] Nintendo Channel\n"
fi
fi
subtitle "Fun Fact" "${fun_facts[${RANDOM} % ${#fun_facts[@]}]}"
}
# Patcher finish message
finish () {
clear
rm -rf Temp
title "Complete"
print "The RiiConnect24 Patcher has succesfully completed the requested operation.\n\nOutput has been saved to \"rc24output.txt,\" in case you need it.\n\n"
anykey "return to the main menu"
}
# Choose region
region () {
while true
do
clear
title "Choose Region"
print "What region is your device from?\n1. Europe (PAL)\n2. Japan (NTSC-J)\n3. USA (NTSC-U)\n\n"
input "Choose an option: " choice
case ${choice} in
1)
region=EUR
region_hex=50
break
;;
2)
region=JPN
region_hex=4a
break
;;
3)
region=USA
region_hex=45
break
;;
esac
done
}
# Custom patch options
custom () {
patch=(1 1 0 0 0)
apps=1
while true
do
clear
if [ ${device} = wii ]
then
title "Custom Install (Wii)"
elif [ ${device} = vwii ]
then
title "Custom Install (vWii)"
fi
print "The recommended options for a new RiiConnect24 install are toggled on by default.\n\n"
if [ ${patch[0]} = 1 ]
then
print "1. [X] System Patches (Required, only toggle off if already installed!)\n"
else
print "1. [ ] System Patches (Required, only toggle off if already installed!)\n"
fi
if [ ${patch[1]} = 1 ]
then
print "2. [X] Forecast and News Channels\n"
else
print "2. [ ] Forecast and News Channels\n"
fi
if [ ${patch[2]} = 1 ]
then
print "3. [X] Check Mii Out/Mii Contest Channel\n"
else
print "3. [ ] Check Mii Out/Mii Contest Channel\n"
fi
if [ ${patch[3]} = 1 ]
then
print "4. [X] Everybody Votes Channel\n"
else
print "4. [ ] Everybody Votes Channel\n"
fi
if [ ${patch[4]} = 1 ]
then
if [ ${region} != JPN ]
then
print "5. [X] Nintendo Channel\n\n"
else
print "5. [X] Nintendo Channel (Not working!)\n\n"
fi
else
if [ ${region} != JPN ]
then
print "5. [ ] Nintendo Channel\n\n"
else
print "5. [ ] Nintendo Channel (Not working!)\n\n"
fi
fi
if [ ${apps} = 1 ]
then
print "6. [X] Download Utilities (Required, only toggle off if already installed!)\n\n"
else
print "6. [ ] Download Utilities (Required, only toggle off if already installed!)\n\n"
fi
print "7. Continue\n\n"
print "Type the number of an option to toggle it: "
read -n 1 -r choice
case ${choice} in
1)
patch[0]=$((1 - ${patch[0]}))
;;
2)
patch[1]=$((1 - ${patch[1]}))
;;
3)
patch[2]=$((1 - ${patch[2]}))
;;
4)
patch[3]=$((1 - ${patch[3]}))
;;
5)
patch[4]=$((1 - ${patch[4]}))
;;
6)
apps=$((1 - ${apps}))
;;
7)
break
;;
esac
done
}
# Uninstall preparation
uninstallprep() {
while true
do
clear
title "Uninstall RiiConnect24 (Wii)"
subtitle "Warning" "If you are troubleshooting, uninstalling RiiConnect24 probably won't help fix your problem. Please contact the RiiConnect24 developers at [email protected] or join the RiiConnect24 Discord server."
print "This part of the patcher will help you uninstall RiiConnect24 from your Wii\nBy completing these steps you will lose access to:\n- News Channel\n- Forecast Channel\n- Wii Mail\n\nIf you have any other channels installed on your Wii, you will have to uninstall them manually.\nDo you want to procced with the guide?\n1. Yes\n2. No, go back\n\n"
input "Choose: " choice
case ${choice} in
1)
clear
title
print "Would you like to include a tutorial with how to delete your mwc24msg.cfg file?\n(This is a mail configuration file.)\n\n1. Yes\n2. No\n\n"
input "Choose: " choice_2
uninstall
break
;;
2)
break
;;
esac
done
}
# More uninstall preparation
uninstall () {
clear
title "Downloading Uninstaller Files (Wii)"
print "Please wait..."
mkdir -p "${out_path}/WAD"
./Sharpii nusd -ios 31 -v 3608 -o "${out_path}/WAD/IOS31.wad" -wad
./Sharpii nusd -ios 80 -v 6944 -o "${out_path}/WAD/IOS80.wad" -wad
rc24get apps/WiiXplorer/boot.dol "${out_path}/apps/WiiXplorer/boot.dol"
rc24get apps/WiiXplorer/icon.png "${out_path}/apps/WiiXplorer/icon.png"
rc24get apps/WiiXplorer/meta.xml "${out_path}/apps/WiiXplorer/meta.xml"
rc24get apps/WiiModLite/boot.dol "${out_path}/apps/WiiModLite/boot.dol"
rc24get apps/WiiModLite/icon.png "${out_path}/apps/WiiModLite/icon.png"
rc24get apps/WiiModLite/meta.xml "${out_path}/apps/WiiModLite/meta.xml"
uninstallinstuct1
}
# Uninstall instruction 1
uninstallinstuct1 () {
while true
do
clear
title "Uninstall Instructions (Wii)"
print "Part 1 - Reinstalling stock IOS 31 and IOS 80\n\n1. Please open the Homebrew Channel and start Wii Mod Lite\n2. Using the D-Pad on your Wii Remote, navigate to WAD Manager and then navigate to the WAD Folder\n3. When IOS31.wad is highlighted, press +. Do the same for IOS 80 then press the A button\n4. When you are done, press the HOME Button to go back to Homebrew Channel.\n\n"
anykey "continue"
uninstallinstuct2
break
done
}
# Uninstall instruction 2
uninstallinstuct2 () {
while true
do
clear
title "Uninstall Instructions"
print "Part 2 - Disconnecting from RiiConnect24\n\n1. Go to Wii Options\n2. Go to Wii Settings\n3. Go to Page 2, then click on Internet\n4. Go to Connection Settings\n5. Select your current connection\n6. Go to Change Settings\n7. Go to Auto-Obtain-DNS (not IP Address), then select Yes\n8. Select Save and do the connection test\nWhen asking to update, press No to skip it.\n\n"
anykey "continue"
if [ ${choice_2} == 1 ]
then
uninstallinstuct3
else
uninstallfinish
fi
break
done
}
# Uninstall instruction 3
uninstallinstuct3 () {
while true
do
clear
title "Uninstall Instructions"
print "Part 3 - Restoring the nwc24msg.cfg to its factory defaults\n\n1. Launch WiiXplorer from the Homebrew Channel\n2. In WiiXplorer, press Start - Settings - Boot Settings. Turn NAND Write Access on.\n3. Change your device to NAND (the bar on the top)\n4. Go to shared2 - wc24\n5. Hover your cursor over the nwc24msg.cfg then press + on your Wii Remote and delete it.\n\n"
anykey "continue"
uninstallfinish
break
done
}
# Uninstall finish
uninstallfinish() {
clear
title "Uninstall Finished"
print "That's it! RiiConnect24 should now be removed from your Wii!\n\nWe hope you have enjoyed your time with us, and that you will come back soon :)\n\n"
anykey "return to the main menu"
}
# Choose Wii patcher mode
wii () {
while true
do
clear
title "Patcher Mode (Wii)"
print "1. Install RiiConnect24 on your Wii\n - The patcher will guide you through process of installing RiiConnect24.\n\n2. Uninstall RiiConnect24 from your Wii\n - This will help you uninstall RiiConnect24 from your Wii.\n\n3. Patch WiiWare games for use with Wiimmfi\n -This patches WiiWare games so you can play them online\n\n4. Patch Wii ISO/WBFS\n -Use this to patch any game for use online, even Mario Kart Wii\n\n"
input "Choose an option: " choice
case ${choice} in
1)
wiiprepare
break
;;
2)
uninstallprep
break
;;
3)
patchwiiware
;;
4)
patchgameprep
;;
esac
done
}
# Prepare Wii patch
wiiprepare () {
while true
do
clear
title "Preparing to Install RiiConnect24 (Wii)"
print "Choose instalation type:\n1. Express (Recommended)\n - This will patch every channel for later use on your Wii. This includes:\n - Check Mii Out Channel/Mii Contest Channel\n - Everybody Votes Channel\n - Forecast Channel\n - News Channel\n - Nintendo Channel\n - Wii Mail\n\n2. Custom\n - You will be asked what you want to patch.\n\n3. Back\n\n"
input "Choose an option: " choice
case ${choice} in
1)
region
if [ ${region} != "JPN" ]
then
patch=(1 1 1 1 1)
else
patch=(1 1 1 1 0)
fi
apps=1
wiipatch
finish
break
;;
2)
region
custom
wiipatch
finish
break
;;
3)
break
;;
esac
done
}
# Wii patching process
wiipatch () {
patched=(0 0 0 0 0 0)
refresh
mkdir -p "${out_path}/WAD"
mkdir -p "${out_path}/apps"
if [ ${patch[0]} = 1 ]
then
rc24get IOSPatcher/00000006-31.delta Temp/Files/Patcher/Wii/IOS31/00000006.delta
rc24get IOSPatcher/00000006-80.delta Temp/Files/Patcher/Wii/IOS80/00000006.delta
patchios 31 3608
patchios 80 6944
patched[0]=1
refresh
fi
if [ ${patch[1]} = 1 ]
then
if [ ${region} = EUR ]
then
rc24get NewsChannelPatcher/URL_Patches/Europe/00000001_Forecast.delta Temp/Files/Patcher/Wii/FC/${region}/00000001.delta
rc24get NewsChannelPatcher/URL_Patches/Europe/00000001_News.delta Temp/Files/Patcher/Wii/NC/${region}/00000001.delta
elif [ ${region} = JPN ]
then
rc24get NewsChannelPatcher/URL_Patches/Japan/00000001_Forecast.delta Temp/Files/Patcher/Wii/FC/${region}/00000001.delta
rc24get NewsChannelPatcher/URL_Patches/Japan/00000001_News.delta Temp/Files/Patcher/Wii/NC/${region}/00000001.delta
elif [ ${region} = USA ]
then
rc24get NewsChannelPatcher/URL_Patches/USA/00000001_Forecast.delta Temp/Files/Patcher/Wii/FC/${region}/00000001.delta
rc24get NewsChannelPatcher/URL_Patches/USA/00000001_News.delta Temp/Files/Patcher/Wii/NC/${region}/00000001.delta
fi
patchtitle Wii/FC 00010002484146 7 00000001 "Forecast Channel"
patchtitle Wii/NC 00010002484147 7 00000001 "News Channel"
patched[1]=1
refresh
fi
if [ ${patch[2]} = 1 ]
then
if [ ${region} = EUR ]
then
sketchgetcetk CMOC EUR
rc24get CMOCPatcher/patch/00000001_Europe.delta Temp/Files/Patcher/CMOC/EUR/00000001.delta
rc24get CMOCPatcher/patch/00000004_Europe.delta Temp/Files/Patcher/CMOC/EUR/00000004.delta
elif [ ${region} = JPN ]
then
rc24get CMOCPatcher/patch/00000001_Japan.delta Temp/Files/Patcher/CMOC/JPN/00000001.delta
rc24get CMOCPatcher/patch/00000004_Japan.delta Temp/Files/Patcher/CMOC/JPN/00000004.delta
elif [ ${region} = USA ]
then
sketchgetcetk CMOC USA
rc24get CMOCPatcher/patch/00000001_USA.delta Temp/Files/Patcher/CMOC/USA/00000001.delta
rc24get CMOCPatcher/patch/00000004_USA.delta Temp/Files/Patcher/CMOC/USA/00000004.delta
fi
if [ ${region} = EUR ]
then
patchtitle2 CMOC 00010001484150 512 00000001 00000004 "Mii Contest Channel"
else
patchtitle2 CMOC 00010001484150 512 00000001 00000004 "Check Mii Out Channel"
fi
patched[2]=1
refresh
fi
if [ ${patch[3]} = 1 ]
then
if [ ${region} = EUR ]
then
sketchgetcetk EVC EUR
rc24get EVCPatcher/patch/Europe.delta Temp/Files/Patcher/EVC/EUR/00000001.delta
elif [ ${region} = JPN ]
then
rc24get EVCPatcher/patch/JPN.delta Temp/Files/Patcher/EVC/JPN/00000001.delta
elif [ ${region} = USA ]
then
sketchgetcetk EVC USA
rc24get EVCPatcher/patch/USA.delta Temp/Files/Patcher/EVC/USA/00000001.delta
fi
patchtitle EVC 0001000148414a 512 00000001 "Everybody Votes Channel"
patched[3]=1
refresh
fi
if [ ${patch[4]} = 1 ]
then
if [ ${region} = EUR ]
then
sketchgetcetk NC EUR
rc24get NCPatcher/patch/Europe.delta Temp/Files/Patcher/NC/EUR/00000001.delta
elif [ ${region} = JPN ]
then
rc24get NCPatcher/patch/JPN.delta Temp/Files/Patcher/NC/JPN/00000001.delta
elif [ ${region} = USA ]
then
sketchgetcetk NC USA
rc24get NCPatcher/patch/USA.delta Temp/Files/Patcher/NC/USA/00000001.delta
fi
patchtitle NC 00010001484154 1792 00000001 "Nintendo Channel"
patched[4]=1
refresh
fi
if [ ${apps} = 1 ]
then
rc24get apps/Mail-Patcher/boot.dol "${out_path}/apps/Mail-Patcher/boot.dol"
rc24get apps/Mail-Patcher/icon.png "${out_path}/apps/Mail-Patcher/icon.png"
rc24get apps/Mail-Patcher/meta.xml "${out_path}/apps/Mail-Patcher/meta.xml"
rc24get apps/WiiModLite/boot.dol "${out_path}/apps/WiiModLite/boot.dol"
rc24get apps/WiiModLite/icon.png "${out_path}/apps/WiiModLite/icon.png"
rc24get apps/WiiModLite/meta.xml "${out_path}/apps/WiiModLite/meta.xml"
fi
rm -rf Files
}
# Choose vWii patcher mode (currently unused)
vwii () {
while true
do
clear
title "Patcher Mode (vWii)"
print "1. Install RiiConnect24 on your vWii\n - The patcher will guide you through process of installing RiiConnect24.\n\n2. Patch WiiWare games for use with Wiimmfi\n -This patches WiiWare games so you can play them online\n\n3. Patch Wii ISO/WBFS\n -Use this to patch any game for use online, even Mario Kart Wii\n\n"
input "Choose an option: " choice
case ${choice} in
1)
vwiiprepare
break
;;
2)
patchwiiware
;;
3)
patchgameprep
;;
esac
done
}
# Prepare vWii patch
vwiiprepare () {
while true
do
clear
title "Preparing to Install RiiConnect24 (vWii)"
print "Choose instalation type:\n1. Express (Recommended)\n - This will patch every channel for later use on your vWii. This includes:\n - Check Mii Out Channel/Mii Contest Channel\n - Everybody Votes Channel\n - Forecast Channel\n - News Channel\n - Nintendo Channel\n\n2. Custom\n - You will be asked what you want to patch.\n\n3. Back\n\n"
input "Choose an option: " choice
case ${choice} in
1)
region
if [ ${region} != "JPN" ]
then
patch=(1 1 1 1 1)
else
patch=(1 1 1 1 0)
fi
apps=1
vwiipatch
finish
break
;;
2)
region
custom
vwiipatch
finish
break
;;
3)
break
;;
esac
done
}
# vWii patching process
vwiipatch () {
patched=(0 0 0 0 0 0)
refresh
mkdir -p "${out_path}/WAD"
mkdir -p "${out_path}/apps"
if [ ${patch[0]} = 1 ]
then
rc24get IOSPatcher/IOS31_vwii.wad "${out_path}/WAD/IOS31_vWii_Only (RiiConnect24).wad"
patched[0]=1
refresh
fi
if [ ${patch[1]} = 1 ]
then
rc24get NewsChannelPatcher/00000001.delta Temp/Files/Patcher/vWii/NC/00000001.delta
rc24get NewsChannelPatcher/URL_Patches_WiiU/00000001_Forecast_All.delta Temp/Files/Patcher/vWii/FC/00000001.delta
patchtitlevwii vWii/FC 00010002484146 7 00000001 "Forecast Channel"
patchtitlevwii vWii/NC 00010002484147 7 00000001 "News Channel"
patched[1]=1
refresh
fi
if [ ${patch[2]} = 1 ]
then
if [ ${region} = EUR ]
then
sketchgetcetk CMOC EUR
rc24get CMOCPatcher/patch/00000001_Europe.delta Temp/Files/Patcher/CMOC/EUR/00000001.delta
rc24get CMOCPatcher/patch/00000004_Europe.delta Temp/Files/Patcher/CMOC/EUR/00000004.delta
elif [ ${region} = JPN ]
then
rc24get CMOCPatcher/patch/00000001_Japan.delta Temp/Files/Patcher/CMOC/JPN/00000001.delta
rc24get CMOCPatcher/patch/00000004_Japan.delta Temp/Files/Patcher/CMOC/JPN/00000004.delta
elif [ ${region} = USA ]
then
sketchgetcetk CMOC USA
rc24get CMOCPatcher/patch/00000001_USA.delta Temp/Files/Patcher/CMOC/USA/00000001.delta
rc24get CMOCPatcher/patch/00000004_USA.delta Temp/Files/Patcher/CMOC/USA/00000004.delta
fi
if [ ${region} = EUR ]
then
patchtitle2 CMOC 00010001484150 512 00000001 00000004 "Mii Contest Channel"
else
patchtitle2 CMOC 00010001484150 512 00000001 00000004 "Check Mii Out Channel"
fi
patched[2]=1
refresh
fi
if [ ${patch[3]} = 1 ]
then
if [ ${region} = EUR ]
then
sketchgetcetk EVC EUR
rc24get EVCPatcher/patch/Europe.delta Temp/Files/Patcher/EVC/EUR/00000001.delta
elif [ ${region} = JPN ]
then
rc24get EVCPatcher/patch/JPN.delta Temp/Files/Patcher/EVC/JPN/00000001.delta
elif [ ${region} = USA ]
then
sketchgetcetk EVC USA
rc24get EVCPatcher/patch/USA.delta Temp/Files/Patcher/EVC/USA/00000001.delta
fi
patchtitle EVC 0001000148414a 512 00000001 "Everybody Votes Channel"
patched[3]=1
refresh
fi
if [ ${patch[4]} = 1 ]
then
if [ ${region} = EUR ]
then
sketchgetcetk NC EUR
rc24get NCPatcher/patch/Europe.delta Temp/Files/Patcher/NC/EUR/00000001.delta
elif [ ${region} = JPN ]
then
rc24get NCPatcher/patch/JPN.delta Temp/Files/Patcher/NC/JPN/00000001.delta
elif [ ${region} = USA ]
then
sketchgetcetk NC USA
rc24get NCPatcher/patch/USA.delta Temp/Files/Patcher/NC/USA/00000001.delta
fi
patchtitle NC 00010001484154 1792 00000001 "Nintendo Channel"
patched[4]=1
refresh
fi
if [ ${apps} = 1 ]
then
rc24get apps/ConnectMii_WAD/ConnectMii.wad "${out_path}/WAD/ConnectMii.wad"
rc24get apps/ww-43db-patcher/boot.dol "${out_path}/apps/ww-43db-patcher/boot.dol"
rc24get apps/ww-43db-patcher/icon.png "${out_path}/apps/ww-43db-patcher/icon.png"
rc24get apps/ww-43db-patcher/meta.xml "${out_path}/apps/ww-43db-patcher/meta.xml"
rc24get apps/WiiModLite/boot.dol "${out_path}/apps/WiiModLite/boot.dol"
rc24get apps/WiiModLite/icon.png "${out_path}/apps/WiiModLite/icon.png"
rc24get apps/WiiModLite/meta.xml "${out_path}/apps/WiiModLite/meta.xml"
fi
rm -rf Files
}
dolphin () {
while true
do
clear
title "Patcher Mode (Dolphin Emulator)"
print "1. Install RiiConnect24 on Dolphin Emulator\n - The patcher will guide you through process of installing RiiConnect24.\n\n2. Patch WiiWare games for use with Wiimmfi\n -This patches WiiWare games so you can play them online\n\n3. Patch Wii ISO/WBFS\n -Use this to patch any game for use online, even Mario Kart Wii\n\n"