summaryrefslogtreecommitdiffstats
path: root/utils/imxtools/sbtools
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-13 02:27:30 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-13 02:27:30 +0200
commit1dae3a82e2e709d0ff37687caba70b6154940636 (patch)
tree838db5f1e1d8e3f96ab01a075ae8f83e576d89dd /utils/imxtools/sbtools
parentf9cb5de58020936812653c578c79c79a13bc626c (diff)
downloadrockbox-1dae3a82e2e709d0ff37687caba70b6154940636.tar.gz
rockbox-1dae3a82e2e709d0ff37687caba70b6154940636.tar.bz2
rockbox-1dae3a82e2e709d0ff37687caba70b6154940636.zip
sbtools: fix encryption and cosmetics
Change-Id: Id302f236ad3ec13a5166de4e22a3fc85b2a6c64f
Diffstat (limited to 'utils/imxtools/sbtools')
-rw-r--r--utils/imxtools/sbtools/elftosb1.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/utils/imxtools/sbtools/elftosb1.c b/utils/imxtools/sbtools/elftosb1.c
index be8cec7a99..1f33058eca 100644
--- a/utils/imxtools/sbtools/elftosb1.c
+++ b/utils/imxtools/sbtools/elftosb1.c
@@ -473,9 +473,14 @@ CMD_FN(cmd_component)
CMD_FN(cmd_keyfile)
{
- (void) sb;
if(!add_keys_from_file(args[0].str))
bug("Cannot add keys from file '%s'\n", args[0].str);
+ for(int i = 0; i < g_nr_keys; i++)
+ if(g_key_array[i].method == CRYPTO_XOR_KEY)
+ {
+ memcpy(&sb->key, &g_key_array[i], sizeof(sb->key));
+ break;
+ }
return 0;
}
@@ -501,6 +506,7 @@ struct cmd_entry_t g_cmds[] =
CMD("-N", cmd_clear_strict, 0)
CMD("-nonstrict", cmd_clear_strict, 0)
CMD("-call", cmd_call, 1, ARG_UINT)
+ CMD("-jump", cmd_jump, 1, ARG_UINT)
CMD("-jumparg", cmd_jumparg, 1, ARG_UINT)
CMD("-f", cmd_load, 1, ARG_STR)
CMD("-load", cmd_load, 1, ARG_STR)
@@ -515,7 +521,6 @@ struct cmd_entry_t g_cmds[] =
CMD("-v", cmd_component, 1, ARG_STR)
CMD("-component", cmd_component, 1, ARG_STR)
CMD("-k", cmd_keyfile, 1, ARG_STR)
- CMD("-jump", cmd_jump, 1, ARG_UINT)
};
#undef CMD
@@ -579,8 +584,8 @@ static void usage(void)
printf(" -C/-noncritical\t\tClear critical flag\n");
printf(" -n/-strict\t\t\tSet strict flag\n");
printf(" -N/-nonstrict\t\t\tClear strict flag\n");
- printf(" -call <addr>\t\tCall an address\n");
- printf(" -jump <addr>\t\tJump to an address\n");
+ printf(" -call <addr>\t\t\tCall code at a specified address\n");
+ printf(" -jump <addr>\t\t\tJump to code at a specified address\n");
exit(1);
}