Nodes
The extents tree (also called the extents overflow file, file number 3) is a B-tree made exactly like the catalog tree: 512-byte nodes, a header node 0, index nodes, leaf nodes chained by their links. Its first three extents are in the MDB (drXTExtRec); it has none of its own overflow. A volume where no file has more than three extents has a header node and no leaf records (the blank volume: depth 0, no records, 12 blocks reserved).
Keys and records
A catalog file record holds only the first three extents of each fork. A fork in more pieces has its later extents here, three to a record. The key is 8 bytes: a key length (7), the fork type (0 for the data fork, 0xFF for the resource fork), the file number (4 bytes) and the first file block (2 bytes): the position, counted in allocation blocks from the start of the fork, of the first block of the record's first extent. The data is 12 bytes: three extents, each a start (16 bits) and a count (16 bits); an unused extent has a count of 0. Records are sorted by file number, fork type and first file block.
To read a fork: take the three extents of the catalog record, add up their counts to get the next first file block, look for the key (fork, file number, that block) in this tree, take its extents, and go on until the fork's physical length is covered. The viewer does this for every file; the extents it follows must add up to the fork's length and no allocation block may belong to two forks (problems are reported otherwise).
Checked on the second real volume: the extents tree has 6 leaf records, which belong to the two 38-block files chunks1 and chunks2, each in 10 extents of 4 blocks (the last, 2): three extents in the catalog record and the other seven in two records here (three in the first, three in the second and one in a third). The two files' extents interleave in the volume, and reading them gives different contents. A writer in the test builds a file of five extents (two here) and reads it back byte for byte.