Project

General

Profile

GTI9300PARAM » History » Version 16

Denis 'GNUtoo' Carikli, 01/31/2022 08:58 PM
Add size

1 6 Denis 'GNUtoo' Carikli
{{toc}}
2
3 1 Denis 'GNUtoo' Carikli
h1. GTI9300PARAM
4
5 12 Denis 'GNUtoo' Carikli
h2. Structure
6
7 14 Denis 'GNUtoo' Carikli
| Start (included) | End (included) | Content                                                  |
8
| 0x000000         | 0x0de800 - 1   | [[GTI9300PARAM#Tarball|Tarball]]                         |
9
| around 0x000228  | ?              | [[GTI9300PARAM#Kernel command line|Kernel command line]] |
10
| 0x700204         | 0x700204       | [[GTI9300PARAM#USB switch|USB switch]]
11
                                      @0x00@: MODEM USB routed to the USB connector
12
                                      @0x01@: SOC USB routed to the USB connector              |
13
| 0x700208         | 0x700208       | [[GTI9300PARAM#Modem debug level|Modem debug level]]
14
                                      @LO@: Modem debug level set to @LOW@
15
                                      @MI@: Modem debug level set to @MEDIUM@
16
                                      @HI@: Modem debug level set to @HIGH@                    |
17 16 Denis 'GNUtoo' Carikli
| 0x7FFC00         | 0x7FFC0F       | [[GTI9300PARAM#Modem debug level|checksum]]              |
18
19
Size of the partition: 0x800000
20 12 Denis 'GNUtoo' Carikli
21 11 Denis 'GNUtoo' Carikli
h2. Tarball
22
23 1 Denis 'GNUtoo' Carikli
You can dump the PARAM partition for the Galaxy SIII (GT-I9300) like that:
24
<pre>
25
adb pull /dev/block/platform/dw_mmc/by-name/PARAM PARAM.img
26
</pre>
27
28
That file at first looks like a tar archive.
29
<pre>
30
$ file PARAM.img
31
PARAM.img: POSIX tar archive (GNU)
32
</pre>
33
34
And it indeed does contain a tarball:
35
<pre>
36
$ tar tvf PARAM.img
37
-rw-r--r-- se.infra/se.infra 3624 2013-11-28 13:33 adv-env.img
38
-rw-r--r-- se.infra/se.infra 42023 2013-11-28 13:33 ani_upload_1_kernel_panic.jpg
39
-rw-r--r-- se.infra/se.infra 39255 2013-11-28 13:33 ani_upload_2_cp_crash.jpg
40
-rw-r--r-- se.infra/se.infra 47443 2013-11-28 13:33 ani_upload_3_forced_upload.jpg
41
-rw-r--r-- se.infra/se.infra 10810 2013-11-28 13:33 ani_upload_4_hardware_reset.jpg
42
-rw-r--r-- se.infra/se.infra 11586 2013-11-28 13:33 ani_upload_4_smpl.jpg
43
-rw-r--r-- se.infra/se.infra 54151 2013-11-28 13:33 ani_upload_4_unknown_reset.jpg
44
-rw-r--r-- se.infra/se.infra 11495 2013-11-28 13:33 ani_upload_4_watchdog_reset.jpg
45
-rw-r--r-- se.infra/se.infra 12276 2013-11-28 13:33 ani_upload_4_wtsr.jpg
46
-rw-r--r-- se.infra/se.infra  9703 2013-11-28 13:33 ani_upload_4_wtsr_smpl.jpg
47
-rw-r--r-- se.infra/se.infra 12711 2013-11-28 13:33 ani_upload_5_user_fault.jpg
48
-rw-r--r-- se.infra/se.infra 19098 2013-11-28 13:33 ani_upload_6_hsic_disconnected.jpg
49
-rw-r--r-- se.infra/se.infra 84123 2013-11-28 13:33 download_error.jpg
50
-rw-r--r-- se.infra/se.infra 73061 2013-11-28 13:33 download.jpg
51
-rw-r--r-- se.infra/se.infra 64410 2013-11-28 13:33 logo.jpg
52
-rw-r--r-- se.infra/se.infra 37205 2013-11-28 13:33 lpm.jpg
53
-rw-r--r-- se.infra/se.infra 36572 2013-11-28 13:33 lpm_wireless.jpg
54
-rw-r--r-- se.infra/se.infra 91511 2013-11-28 13:33 secure_error.jpg
55
-rwxr-xr-x se.infra/se.infra  5851 2013-11-28 13:33 sud_0.jpg
56
-rwxr-xr-x se.infra/se.infra  2713 2013-11-28 13:33 sud_1.jpg
57
-rwxr-xr-x se.infra/se.infra  5634 2013-11-28 13:33 sud_2.jpg
58
-rwxr-xr-x se.infra/se.infra  6292 2013-11-28 13:33 sud_3.jpg
59
-rwxr-xr-x se.infra/se.infra  4604 2013-11-28 13:33 sud_4.jpg
60
-rwxr-xr-x se.infra/se.infra  5706 2013-11-28 13:33 sud_5.jpg
61
-rwxr-xr-x se.infra/se.infra  6792 2013-11-28 13:33 sud_6.jpg
62
-rwxr-xr-x se.infra/se.infra  3885 2013-11-28 13:33 sud_7.jpg
63
-rwxr-xr-x se.infra/se.infra  6826 2013-11-28 13:33 sud_8.jpg
64
-rwxr-xr-x se.infra/se.infra  6528 2013-11-28 13:33 sud_9.jpg
65
-rw-r--r-- se.infra/se.infra 168616 2013-11-28 13:33 warning.jpg
66
</pre>
67
68
The size of the PARAM.img file is exactly 8MiB:
69
<pre>
70 8 Denis 'GNUtoo' Carikli
$ ls -lah PARAM.img
71 1 Denis 'GNUtoo' Carikli
[...] 8.0M [...] PARAM.img
72 8 Denis 'GNUtoo' Carikli
$ ls -la PARAM.img
73 1 Denis 'GNUtoo' Carikli
[...] 8388608 [...] PARAM.img
74
</pre>
75
76
And we can get the size of the tarball with --totals:
77
<pre>
78
$ man tar
79
  [...]
80
  --totals[=SIGNAL]
81
         Print  total bytes after processing the archive. [...]
82
</pre>
83
84
For example:
85
<pre>
86 8 Denis 'GNUtoo' Carikli
$ tar --totals -tf PARAM.img
87 1 Denis 'GNUtoo' Carikli
adv-env.img
88
[many files]
89
warning.jpg
90
Total bytes read: 911360 (890KiB, 286MiB/s)
91
</pre>
92
93 7 Denis 'GNUtoo' Carikli
So here the tarball terminates way before the end of the PARAM.img file.
94 1 Denis 'GNUtoo' Carikli
95
911360 is 0xde800:
96
<pre>
97
$ python
98
[...]
99
>>> hex(911360)
100
'0xde800'
101
</pre>
102
103
But we still have things after the tarball:
104
<pre>
105
$ hexdump -C PARAM.img
106
000dd4a0  05 00 14 00 50 07 ff d9  00 00 00 00 00 00 00 00  |....P...........|
107
000dd4b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
108
*
109
00700000  03 00 fe ca 00 01 00 00  00 00 00 00 00 00 00 00  |................|
110
00700010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
111
*
112
00700200  00 00 00 00 03 00 00 00  4c 4f 00 00 00 00 00 00  |........LO......|
113
00700210  00 00 00 00 03 00 00 00  01 00 00 00 00 00 00 00  |................|
114
00700220  00 00 00 00 00 00 00 00  63 6f 6e 73 6f 6c 65 3d  |........console=|
115
00700230  72 61 6d 20 6c 6f 67 6c  65 76 65 6c 3d 34 00 00  |ram loglevel=4..|
116
00700240  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
117
*
118
00700e20  00 00 00 00 00 00 00 00  ff ff ff ff ff ef 7f ff  |................|
119
00700e30  ff ff f7 ff ff ff f7 ff  ff fe ff ff ff ff 7f ff  |................|
120
00700e40  fb ef ff ff ff fb ff df  ff ff ff ff ff ff ff ff  |................|
121
00700e50  df bf ff ff 7f ef f7 ff  f7 ff ff ff ff fe ff ff  |................|
122
00700e60  ff ff ff ff ef fb ff ef  ff fb ff ff fd ff f7 ef  |................|
123
00700e70  ff ff ff ff f5 ff ff ff  ff ff ff ff ff ff ff ff  |................|
124
00700e80  ff ff ff fe ff ef ff ff  ff bf fd ff ff ff ff ff  |................|
125
00700e90  ff ff ff ff ff ff f7 fb  ff ff ff eb ff ff ff eb  |................|
126
00700ea0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff fb  |................|
127
00700eb0  ff ff ff ff ff ff ff ff  ff ff ff df ff ff ff ff  |................|
128
00700ec0  ff ff ff ff ff ff f7 ff  ff ff ff ff ff ff ff ff  |................|
129
00700ed0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff fb  |................|
130
00700ee0  df ff ff ff ff ff ff ff  ff ff ff ff ff ff d7 ff  |................|
131
00700ef0  ff ff ff af ff ff ff fe  ff ff ff ff ff ff ff ff  |................|
132
00700f00  ff ef ff ff ff 7f ff ff  ff df ff ff f7 ff ff ff  |................|
133
00700f10  ff ff ff ff ff ff ff ff  ff ff ff ef ff ff f7 ff  |................|
134
00700f20  ff ff ff ff ff ff ff ff  ff fe ef ff ff ef fb df  |................|
135
00700f30  ff ff ff ff ff fb ff ff  ff ff ff ff ff ff ff ff  |................|
136
00700f40  ff ff f5 ff ff ff ff fb  ff ff ff ff ff ff ff ff  |................|
137
00700f50  fb ff ff fb fd ff ff ff  ff ff ff ff ff ff ff ff  |................|
138
00700f60  f7 ff ff ef f7 ff ff ef  ff ff ff ff ff 9e ff fd  |................|
139
00700f70  ff ff ff ff fb ff ff de  f3 fb ff ff ff ef df ff  |................|
140
00700f80  ff ff ff ff ff fb ff bf  ff ff ff ff ff ff ff fd  |................|
141
00700f90  ff fe f7 fe ff eb ff ff  ff fb ff ff df ff ff ff  |................|
142
00700fa0  df ff ff ff ff ff ff ff  ff ff fb ff ff ff ff fb  |................|
143
00700fb0  ff ff ff df ff ff ff ff  fe fe fe ff ff f7 ff ff  |................|
144
00700fc0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff fb  |................|
145
00700fd0  fd ff ff ff ff fd ff ff  ff ff ff ff fe ff ff ff  |................|
146
00700fe0  ff ff df ff ff ff ff fb  ff ff ff ff ff ff ff ff  |................|
147
00700ff0  ff f7 df ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
148
00701000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
149
*
150
007ffc00  d4 ad 55 ff 52 e9 ed 4c  f8 d1 9c 08 79 b6 e9 6c  |..U.R..L....y..l|
151
007ffc10  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
152
*
153
00800000
154
</pre>
155
156
Questions:
157
* Can we ignore what is after the tarball and grow it to 8MiB?
158 2 Denis 'GNUtoo' Carikli
* Does what's after contains encrypted data for the bootloader?
159 1 Denis 'GNUtoo' Carikli
160 11 Denis 'GNUtoo' Carikli
h3. adv_env.img
161 2 Denis 'GNUtoo' Carikli
162
Here's the content of the adv-env.img file:
163
<pre>
164 8 Denis 'GNUtoo' Carikli
$ hexdump -C adv-env.img
165 2 Denis 'GNUtoo' Carikli
00000000  03 00 fe ca 00 01 00 00  00 00 00 00 00 00 00 00  |................|
166
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
167
*
168
00000200  04 00 00 00 01 00 00 00  4c 4f 00 00 00 00 00 00  |........LO......|
169
00000210  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
170
00000220  00 00 00 00 00 00 00 00  63 6f 6e 73 6f 6c 65 3d  |........console=|
171
00000230  72 61 6d 20 6c 6f 67 6c  65 76 65 6c 3d 34 00 00  |ram loglevel=4..|
172
00000240  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
173
*
174
00000e20  00 00 00 00 00 00 00 00                           |........|
175
00000e28
176
</pre>
177
178
Questions:
179
* Why are the kernel parameters repeated again after the end of the tarball?
180
* Where are the updated kernel parameters stored?
181 3 Denis 'GNUtoo' Carikli
* Are the default and in-use kernel parameters stored at different location?
182 1 Denis 'GNUtoo' Carikli
183 12 Denis 'GNUtoo' Carikli
h2. Kernel command line
184 3 Denis 'GNUtoo' Carikli
185
*Default kernel command line*: @console=ram loglevel=4@
186
187 8 Denis 'GNUtoo' Carikli
Test:
188 3 Denis 'GNUtoo' Carikli
* change to @console=ram loglevel=8@ through the bootloader setenv command
189 8 Denis 'GNUtoo' Carikli
* run saveenv
190 3 Denis 'GNUtoo' Carikli
* reboot and validate that it's really changed with printenv
191
* observe the results on the filesystem
192
193
See [[MidasBootloader]] for more details on how to change the command line parameters.
194
195
After changing the environment variable, we still have loglevel=4 in the adv-env.img file that is in the tarball:
196
adv-env.img
197
<pre>
198 8 Denis 'GNUtoo' Carikli
$ hexdump -C adv-env.img
199 3 Denis 'GNUtoo' Carikli
00000000  03 00 fe ca 00 01 00 00  00 00 00 00 00 00 00 00  |................|
200
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
201
*
202
00000200  04 00 00 00 01 00 00 00  4c 4f 00 00 00 00 00 00  |........LO......|
203
00000210  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
204
00000220  00 00 00 00 00 00 00 00  63 6f 6e 73 6f 6c 65 3d  |........console=|
205
00000230  72 61 6d 20 6c 6f 67 6c  65 76 65 6c 3d 34 00 00  |ram loglevel=4..|
206
00000240  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
207
*
208
00000e20  00 00 00 00 00 00 00 00                           |........|
209
00000e28
210
</pre>
211
So these must be the default parameters.
212
213
And the actual kernel parameters were instead saved after the tarball:
214
<pre>
215
$ hexdump PARAM.img
216
*
217
00700200  00 00 00 00 03 00 00 00  4c 4f 00 00 00 00 00 00  |........LO......|
218
00700210  00 00 00 00 03 00 00 00  01 00 00 00 00 00 00 00  |................|
219
00700220  00 00 00 00 00 00 00 00  63 6f 6e 73 6f 6c 65 3d  |........console=|
220
00700230  72 61 6d 20 6c 6f 67 6c  65 76 65 6c 3d 38 00 00  |ram loglevel=8..|
221
00700240  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
222
*
223
</pre>
224
225
226 8 Denis 'GNUtoo' Carikli
*Results:*
227 3 Denis 'GNUtoo' Carikli
* Since the s-boot 4.0 bootloader on several Exynos 4412 devices (GT-I9300, GT-I9305, GT-N7100, GT-N7105) doesn't take into account the boot.img kenrel parameters, we can then try to change them by editing the PARAM.img after the tarball.
228
* There is valuable info after the tarball => don't make the tarball grow too much.
229 4 Denis 'GNUtoo' Carikli
230
h2. USB switch
231
232
On a GT-I9300, if I set the address @0x00700204@ to @00@, it switch to the USB to the modem's USB, and @Bus 002 Device 095: ID 1519:0020 Comneon HSIC Device@ appears when connecting the GT-I9300 to a computer.
233
234
When I set it back to @01@, I can have ADB again.
235
236 1 Denis 'GNUtoo' Carikli
Here's the diff:
237
<pre>
238 5 Denis 'GNUtoo' Carikli
$ vbindiff PARAM.img PARAM.img.new
239
PARAM.img
240 4 Denis 'GNUtoo' Carikli
0070 0204: 00 00 00 00 4C 4F 00 00  00 00 00 00 00 00 00 00  ....LO.. ........  
241
0070 0214: 03 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
242
0070 0224: 00 00 00 00 63 6F 6E 73  6F 6C 65 3D 72 61 6D 20  ....cons ole=ram   
243
0070 0234: 6C 6F 67 6C 65 76 65 6C  3D 38 00 00 00 00 00 00  loglevel =8......  
244
0070 0244: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
245
0070 0254: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
246
0070 0264: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
247
0070 0274: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
248
0070 0284: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
249
0070 0294: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
250
0070 02A4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
251
0070 02B4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
252
0070 02C4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
253
0070 02D4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
254
0070 02E4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
255
0070 02F4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
256
PARAM.img.new                                                                   
257
0070 0204: 01 00 00 00 4C 4F 00 00  00 00 00 00 00 00 00 00  ....LO.. ........  
258
0070 0214: 03 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
259
0070 0224: 00 00 00 00 63 6F 6E 73  6F 6C 65 3D 72 61 6D 20  ....cons ole=ram   
260
0070 0234: 6C 6F 67 6C 65 76 65 6C  3D 38 00 00 00 00 00 00  loglevel =8......  
261
0070 0244: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
262
0070 0254: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
263
0070 0264: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
264
0070 0274: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
265
0070 0284: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
266
0070 0294: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
267
0070 02A4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
268
0070 02B4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
269
0070 02C4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
270
0070 02D4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
271
0070 02E4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
272
0070 02F4: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
273
┌──────────────────────────────────────────────────────────────────────────────┐
274
│Arrow keys move  F find      RET next difference  ESC quit  T move top        │
275
│C ASCII/EBCDIC   E edit file   G goto position      Q quit  B move bottom     │
276
└──────────────────────────────────────────────────────────────────────────────┘
277
</pre>
278
279 9 Denis 'GNUtoo' Carikli
At the next boot the s-boot bootloader will then configure the USB switch to connect to the modem USB.
280
281
You can also get that behavior with the stock OS if you go to the phone application and enter @*#7284#@ and set @USB@ to
282
@MODEM@ and then click on the @SAVE and RESET@ button. It will then reboot the phone automatically.
283
284
Note that in both case (when doing it manually with Replicant or through the stock OS):
285
* ADB will not work anymore in Replicant, the recovery and the stock OS
286
* Heimdall may not work anymore
287
so you need a plan to be able to recovery from it.
288
289
If you run the stock OS, you can't count on recoveries as it tend to replace them the recoveries with its own recovery, but you can still use @*#7284#@ to change @USB@ back to @PDA@ instead of @MODEM@.
290
291
With Replicant, you can enable the terminal, adb and root for adb and applications in the developers settings, and once that is done, through the terminal application you can get root with @su@ and then type the following command to enable adb again: 
292
<pre>
293
echo PDA > /sys/devices/virtual/sec/switch/usb_sel
294
</pre>
295
as this command is temporary (until the next reboot), you'll have to edit again the @PARAM@ partition and copy the modified @PARAM@ image to the @PARAM@ partition with @dd@.
296 10 Denis 'GNUtoo' Carikli
297
h2. Modem debug level
298
299
In the stock OS, if we go to the phone application and dial @*#9900#@ and change the @Debug Level Enabled@ (@LOW@ @MEDIUM@ and @HIGH@ are available), the PARAM partition will be modified (and then the phone will be rebooted):
300
301
Here we switched the setting from @LOW@ to @MEDIUM@, and it produces a difference at @0x700208@:
302
<pre>
303
$ vbindiff low-2/PARAM.img medium-2/PARAM.img
304
low-2/PARAM.img                                                                 
305
0070 0208: 4C 4F 00 00 00 00 00 00  00 00 00 00 03 00 00 00  LO...... ........  
306
0070 0218: 01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
307
0070 0228: 63 6F 6E 73 6F 6C 65 3D  72 61 6D 20 6C 6F 67 6C  console= ram logl  
308
0070 0238: 65 76 65 6C 3D 38 00 00  00 00 00 00 00 00 00 00  evel=8.. ........  
309
0070 0248: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
310
0070 0258: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
311
0070 0268: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
312
0070 0278: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
313
0070 0288: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
314
0070 0298: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
315
0070 02A8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
316
0070 02B8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
317
0070 02C8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
318
0070 02D8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
319
0070 02E8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
320
0070 02F8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
321
medium-2/PARAM.img                                                              
322
0070 0208: 4D 49 00 00 00 00 00 00  00 00 00 00 03 00 00 00  MI...... ........  
323
0070 0218: 01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
324
0070 0228: 63 6F 6E 73 6F 6C 65 3D  72 61 6D 20 6C 6F 67 6C  console= ram logl  
325
0070 0238: 65 76 65 6C 3D 38 00 00  00 00 00 00 00 00 00 00  evel=8.. ........  
326
0070 0248: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
327
0070 0258: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
328
0070 0268: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
329
0070 0278: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
330
0070 0288: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
331
0070 0298: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
332
0070 02A8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
333
0070 02B8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
334
0070 02C8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
335
0070 02D8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
336
0070 02E8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
337
0070 02F8: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
338
┌──────────────────────────────────────────────────────────────────────────────┐
339
│Arrow keys move  F find      RET next difference  ESC quit  T move top        │
340
│C ASCII/EBCDIC   E edit file   G goto position      Q quit  B move bottom     │
341
└──────────────────────────────────────────────────────────────────────────────┘
342
</pre>
343
344
And here's what happens when switching from @MEDIUM@ to @HIGH@:
345
<pre>
346
$ vbindiff medium-2/PARAM.img high-1/PARAM.img
347
medium-2/PARAM.img                                                              
348
0070 0200: 00 00 00 00 01 00 00 00  4D 49 00 00 00 00 00 00  ........ MI......  
349
0070 0210: 00 00 00 00 03 00 00 00  01 00 00 00 00 00 00 00  ........ ........  
350
0070 0220: 00 00 00 00 00 00 00 00  63 6F 6E 73 6F 6C 65 3D  ........ console=  
351
0070 0230: 72 61 6D 20 6C 6F 67 6C  65 76 65 6C 3D 38 00 00  ram logl evel=8..  
352
0070 0240: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
353
0070 0250: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
354
0070 0260: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
355
0070 0270: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
356
0070 0280: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
357
0070 0290: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
358
0070 02A0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
359
0070 02B0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
360
0070 02C0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
361
0070 02D0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
362
0070 02E0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
363
0070 02F0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
364
high-1/PARAM.img                                                                
365
0070 0200: 00 00 00 00 01 00 00 00  48 49 00 00 00 00 00 00  ........ HI......  
366
0070 0210: 00 00 00 00 03 00 00 00  01 00 00 00 00 00 00 00  ........ ........  
367
0070 0220: 00 00 00 00 00 00 00 00  63 6F 6E 73 6F 6C 65 3D  ........ console=  
368
0070 0230: 72 61 6D 20 6C 6F 67 6C  65 76 65 6C 3D 38 00 00  ram logl evel=8..  
369
0070 0240: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
370
0070 0250: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
371
0070 0260: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
372
0070 0270: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
373
0070 0280: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
374
0070 0290: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
375
0070 02A0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
376
0070 02B0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
377
0070 02C0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
378
0070 02D0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
379
0070 02E0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
380
0070 02F0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
381
┌──────────────────────────────────────────────────────────────────────────────┐
382
│Arrow keys move  F find      RET next difference  ESC quit  T move top        │
383
│C ASCII/EBCDIC   E edit file   G goto position      Q quit  B move bottom     │
384
└──────────────────────────────────────────────────────────────────────────────┘
385
</pre>
386
387
Unfortunately in both cases, it also changes what appears to be a checksum:
388
<pre>
389
$ vbindiff medium-2/PARAM.img high-1/PARAM.img
390
medium-2/PARAM.img                                                              
391
007F FC00: 0D 4D 03 C0 FD 5C A8 D1  2B 14 25 76 03 51 C5 27  .M...\.. +.%v.Q.'  
392
007F FC10: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
393
007F FC20: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
394
007F FC30: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
395
007F FC40: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
396
007F FC50: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
397
007F FC60: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
398
007F FC70: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
399
007F FC80: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
400
007F FC90: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
401
007F FCA0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
402
007F FCB0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
403
007F FCC0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
404
007F FCD0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
405
007F FCE0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
406
007F FCF0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
407
high-1/PARAM.img                                                                
408
007F FC00: 67 39 08 85 9C 4A FE B8  65 47 9C C8 BB 95 DF B7  g9...J.. eG......  
409
007F FC10: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
410
007F FC20: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
411
007F FC30: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
412
007F FC40: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
413
007F FC50: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
414
007F FC60: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
415
007F FC70: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
416
007F FC80: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
417
007F FC90: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
418
007F FCA0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
419
007F FCB0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
420
007F FCC0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
421
007F FCD0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
422
007F FCE0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
423
007F FCF0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ........ ........  
424
┌──────────────────────────────────────────────────────────────────────────────┐
425
│Arrow keys move  F find      RET next difference  ESC quit  T move top        │
426
│C ASCII/EBCDIC   E edit file   G goto position      Q quit  B move bottom     │
427
└──────────────────────────────────────────────────────────────────────────────┘
428
</pre>
429
430
To capture that I had to :
431
* Set the desired setting (through the phone application after dialing @$*#9900#@ and let it reboot
432
* then shut down the phone
433
* Then boot into the download mode
434
* then flash a Replicant recovery with root to @BOOT@ (do not flash it to RECOVERY)
435
* Then to dump the PARAM partition
436
* Then to reboot to the bootloader
437
* Then to flash back the stock OS BOOT
438
439
If for some reason I rebooted to the RECOVERY partition, the setting would be changed back to @LOW@ (this was verified by dialing @*#9900#@ and then looking at the setting value without changing it).
440 15 Denis 'GNUtoo' Carikli
441
h2. See also
442
443
* The [[AcademicPapersAndPresentations#Forensics-acquisition-Analysis-and-circumvention-of-samsung-secure-boot-enforced-common-criteria-mode|Forensics acquisition - Analysis and circumvention of samsung secure boot enforced common criteria mode]] paper has some information about the PARAM partition but it's mostly interested in MDM settings