AC:NH > BCSV

A BCSV file contains a table of information in a compact binary format.

A BCSV file contains three parts:

Everything is encoded in little-endian byte order.

OffsetSizeDescription
0x04Number of rows
0x44Size of each row
0x82Number of columns
0xA1Has extended header
0xB1Unknown flag

If the extended header flag is set:

OffsetSizeDescription
0xC4Magic number (BCSV in reverse)
0x102Version number
0x1210Padding

Column Info

This section contains the following data for each column:

OffsetSizeDescription
0x04Hash of column name and type
0x44Offset to cell data in row

The hash is the CRC32 of <name> <type>, for example UniqueID u16.

Unfortunately, the actual column names are not stored in the file, which makes them difficult to recover. Similarly, it is difficult to determine the type, but it can sometimes be guessed by checking the data size.

Rows

Every row contains the following data:

OffsetSizeDescription
0x04Offset of row relative to start of file
0x4Cell data

Although the offset seems redundant, it is important to the parser. The parser uses it to find the start of the BCSV file, given a pointer to a row.

The format of the cell data depends on the columns that are specified in the column info.