diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2012-06-27 14:50:39 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2012-06-27 14:55:58 +0200 |
commit | 7c9e7ec707b9aa9e40c8e7ebdbbf1138cef85bb1 (patch) | |
tree | 3510851ae8276a11aead54702cf3cc245e787ec3 /utils/imxtools/sbtools/sbtoelf.c | |
parent | fa17cb904c270e8227c0446bee4b51789eb5bb8c (diff) | |
download | rockbox-7c9e7ec707b9aa9e40c8e7ebdbbf1138cef85bb1.tar.gz rockbox-7c9e7ec707b9aa9e40c8e7ebdbbf1138cef85bb1.zip |
sbtools: add option to force sb dump
In the case of encrypted SB files without any key match, it is
still possible to dump the section headers. The force option
allows one to do so. It also allows to dump unencrypted sections
of encrypted files if there are some.
Change-Id: I36280230679ac5903f9c451c68c276f5c6959536
Diffstat (limited to 'utils/imxtools/sbtools/sbtoelf.c')
-rw-r--r-- | utils/imxtools/sbtools/sbtoelf.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/utils/imxtools/sbtools/sbtoelf.c b/utils/imxtools/sbtools/sbtoelf.c index c1d1e9aa34..0170ea1836 100644 --- a/utils/imxtools/sbtools/sbtoelf.c +++ b/utils/imxtools/sbtools/sbtoelf.c | |||
@@ -169,6 +169,7 @@ static void usage(void) | |||
169 | printf(" -a/--add-key <key>\tAdd single key (hex or usbotp)\n"); | 169 | printf(" -a/--add-key <key>\tAdd single key (hex or usbotp)\n"); |
170 | printf(" -n/--no-color\tDisable output colors\n"); | 170 | printf(" -n/--no-color\tDisable output colors\n"); |
171 | printf(" -l/--loopback <file>\tProduce sb file out of extracted description*\n"); | 171 | printf(" -l/--loopback <file>\tProduce sb file out of extracted description*\n"); |
172 | printf(" -f/--force\tForce reading even without a key*\n"); | ||
172 | printf("Options marked with a * are for debug purpose only\n"); | 173 | printf("Options marked with a * are for debug purpose only\n"); |
173 | exit(1); | 174 | exit(1); |
174 | } | 175 | } |
@@ -204,10 +205,11 @@ int main(int argc, char **argv) | |||
204 | {"add-key", required_argument, 0, 'a'}, | 205 | {"add-key", required_argument, 0, 'a'}, |
205 | {"no-color", no_argument, 0, 'n'}, | 206 | {"no-color", no_argument, 0, 'n'}, |
206 | {"loopback", required_argument, 0, 'l'}, | 207 | {"loopback", required_argument, 0, 'l'}, |
208 | {"force", no_argument, 0, 'f' }, | ||
207 | {0, 0, 0, 0} | 209 | {0, 0, 0, 0} |
208 | }; | 210 | }; |
209 | 211 | ||
210 | int c = getopt_long(argc, argv, "?do:k:zra:nl:", long_options, NULL); | 212 | int c = getopt_long(argc, argv, "?do:k:zra:nl:f", long_options, NULL); |
211 | if(c == -1) | 213 | if(c == -1) |
212 | break; | 214 | break; |
213 | switch(c) | 215 | switch(c) |
@@ -231,6 +233,9 @@ int main(int argc, char **argv) | |||
231 | case 'o': | 233 | case 'o': |
232 | g_out_prefix = optarg; | 234 | g_out_prefix = optarg; |
233 | break; | 235 | break; |
236 | case 'f': | ||
237 | g_force = true; | ||
238 | break; | ||
234 | case 'k': | 239 | case 'k': |
235 | { | 240 | { |
236 | if(!add_keys_from_file(optarg)) | 241 | if(!add_keys_from_file(optarg)) |
@@ -250,9 +255,9 @@ int main(int argc, char **argv) | |||
250 | struct crypto_key_t key; | 255 | struct crypto_key_t key; |
251 | char *s = optarg; | 256 | char *s = optarg; |
252 | if(!parse_key(&s, &key)) | 257 | if(!parse_key(&s, &key)) |
253 | bug("Invalid key specified as argument"); | 258 | bug("Invalid key specified as argument\n"); |
254 | if(*s != 0) | 259 | if(*s != 0) |
255 | bug("Trailing characters after key specified as argument"); | 260 | bug("Trailing characters after key specified as argument\n"); |
256 | add_keys(&key, 1); | 261 | add_keys(&key, 1); |
257 | break; | 262 | break; |
258 | } | 263 | } |