Line 1:
Line 1:
−
The wii is awesome!
+
/**************************************************************/
+
//
+
// 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 front 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 !
+
// ! (e.g. PPC 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