XVD
XVD (Xbox Virtual Disk) is a format used by the Xbox One. As the name implies, it is similar to a hard drive format that contains a collection of files and metadata. It is a modified variant of the old VHD format. This particular file type may also contain a layout called XVC to contain game-related content.
Header
Name | Data Type | Position | Length |
---|---|---|---|
Signature | Byte Array | 0 | 0x200 |
Magic | String | 0x200 | 0x8 |
Storage Type | Integer | 0x208 | 0x4 |
Unknown | Integer | 0x20C | 0x4 |
Unknown | Long | 0x210 | 0x8 |
Unknown | Integer | 0x218 | 0x4 |
Unknown (Always 0) | Integer | 0x21C | 0x4 |
Content ID | GUID | 0x220 | 0x10 |
Content ID Verification | GUID | 0x230 | 0x10 |
Top Hash Table Hash | SHA-2 | 0x240 | 0x20 |
Hash | SHA-2 | 0x34C | 0x20 |
Hash | SHA-2 | 0x36C | 0x20 |
Hash | SHA-2 | 0x38C | 0x20 |
Build ID | GUID | 0x3AC | 0x10 |
Build Version | Long | 0x3BC | 0x8 |
The GUID data type consists of multiple values. The code noted below was reversed from the Durango Software Development Kit on how exactly you'd read/print it.
char *scan_guid(unsigned char *buffer)
{
char *guid = malloc(0x25);
sprintf(guid, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
*(int *)buffer, *(short *)(buffer + 0x4), *(short *)(buffer + 0x6),
*(unsigned char *)(buffer + 0x8), *(unsigned char *)(buffer + 0x9),
*(unsigned char *)(buffer + 0xA), *(unsigned char *)(buffer + 0xB),
*(unsigned char *)(buffer + 0xC), *(unsigned char *)(buffer + 0xD),
*(unsigned char *)(buffer + 0xE), *(unsigned char *)(buffer + 0xF),
*(unsigned char *)(buffer + 0x10));
return guid;
}
Blocks
Blocks are used for a variety of information in XVD packages. They are put into use directly after the header. Each block consists of 0x1000 (4096) bytes that contain padding at the end. This padding is always null and a length of 0x10 bytes, essentially meaning each block can hold 0xFF0 bytes of information.
The master hash table rests at 0x3000 and then 0x6000 for packages containing XVC information. This specific table contains hashes of the regular hash tables.
Regular hash tables start after the master hash table. They contain hashes for the blocks following them, which contain actual content.
The hashes for the Hash Table data type are truncated to 0x18 bytes, after usually being 0x20. Each table can contain 0xAA (170) hashes.
Name | Data Type | Position | Length |
---|---|---|---|
Hash | SHA-2 | 0 | 0x18 |