;The Header
;0000: char[4] 'ITSF'
;0004: DWORD 3 (Version number)
;0008: DWORD Total header length, including header section table And following Data.
;000C: DWORD 1 (unknown)
;0010: DWORD a timestamp
;0014: DWORD Windows Language ID
;0018: GUID {7C01FD10-7BAA-11D0-9E0C-00A0-C922-E6EC}
;0028: GUID {7C01FD11-7BAA-11D0-9E0C-00A0-C922-E6EC} Note: a GUID is $10 bytes, arranged As 1 DWORD, 2 WORDs, And 8 BYTEs.
;0000: QWORD Offset of section from beginning of file
;0008: QWORD Length of section Following the header section table is 8 bytes of additional header Data. In Version 2 files, this Data is Not there And the content section starts immediately after the directory.
;//translated.by/you/microsoft-s-html-help-chm-format-incomplete/original /?show-translation-form=1
;Directory header The directory starts With a header; its format is as follows:
;0000: char[4] 'ITSP'
;0004: DWORD Version number 1
;0008: DWORD Length of the directory header
;000C: DWORD $0a (unknown)
;0010: DWORD $1000 Directory chunk size
;0014: DWORD "Density" of quickref section, usually 2
;0018: DWORD Depth of the index tree - 1 there is no index, 2 If there is one level of PMGI chunks
;001C: DWORD Chunk number of root index chunk, -1 If there is none (though at least one file has 0 despite there being no index chunk, probably a bug)
;0020: DWORD Chunk number of first PMGL (listing) chunk
;0024: DWORD Chunk number of last PMGL (listing) chunk
;0028: DWORD -1 (unknown)
;002C: DWORD Number of directory chunks (total)
;0030: DWORD Windows language ID
;0034: GUID {5D02926A-212E-11D0-9DF9-00A0C922E6EC}
;0044: DWORD $54 (This is the length again)
;0048: DWORD -1 (unknown)
;004C: DWORD -1 (unknown)
;0050: DWORD -1 (unknown)
;//translated.by/you/microsoft-s-html-help-chm-format-incomplete/original /?show-translation-form=1
;Description There are two types of directory chunks -- index chunks, And listing chunks.
;The index chunk will be omitted If there is only one listing chunk.
;A listing chunk has the following format:
;0000: char[4] 'PMGL' 0004: DWORD Length of free space And/Or quickref area at End of directory chunk
;0008: DWORD Always 0
;000C: DWORD Chunk number of previous listing chunk when reading directory in sequence (-1 If this is the first listing chunk)
;0010: DWORD Chunk number of Next listing chunk when reading directory in sequence (-1 If this is the last listing chunk)
;0014: Directory listing entries (To quickref area) Sorted by filename; the sort is case-insensitive The quickref area is written backwards from the end of the chunk. One quickref entry exists for every n entries in the file, where n is calculated as 1 + (1 << quickref density). So for density = 2, n = 5 Chunklen-0002: WORD Number of entries in the chunk Chunklen-0004: WORD Offset of entry n from entry 0 Chunklen-0008: WORD Offset of entry 2n from entry 0 Chunklen-000C: WORD Offset of entry 3n from entry 0 ... The format of a directory listing entry is as follows BYTE: length of name BYTEs: name (UTF-8 encoded) ENCINT: content section ENCINT: offset ENCINT: length The offset is from the beginning of the content section the file is in, after the section has been decompressed (if appropriate). The length also refers to length of the file in the section after decompression. There are two kinds of file represented in the directory: user data and format related files. The files which are format-related have names which begin with '::', the user data files have names which begin with "/".
;//translated.by/you/microsoft-s-html-help-chm-format-incomplete/original /?show-translation-form=1
;Description Note: Not always exists An index chunk has the following format:
;0000: char[4] 'PMGI'
;0004: DWORD Length of quickref/free area at End of directory chunk
;0008: Directory index entries (To quickref/free area) The quickref area in an PMGI is the same As in an PMGL The format of a directory index entry is As follows: BYTE: length of name BYTEs: name (UTF-8 encoded) ENCINT: directory listing chunk which starts With name Encoded Integers aka ENCINT An ENCINT is a variable-length integer. The high bit of each byte indicates "continued to the next byte". Bytes are stored most significant To least significant. So, For example, $EA $15 is (((0xEA&0x7F)<<7)|0x15) = 0x3515.
;Note: This class is Not in use
http://translated.by/you/microsoft-s-ht ... ion-form=1
;DataSpace/Storage//ControlData This file contains $20 bytes of information on the compression.
;The information is partially known:
;0000: DWORD 6 (unknown)
;0004: ASCII 'LZXC' Compression type identifier
;0008: DWORD 2 (Possibly numeric code For LZX)
;000C: DWORD The Huffman reset interval in $8000-byte blocks
;0010: DWORD The window size in $8000-byte blocks
;0014: DWORD unknown (sometimes 2, sometimes 1, sometimes 0)
;0018: DWORD 0 (unknown)
;001C: DWORD 0 (unknown)
;//translated.by/you/microsoft-s-html-help-chm-format-incomplete/original /?page=2