Line 158:
Line 158:
<source lang="c">
<source lang="c">
typedef struct {
typedef struct {
β
u32 cid; // content id
+
u32 cid; // content id
β
u16 index; // # number of the file
+
u16 index; // # number of the file
β
u16 type; // Wii: normal 0x0001; shared 0x8001 | Wii U: 0x2001; 0x2003; 0x6003; Bitmask, check last bit for .H3 extra hashes
+
u16 type; // Wii: normal 0x0001; shared 0x8001 | Wii U: 0x2001; 0x2003; 0x6003; Bitmask, check last bit for .H3 hashes availability.
u64 size;
u64 size;
β
u8 hash [20]; // SHA1 hash content
+
u8 hash [20]; // SHA1 hash content
β
} content_record; // size: 0x24 bytes
+
} content_record; // size: 0x24 bytes
</source>
</source>
<source lang="c">
<source lang="c">
Line 176:
Line 176:
u8 sig[256];
u8 sig[256];
u8 fill1[60];
u8 fill1[60];
β
u8 issuer[64]; // Root-CA%08x-CP%08x
+
u8 issuer[64]; // Root-CA%08x-CP%08x
u8 version;
u8 version;
u8 ca_crl_version;
u8 ca_crl_version;
Line 184:
Line 184:
u64 title_id;
u64 title_id;
u32 title_type;
u32 title_type;
β
u16 group_id; // publisher
+
u16 group_id; // publisher
u8 reserved[62];
u8 reserved[62];
u32 access_rights;
u32 access_rights;
Line 196:
Line 196:
The tmd is then followed by a chain of certificates, where each certificate is of the general form
The tmd is then followed by a chain of certificates, where each certificate is of the general form
<source lang="c">
<source lang="c">
β
u32 sig_type; //
+
u32 sig_type;
β
u8 sig[256]; // 256 for RSA_2048, 512 for RSA_4096
+
u8 sig[256]; // 256 for RSA_2048, 512 for RSA_4096
u8 issuer[32];
u8 issuer[32];
β
u32 tag; // identifies what is being signed
+
u32 tag; // identifies what is being signed
β
u8 name[64]; // name of thing being signed
+
u8 name[64]; // name of thing being signed
u8 key[...];
u8 key[...];
</source>
</source>
Line 216:
Line 216:
struct tmd_view_t
struct tmd_view_t
{
{
β
uint8_t version; // 0x0000;
+
uint8_t version; //0x0000;
uint8_t filler[3];
uint8_t filler[3];
β
uint64_t ios_title_id; //0x0004
+
uint64_t ios_title_id; //0x0004
β
uint64_t title_id; // 0x00c
+
uint64_t title_id; //0x00c
β
uint32_t title_type; //0x0014
+
uint32_t title_type; //0x0014
β
uint16_t group_id; //0x0018
+
uint16_t group_id; //0x0018
β
uint8_t reserved[0x3e]; //0x001a this is the same reserved 0x3e bytes from the tmd
+
uint8_t reserved[0x3e]; //0x001a This is the same reserved 0x3e bytes from the tmd.
β
uint16_t title_version; //0x0058
+
uint16_t title_version; //0x0058
β
uint16_t number_contents; //0x005a
+
uint16_t number_contents; //0x005a
tmd_view_content_t contents[]; //0x005c
tmd_view_content_t contents[]; //0x005c
};
};