This repository has been archived by the owner on Jul 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CitraDumper.gm9
186 lines (152 loc) · 8.14 KB
/
CitraDumper.gm9
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
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm"
set CITRA_PATH "$[GM9OUT]/citra/nand/00000000000000000000000000000000/title"
set CITRA_DATA_PATH "$[GM9OUT]/citra/nand/data/00000000000000000000000000000000/sysdata"
@start
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm"
set DUMPING_ALL "false"
labelsel -o -s "Choose an option." menu_*
goto start
@menu_Dump_System_Archives
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping system archives..."
# There is no need to check for model or region here, since these values are the same across both.
# set NG_TID_LOW "00010302"
set MII_DATA_TID_LOW "00010202"
# set REGION_TID_LOW "00010402"
set CLCERTA_TID_LOW "00010002"
# set NG_OUT_TMD "$[CITRA_PATH]/000400db/00010302/content/00000003.tmd"
# set NG_OUT_APP "$[CITRA_PATH]/000400db/00010302/content/0000000c.app"
set MII_DATA_OUT_TMD "$[CITRA_PATH]/0004009b/$[MII_DATA_TID_LOW]/content/00000000.tmd"
set MII_DATA_OUT_APP "$[CITRA_PATH]/0004009b/$[MII_DATA_TID_LOW]/content/00000000.app"
# set REGION_OUT_TMD "$[CITRA_PATH]/0004009b/$[REGION_TID_LOW]/content/00000002.tmd"
# set REGION_OUT_APP "$[CITRA_PATH]/0004009b/$[REGION_TID_LOW]/content/00000009.app"
set CLCERTA_OUT_TMD "$[CITRA_PATH]/0004001b/$[CLCERTA_TID_LOW]/content/00000000.tmd"
set CLCERTA_OUT_APP "$[CITRA_PATH]/0004001b/$[CLCERTA_TID_LOW]/content/00000000.app"
# Citra's HLE bad word list is better than the 3DS's, but keep the code here just in case.
# set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping system archives...\n[NG bad word list]"
# cp -w "1:/title/000400db/00010302/content/00000003.tmd" $[NG_OUT_TMD]
# cp -w "1:/title/000400db/00010302/content/0000000c.app" $[NG_OUT_APP]
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping system archives...\n[Mii data]"
cp -w "1:/title/0004009b/$[MII_DATA_TID_LOW]/content/00000000.tmd" $[MII_DATA_OUT_TMD]
cp -w "1:/title/0004009b/$[MII_DATA_TID_LOW]/content/00000000.app" $[MII_DATA_OUT_APP]
# Citra's HLE region manifest is 100% identical to the 3DS's, but keep the code here just in case.
# set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping system archives...\n[Region manifest]"
# cp -w "1:/title/0004009b/$[REGION_TID_LOW]/content/00000002.tmd" $[REGION_OUT_TMD]
# cp -w "1:/title/0004009b/$[REGION_TID_LOW]/content/00000009.app" $[REGION_OUT_APP]
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping system archives...\n[ClCertA]"
cp -w "1:/title/0004001b/$[CLCERTA_TID_LOW]/content/00000000.tmd" $[CLCERTA_OUT_TMD]
cp -w "1:/title/0004001b/$[CLCERTA_TID_LOW]/content/00000000.app" $[CLCERTA_OUT_APP]
if chk $[DUMPING_ALL] "true"
goto menu_Dump_Applets
else
echo "System archives dumped successfully"
goto start
end
@menu_Dump_Applets
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping system applets..."
if chk $[REGION] "USA"
set SWKBD_TID_LOW "0000c802"
set ERRDISP_TID_LOW "0000c502"
set MII_SELECTOR_TID_LOW "0000c902"
elif chk $[REGION] "JPN"
set SWKBD_TID_LOW "0000c002"
set ERRDISP_TID_LOW "0000c502"
set MII_SELECTOR_TID_LOW "0000c102"
elif chk $[REGION] "EUR"
set SWKBD_TID_LOW "0000d002"
set ERRDISP_TID_LOW "0000c502"
set MII_SELECTOR_TID_LOW "0000d102"
elif chk $[REGION] "CHN"
set SWKBD_TID_LOW "0000d802"
set ERRDISP_TID_LOW "0000cf02"
set MII_SELECTOR_TID_LOW "0000d902"
elif chk $[REGION] "KOR"
set SWKBD_TID_LOW "0000de02"
set ERRDISP_TID_LOW "0000cf02"
set MII_SELECTOR_TID_LOW "0000df02"
elif chk $[REGION] "TWN"
set SWKBD_TID_LOW "0000e402"
set ERRDISP_TID_LOW "0000cf02"
set MII_SELECTOR_TID_LOW "0000e502"
else
echo "Unknown region. Aborting..."
goto start
end
set SWKBD_OUT_TMD "$[CITRA_PATH]/00040030/$[SWKBD_TID_LOW]/content/00000002.tmd"
set SWKBD_OUT_APP "$[CITRA_PATH]/00040030/$[SWKBD_TID_LOW]/content/0000000b.app"
set ERRDISP_OUT_TMD "$[CITRA_PATH]/00040030/$[ERRDISP_TID_LOW]/content/00000002.tmd"
set ERRDISP_OUT_APP "$[CITRA_PATH]/00040030/$[ERRDISP_TID_LOW]/content/0000001c.app"
set MII_SELECTOR_OUT_TMD "$[CITRA_PATH]/00040030/$[MII_SELECTOR_TID_LOW]/content/00000001.tmd"
set MII_SELECTOR_OUT_APP "$[CITRA_PATH]/00040030/$[MII_SELECTOR_TID_LOW]/content/0000000a.app"
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping system applets...\n[Software keyboard]"
cp -w "1:/title/00040030/$[SWKBD_TID_LOW]/content/00000002.tmd" $[SWKBD_OUT_TMD]
cp -w "1:/title/00040030/$[SWKBD_TID_LOW]/content/0000000b.app" $[SWKBD_OUT_APP]
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping system applets...\n[Error display]"
cp -w "1:/title/00040030/$[ERRDISP_TID_LOW]/content/00000002.tmd" $[ERRDISP_OUT_TMD]
cp -w "1:/title/00040030/$[ERRDISP_TID_LOW]/content/0000001c.app" $[ERRDISP_OUT_APP]
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping system applets...\n[Mii selector]"
cp -w "1:/title/00040030/$[MII_SELECTOR_TID_LOW]/content/00000001.tmd" $[MII_SELECTOR_OUT_TMD]
cp -w "1:/title/00040030/$[MII_SELECTOR_TID_LOW]/content/0000000a.app" $[MII_SELECTOR_OUT_APP]
if chk $[DUMPING_ALL] "true"
goto menu_Dump_Shared_Fonts
else
echo "System applets dumped successfully"
goto start
end
@menu_Dump_Shared_Fonts
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping shared fonts..."
# There is no need to check for model or region here, since these values are the same across both.
set USA_TID_LOW "00014002"
set CHN_TID_LOW "00014102"
set KOR_TID_LOW "00014202"
set TWN_TID_LOW "00014302"
set USA_OUT_TMD "$[CITRA_PATH]/0004009b/$[USA_TID_LOW]/content/00000000.tmd"
set USA_OUT_APP "$[CITRA_PATH]/0004009b/$[USA_TID_LOW]/content/00000000.app"
set CHN_OUT_TMD "$[CITRA_PATH]/0004009b/$[CHN_TID_LOW]/content/00000000.tmd"
set CHN_OUT_APP "$[CITRA_PATH]/0004009b/$[CHN_TID_LOW]/content/00000001.app"
set KOR_OUT_TMD "$[CITRA_PATH]/0004009b/$[KOR_TID_LOW]/content/00000000.tmd"
set KOR_OUT_APP "$[CITRA_PATH]/0004009b/$[KOR_TID_LOW]/content/00000001.app"
set TWN_OUT_TMD "$[CITRA_PATH]/0004009b/$[TWN_TID_LOW]/content/00000000.tmd"
set TWN_OUT_APP "$[CITRA_PATH]/0004009b/$[TWN_TID_LOW]/content/00000001.app"
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping shared fonts...\n[JPN / EUR / USA]"
cp -w "1:/title/0004009b/$[USA_TID_LOW]/content/00000000.tmd" $[USA_OUT_TMD]
cp -w "1:/title/0004009b/$[USA_TID_LOW]/content/00000000.app" $[USA_OUT_APP]
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping shared fonts...\n[CHN]"
cp -w "1:/title/0004009b/$[CHN_TID_LOW]/content/00000000.tmd" $[CHN_OUT_TMD]
cp -w "1:/title/0004009b/$[CHN_TID_LOW]/content/00000001.app" $[CHN_OUT_APP]
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping shared fonts...\n[KOR]"
cp -w "1:/title/0004009b/$[KOR_TID_LOW]/content/00000000.tmd" $[KOR_OUT_TMD]
cp -w "1:/title/0004009b/$[KOR_TID_LOW]/content/00000001.app" $[KOR_OUT_APP]
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping shared fonts...\n[TWN]"
cp -w "1:/title/0004009b/$[TWN_TID_LOW]/content/00000000.tmd" $[TWN_OUT_TMD]
cp -w "1:/title/0004009b/$[TWN_TID_LOW]/content/00000001.app" $[TWN_OUT_APP]
if chk $[DUMPING_ALL] "true"
goto menu_Dump_Config
else
echo "Shared fonts dumped successfully"
goto start
end
@menu_Dump_Config
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping config savegame..."
set CONFIG_OUT "$[CITRA_DATA_PATH]/00010017/00000000/config"
mkdir -o -s "$[CITRA_DATA_PATH]/00010017/00000000/"
inject 1:/data/$[SYSID0]/sysdata/00010017/00000000@6000:8000 $[CONFIG_OUT]@0
if chk $[DUMPING_ALL] "true"
goto menu_Dump_ARM9_bootrom
else
echo "Config dumped successfully"
goto start
end
@menu_Dump_ARM9_bootrom
set PREVIEW_MODE "CitraDumper - Archive dumper for Citra\nby tgsm\n \nDumping ARM9 bootrom..."
set CITRA_SYSDATA_PATH "$[GM9OUT]/citra/sysdata/"
cp -w "M:/boot9.bin" "$[CITRA_SYSDATA_PATH]/boot9.bin"
if chk $[DUMPING_ALL] "true"
echo "Everything dumped successfully"
else
echo "ARM9 bootrom dumped successfully"
end
goto start
@menu_Dump_all_of_the_above
set DUMPING_ALL "true"
goto menu_Dump_System_Archives
@menu_Exit