Skip to content

What is @blamnetwork/blf?

@blamnetwork/blf is a TypeScript implementation of the blf_lib Rust crate for reading and writing Halo BLF chunks for things like Map Variants and Gametypes.

What is a BLF?

BLF is a chunk-based format, similar to Material Exchange Format (MXF). These files consist of BLF chunks: regions of data labelled with a 12-byte header including the chunk name, version, and length, allowing readers to seek through the file until they find the chunk they are looking for.

Generally, BLF files include a _blf start-of-file chunk and a _eof end-of-file chunk. Some readers check or assert that these chunks are present, though the format is still readable without them.

To my knowledge, Bungie have never shared the meaning of the BLF acronym; the name is probably short for Blam file.

BLF chunk header

OffsetLengthName
0x04Chunk signature
0x44Chunk length
0x82Major version
0xA2Minor version

When using this library, pass "big" or "little" as the payload endian to find_chunk / search_for_chunk. BLF chunk headers are typically big-endian; the argument controls how the chunk body is read or written. Most of the time BLF chunks are big-endian but little-endian chunks have been observed on occasion, usually with PC halo builds.

What this package provides

  • Version bundles — import @blamnetwork/blf/<game>/<build_id> for structures for a given Title and Build.
  • Chunk I/OReading (find_chunk, search_for_chunk) and writing (write_blffile, per-chunk write) BLF chunks and files.
  • Bitstream — Halo-style reader/writer for reading bit-packed data (Bitstream).
  • Helpers — Helper functions implemented by Blam Network to assist in common BLF tasks such as converting chunks between Builds.

Struct layouts are built with @craftycodie/cstruct, which npm installs automatically as a dependency of @blamnetwork/blf.

Get started

See Install & quick start.

Release history: Changelog.