sbtools: add support for the mode command (rarely used) and explicit env variable to skip version check

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30003 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Amaury Pouly 2011-06-13 21:46:29 +00:00
parent dfeab73f55
commit 50be1a8c4c
2 changed files with 20 additions and 0 deletions

View file

@ -123,6 +123,14 @@ struct sb_instruction_fill_t
uint32_t pattern;
} __attribute__((packed));
struct sb_instruction_mode_t
{
struct sb_instruction_header_t hdr;
uint32_t zero1;
uint32_t zero2;
uint32_t mode;
} __attribute__((packed));
struct sb_instruction_call_t
{
struct sb_instruction_header_t hdr;

View file

@ -307,6 +307,17 @@ static void extract_section(int data_sec, char name[5], byte *buf, int size, con
// fixme: useless as pos is a multiple of 16 and call struct is 4-bytes wide ?
pos = ROUND_UP(pos, 16);
}
else if(hdr->opcode == SB_INST_MODE)
{
struct sb_instruction_mode_t *mode = (struct sb_instruction_mode_t *)hdr;
color(RED);
printf("MODE");
color(OFF);printf(" | ");
color(BLUE);
printf("mod=0x%08x\n", mode->mode);
color(OFF);
pos += sizeof(struct sb_instruction_mode_t);
}
else
{
color(RED);
@ -705,6 +716,7 @@ int main(int argc, const char **argv)
{
printf("Usage: %s <firmware> <key file> [<out prefix>]\n",*argv);
printf("To use raw command mode, set environment variable SB_RAW_CMD to YES\n");
printf("To ignore the file version check, set environment variable SB_IGNORE_VER to YES\n");
return 1;
}