The Comments block in an XRH file begins with a 4-byte start-of-comments marker, followed with a Size integer, followed with a Count integer, followed with optional ASCII comments, and ending with an end-of-comments marker.
The first four bytes of the Comments block stores the value 0x534F4300 (ASCII string SOC\0) which marks the start-of-comments.
Start of Comments Marker: SOC\0
The Size integer immediately follows. It is a 32-bit integer that specifies the total size (number of bytes) of the entire Comments block including Size integer and the start-of-comments marker.
The Count integer follows. It is a 32-bit integer that specifies how many comments there are. That is followed with that many comments. The Count integer may be zero, in which case there are no comments.
Comments must be ASCII text. To store comments that are not ASCII text, use Custom Properties instead of Comments.
Each comment is essentially a key/value pair: each key is an ASCII text string specifying the title of the comment; each value is an ASCII text string specifying the comment. Each ASCII text string includes a zero (null) terminating byte as the last byte of the string. The null terminating byte is always stored with the string.
Each key begins with a 32-bit integer specifying how many characters (bytes) the title of the comment has, followed by that many ASCII characters (including the terminating null byte) that are the title of the comment.
Each value begins with a 32-bit integer that specifies how many characters (bytes) there are in the comment, followed by that many ASCII characters which are the comment (including the terminating null byte).
After the last comment, 4 bytes that store 0x454F4300 (ASCII string EOC\0) mark the end of the Comments block.
End of Comments Marker: EOC\0
The shortest possible Comments block, for no comments, would be 16 bytes. In that case, the first four bytes of the Comments block would be the start-of-comments marker, followed with a 4-byte integer equal to 16 (the total size of the Comments block), followed with a 4-byte integer equal to zero indicating there was zero comments in the Comments block, and the last four bytes storing the end-of-comments marker.