BLDD spec, version 2. A .BLDD file consists of a header followed by a block stream. Header: type length(bytes) usual value Purpose char[16] 16 "VDDCompactedFile" Magic string to identify the file type. unsigned char 1 0 Minimum version needed to decode. unsigned int 4 >=4 Length (bytes) of the optional header extension immediatly following this field. Minimum of 4, as the first four bytes of a header extension identify their function. A value of 0 indicates that there are no further extensions, and the blockstream follows immediatly. If non-zero, skip the appropriate number of bytes and repeat until zero encountered. So far, only one header extension is defined: Block size header (Requires minimum decode version byte >=1) char[4] 4 "BKSZ" Identifies header type. unsigned int 4 Usually a power of 2. Block size. In the absence of this header, default to 512. Blockstream: Each block is 512 bytes long and numbered starting at zero. If the block starts with any value other than a 0xE7 byte, then it is an unprocessed block which could not be deduplicated and should be simply output as-is. If the first byte is 0xE7, then the following byte specifies a command for the correct handling of this block. Value Following payload length meaning 0xE7 blocksize This block really does start with 0xE7. It was just nessicary to escape it. 0x01 4 This block is a duplicate of the block identified in the following unsigned 32-bit integer 0x02 8 As with 0x01, except with a 64-bit integer. This should only ever be encountered for files of length >2TB. 0x03 0 This block is null. Output 512 nulls. 0x04 4+(n*blocksize) Unescaped data follows. 32-bit int specifies number of blocks. This is not supported by the reference encoder. 0x05 0 This block is a duplicate sourced from the block immediatly following the last block used as a reference. In an encoded file, this does mean potentially very long strings of paired 0xE705 characters - conventional compression will reduce them. 0x06 4 End of file marker. Followed by at least four bytes, usually zero, for future use in adding 'tail' fields. Optional.