diff options
author | Amaury Pouly <pamaury@rockbox.org> | 2011-04-16 18:22:42 +0000 |
---|---|---|
committer | Amaury Pouly <pamaury@rockbox.org> | 2011-04-16 18:22:42 +0000 |
commit | e4dd514e6ffed290f07eff20b586b704008d0a8a (patch) | |
tree | 712f0bd0a51c473fe1e7a2cc5bbc93941bdd305a /utils/sbinfo/sb.h | |
parent | d9b050ee2b069d65a57e2a65638a6ff1bf63ff17 (diff) | |
download | rockbox-e4dd514e6ffed290f07eff20b586b704008d0a8a.tar.gz rockbox-e4dd514e6ffed290f07eff20b586b704008d0a8a.zip |
sbinfo: move more things to sb.h, rewrite code to use structures instead of hardcoded offsets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29723 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/sbinfo/sb.h')
-rw-r--r-- | utils/sbinfo/sb.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/utils/sbinfo/sb.h b/utils/sbinfo/sb.h index c4d705c14b..1d62aa4daa 100644 --- a/utils/sbinfo/sb.h +++ b/utils/sbinfo/sb.h | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <sys/types.h> | 23 | #include <sys/types.h> |
24 | #include <sys/stat.h> | 24 | #include <sys/stat.h> |
25 | 25 | ||
26 | #define BLOCK_SIZE 16 | ||
27 | |||
26 | struct sb_version_t | 28 | struct sb_version_t |
27 | { | 29 | { |
28 | uint16_t major; | 30 | uint16_t major; |
@@ -56,6 +58,23 @@ struct sb_header_t | |||
56 | uint8_t rand_pad1[6]; /* Random padding */ | 58 | uint8_t rand_pad1[6]; /* Random padding */ |
57 | } __attribute__((packed)); | 59 | } __attribute__((packed)); |
58 | 60 | ||
61 | struct sb_section_header_t | ||
62 | { | ||
63 | uint32_t identifier; | ||
64 | uint32_t offset; /* In blocks */ | ||
65 | uint32_t size; /* In blocks */ | ||
66 | uint32_t flags; | ||
67 | } __attribute__((packed)); | ||
68 | |||
69 | struct sb_key_dictionary_entry_t | ||
70 | { | ||
71 | uint8_t hdr_cbc_mac[16]; /* CBC-MAC of the header */ | ||
72 | uint8_t key[16]; /* Actual AES Key (encrypted by the global key) */ | ||
73 | } __attribute__((packed)); | ||
74 | |||
75 | #define ROM_SECTION_BOOTABLE (1 << 0) | ||
76 | #define ROM_SECTION_CLEARTEXT (1 << 1) | ||
77 | |||
59 | #define SB_INST_NOP 0x0 | 78 | #define SB_INST_NOP 0x0 |
60 | #define SB_INST_TAG 0x1 | 79 | #define SB_INST_TAG 0x1 |
61 | #define SB_INST_LOAD 0x2 | 80 | #define SB_INST_LOAD 0x2 |
@@ -64,9 +83,6 @@ struct sb_header_t | |||
64 | #define SB_INST_CALL 0x5 | 83 | #define SB_INST_CALL 0x5 |
65 | #define SB_INST_MODE 0x6 | 84 | #define SB_INST_MODE 0x6 |
66 | 85 | ||
67 | #define ROM_SECTION_BOOTABLE (1 << 0) | ||
68 | #define ROM_SECTION_CLEARTEXT (1 << 1) | ||
69 | |||
70 | struct sb_instruction_header_t | 86 | struct sb_instruction_header_t |
71 | { | 87 | { |
72 | uint8_t checksum; | 88 | uint8_t checksum; |