Content.bin
This is an old revision of this page, as edited by Lockhool (talk | contribs) at 03:50, 19 January 2007. It may differ significantly from the current revision. |
Overview
Wii Channels and savegames can be stored on SD cards inserted into the Wii through the front SD slot. They are stored in the directoy /private/wii/title/ on the card and consist of a single .bin-file. Channels are stored in files called content.bin while savegames are stored in data.bin files. Each Wii channel and game have a unique four letter ID. data.bin and content.bin are stored in subdirectories named after the game's or program's ID. Renaming the directory will make the Wii not recognize the file anymore. Some games like Virtual Console titles can have both a content.bin and a data.bin.
Technical detail
Looking at the bin files reveals that they are stuctured in either 64 or 128 byte blocks. There is for example plaintext information about the certificate used to encrypt and decrypt the file stored in the content bin which is artificially padded by leading and trailing blocks of 64 zero bytes (0x00) and the ASCII strings are also padded with zeros to reach the 64 byte block size.
Header
Each bin file starts with a header which can be decrypted successfully by every Wii console, since the icon, banner, title and description of the game are all readable in the Wii SD card menu, even if the file was not originally created on this Wii or is even from the same region. The header is broken into 64 byte blocks and its last block is followed by a block with the first four bytes 0x00000070 being followed by the four bytes 0x426B0001. The next four bytes are the Wii ID of the specific console this file was created on stored in binary. Further information in the header includes the size of the following data and later the ID of the program in plaintext ASCII. The more colorful the icon of the file the bigger the header will be strongly indicating an image compression of some sort.
Data
The data is encrypted and little can be said about it's plaintext. At the end of the data two certificates are described, each one referring to the unique Wii ID thus making it plausible that the data is encrypted with a secret key only known to once own Wii. A checksum of some sore might be the last piece of information stored in the penultimate block which is then followed by a last 64 byte block of zeros.
Copying a bin file to the Wii
A content.bin or data.bin file with a wellformed header will appear in the Wii's data manager on the SD card displaying it's icon and name and description if clicked upon. If a savegame or channel is not already present in the Wii's internal memory the bin file can be encrypted and copied successfully.
Copying files from one Wii to the other
When copying a file that was created on another Wii the copying will fail with a corresponding message.
"Data was not copied."
Changing anything in the data (not the header, see below) will cause the copying to end with this message. Deleting or adding bytes at the end of the file will also yield this message. A checksum seems to check the integrity of the whole file or at least the data segment, since even changing something in the obviously useless and uninterpreted 64 byte zero blocks or in the dead space beyond the plaintext strings in the certificate information will cause this message to appear.
File does not appear at all
Every manipulation of the bin file's header will cause the channel or savegame to not appear at all in the Wii's SD card manager. Interestingly the file will still appear even if all blocks beyond the header are delete. Only one byte needs to follow the isolated header, possibly to prevent the last byte of the header to be the end of file also. The value of the one byte is of no importance. The file will also not appear when its directory is renamed. Combined with the last statement this might mean that the Wii checks only the headers first and either the directoy's name is stored in the header in encrypted form or it is part of the key that is used by the Wii to decrypt the header.