Changes

123 bytes added ,  07:55, 19 April 2017
m
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
 
};
 
};
41

edits