Difference between revisions of "Title metadata"

From WiiBrew
Jump to: navigation, search
 
m (Forgot to format)
Line 1: Line 1:
/**************************************************************/
+
/**************************************************************/
//
+
//
// Nintendo Wii Virtual Console tmd-file structure  
+
// Nintendo Wii Virtual Console tmd-file structure  
//
+
//
//                  v.0.1
+
//                  v.0.1
//
+
//
//      by Lockhool for #wiidev at efnet
+
//      by Lockhool for #wiidev at efnet
//                                                  14.12.2007
+
//                                                  14.12.2007
/**************************************************************/
+
/**************************************************************/
 +
 +
// Common labels used in this file:
 +
// magicnum - control ints or shorts found in all tmds
 +
// zeros    - bytes all filled with zeros
 +
// undef    - non-zero data of unknown purpose
 +
// sign    - zero-terminated string padded to 64 bytes
 +
//            probably used in the signing process
 +
// hash    - probably 20, 512 or 1024 byte hashes
 +
//
 +
// # in fornt of a comment signifies entires that are
 +
// the same in each tmd-files the author checked
 +
//
 +
// ! Remember the Wii has a LITTLE-ENDIAN processor. When !
 +
// ! working with ints or shorts on none-LE machines      !
 +
// ! (Intel PC and Mac) you need to swap the byteorder.  !
 +
 +
typedef unsigned char  u8;
 +
typedef unsigned short u16;
 +
typedef unsigned int  u32; 
  
// Common labels used in this file:
+
typedef struct{
// magicnum - control ints or shorts found in all tmds
+
   u32 file [0x1]; // name of the file to download
// zeros   - bytes all filled with zeros
+
  u16 num [0x1]; // # number of the file
// undef    - non-zero data of unknown purpose
+
  u8  undef0 [0x1]; // might be 0x00 or 0x80
// sign    - zero-terminated string padded to 64 bytes
+
  u8  undef1 [0x1]; // # 0x01
//           probably used in the signing process
+
  u8  zeros0 [0x4]; // # 0
// hash    - probably 20, 512 or 1024 byte hashes
+
  u32 length [0x1]; // non-padded filelength
//
+
  u8  hash [0x14]; // ? maybe SHA1-hash
// # in fornt of a comment signifies entires that are
+
}VC_TMD_FILE; // size: 0x30 bytes
// the same in each tmd-files the author checked
 
//
 
// ! Remember the Wii has a LITTLE-ENDIAN processor. When !
 
// ! working with ints or shorts on none-LE machines      !
 
// ! (Intel PC and Mac) you need to swap the byteorder.  !
 
  
typedef unsigned char  u8;
+
  typedef struct{
typedef unsigned short u16;
+
  u32 magicnum0 [0x1]; // # 0x00010001
typedef unsigned int  u32;
+
  u8  hash0 [0x100]; // ?
 
+
  u8  zeros0 [0x3C]; // # 0
typedef struct{
+
  u8  sign0 [0x40]; // # Root-CA-CP
  u32 file [0x1]; // name of the file to download
+
  u8  undef0 [0x10]; // # ?
  u16 num [0x1]; // # number of the file
+
  u8  code [0x4]; // game code in ascii
  u8  undef0 [0x1]; // might be 0x00 or 0x80
+
  u32 magicnum1 [0x1]; // # 0x00000001
  u8 undef1 [0x1]; // # 0x01
+
  u8  publ [0x2]; // publisher id
  u8  zeros0 [0x4]; // # 0
+
  u8  zeros1 [0x2]; // # 0
  u32 length [0x1]; // non-padded filelength
+
  u8  undef1 [0x4]; // ?
  u8  hash [0x14]; // ? maybe SHA1-hash
+
  u8  undef2 [0xE]; // ? 0x80
}VC_TMD_FILE; // size: 0x30 bytes
+
  u8  zeros2 [0x2E]; // # 0
 
+
  u8  undef3 [0x8]; // ?
typedef struct{
+
  VC_TMD_FILE files[7]; // 7 file entries
  u32 magicnum0 [0x1]; // # 0x00010001
+
  u32 magicnum2 [0x1]; // # 0x00010001
  u8  hash0 [0x100]; // ?
+
  u8  hash1 [0x100]; // # ?
  u8  zeros0 [0x3C]; // # 0
+
  u8  zeros3 [0x3C]; // # 0
  u8  sign0 [0x40]; // # Root-CA-CP
+
  u8  sign1 [0x40]; // # Root-CA
  u8  undef0 [0x10]; // # ?
+
  u32 magicnum3 [0x1]; // # 0x00000001
  u8  code [0x4]; // game code in ascii
+
  u8  sign2 [0x40]; // # CP
  u32 magicnum1 [0x1]; // # 0x00000001
+
  u8  hash2 [0x104]; // # ?
  u8  publ [0x2]; // publisher id
+
  u32 magicnum4 [0x1]; // # 0x00010001
  u8  zeros1 [0x2]; // # 0
+
  u8  zeros4 [0x34]; // # 0
  u8  undef1 [0x4]; // ?
+
  u32 magicnum5 [0x1]; // # 0x00100000
  u8  undef2 [0xE]; // ? 0x80
+
  u8  hash3 [0x200]; // # ?
  u8  zeros2 [0x2E]; // # 0
+
  u8  zeros5 [0x3C]; // # 0
  u8  undef3 [0x8]; // ?
+
  u8  sign3 [0x40]; // # Root
  VC_TMD_FILE files[7]; // 7 file entries
+
  u32 magicnum6 [0x1]; // # 0x00000001
  u32 magicnum2 [0x1]; // # 0x00010001
+
  u8  sign4 [0x40]; // # CA
  u8  hash1 [0x100]; // # ?
+
  u8  hash4 [0x104]; // # ?
  u8  zeros3 [0x3C]; // # 0
+
  u32 magicnum7 [0x1]; // # 0x00010001
  u8  sign1 [0x40]; // # Root-CA
+
  u8 zeros6 [0x34]; // # 0
  u32 magicnum3 [0x1]; // # 0x00000001
+
}VC_TMD; // size: 09E0 bytes
  u8  sign2 [0x40]; // # CP
 
  u8  hash2 [0x104]; // # ?
 
  u32 magicnum4 [0x1]; // # 0x00010001
 
  u8  zeros4 [0x34]; // # 0
 
  u32 magicnum5 [0x1]; // # 0x00100000
 
  u8  hash3 [0x200]; // # ?
 
  u8  zeros5 [0x3C]; // # 0
 
  u8  sign3 [0x40]; // # Root
 
  u32 magicnum6 [0x1]; // # 0x00000001
 
  u8  sign4 [0x40]; // # CA
 
  u8  hash4 [0x104]; // # ?
 
  u32 magicnum7 [0x1]; // # 0x00010001
 
  u8 zeros6 [0x34]; // # 0
 
}VC_TMD; // size: 09E0 bytes
 

Revision as of 22:53, 14 December 2006

/**************************************************************/
//
// Nintendo Wii Virtual Console tmd-file structure 
//
//                   v.0.1
//
//      by Lockhool for #wiidev at efnet
//                                                  14.12.2007
/**************************************************************/

// Common labels used in this file:
// magicnum - control ints or shorts found in all tmds
// zeros    - bytes all filled with zeros
// undef    - non-zero data of unknown purpose
// sign     - zero-terminated string padded to 64 bytes
//            probably used in the signing process
// hash     - probably 20, 512 or 1024 byte hashes
//
// # in fornt of a comment signifies entires that are
// the same in each tmd-files the author checked
//
// ! Remember the Wii has a LITTLE-ENDIAN processor. When !
// ! working with ints or shorts on none-LE machines      !
// ! (Intel PC and Mac) you need to swap the byteorder.   !

typedef unsigned char  u8;
typedef unsigned short u16;
typedef unsigned int   u32;  
typedef struct{
  u32 file [0x1];				// name of the file to download
  u16 num [0x1];				// # number of the file
  u8  undef0 [0x1]; 		// might be 0x00 or 0x80
  u8  undef1 [0x1]; 		// # 0x01
  u8  zeros0 [0x4]; 		// # 0
  u32 length [0x1]; 		// non-padded filelength
  u8  hash [0x14]; 			// ? maybe SHA1-hash
}VC_TMD_FILE; 					// size: 0x30 bytes
typedef struct{
  u32 magicnum0 [0x1];	// # 0x00010001
  u8  hash0 [0x100];		// ?
  u8  zeros0 [0x3C]; 		// # 0
  u8  sign0 [0x40];			// # Root-CA-CP
  u8  undef0 [0x10];		// # ?
  u8  code [0x4];				// game code in ascii
  u32 magicnum1 [0x1];	// # 0x00000001
  u8  publ [0x2];				// publisher id
  u8  zeros1 [0x2];			// # 0
  u8  undef1 [0x4];			// ?
  u8  undef2 [0xE];			// ? 0x80
  u8  zeros2 [0x2E];		// # 0
  u8  undef3 [0x8];			// ?
  VC_TMD_FILE files[7];	// 7 file entries
  u32 magicnum2 [0x1];	// # 0x00010001
  u8  hash1 [0x100];		// # ?
  u8  zeros3 [0x3C];		// # 0
  u8  sign1 [0x40];			// # Root-CA
  u32 magicnum3 [0x1];	// # 0x00000001
  u8  sign2 [0x40];			// # CP
  u8  hash2 [0x104];		// # ?
  u32 magicnum4 [0x1];	// # 0x00010001
  u8  zeros4 [0x34];		// # 0
  u32 magicnum5 [0x1];	// # 0x00100000
  u8  hash3 [0x200];		// # ?
  u8  zeros5 [0x3C];		// # 0
  u8  sign3 [0x40];			// # Root
  u32 magicnum6 [0x1];	// # 0x00000001
  u8  sign4 [0x40];			// # CA
  u8  hash4 [0x104];		// # ?
  u32 magicnum7 [0x1];	// # 0x00010001
  u8 zeros6 [0x34];			// # 0
}VC_TMD;								// size: 09E0 bytes