Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Outlook PST and OST (PFF)

From ReverseEngineering.wiki
Format
Magic 21 42 44 4E (!BDN)
Extensions .pst, .ost, .pab
Endianness little
On this wiki Facts · Code · Notes · Topics

Microsoft Outlook's Personal Folder File: PST, OST and PAB files start with '!BDN', carry a data version (14/15 ANSI, 21/23 Unicode, 36 Unicode with 4096-byte pages), a one-byte encryption type (none, permute, cyclic) and an NDB layer of B-trees of nodes and blocks.

The Personal Folder File (PFF) family is what Outlook uses for .pst (personal store), .ost (offline cache of Exchange or Microsoft 365 mailboxes) and .pab (personal address book). The open specification is [MS-PST]; the notes below come from the libyal libpff documentation (documentation/Personal Folder File (PFF) format.asciidoc), which quotes [MS-PST] names, and from libpff source. The file is a database, not a text store: do not look for message text with strings alone, because data blocks may be obfuscated (see Encryption type).

Identification

  • Magic 21 42 44 4E (!BDN) at offset 0, followed by a 4-byte weak CRC32 of the following bytes.
  • Offset 8, 2 bytes: content type (client signature) 53 4D (SM) = PST, 53 4F (SO) = OST, 41 42 (AB) = PAB. libpff rejects any other value.
  • Offset 10, 2 bytes, little endian: data version (the NDB version). 14 and 15 = 32-bit ANSI format; 21 = 64-bit Unicode (by Visual Recovery); 23 = 64-bit Unicode; 36 = 64-bit Unicode with 4096-byte pages (the Outlook 2013 style OST). libpff maps data version <= 0x0f to the 32-bit type, >= 0x15 to 64-bit and >= 0x24 to 64-bit with 4k pages.
  • Offset 12: content version (client version), offsets 14 and 15: creation and access platform (0x01 per the spec; 0x02 was seen in scanpst-recovered files).
  • The remaining header differs by width: the encryption type byte sits at offset 461 in the 32-bit header and at offset 513 in the 64-bit header (libpff documentation).

Encryption type (obfuscation, not protection)

One header byte: 0x00 none, 0x01 permute (NDB_CRYPT_PERMUTE; libpff calls it compressible), 0x02 cyclic (NDB_CRYPT_CYCLIC; libpff calls it high). Both are fixed substitution tables, not password protection: libpff's libpff_encryption.c holds the tables, type 1 maps each byte through one 256-byte table, and type 2 combines three tables with a salt derived from a 32-bit key (the two 16-bit halves XORed, then incremented for every byte). Only raw data blocks (those with the external bit set in the block index entry) are encoded; libpff notes some ExMerge-created files claim type none but still contain permuted data. A password on a PST is a separate property inside the store and is not covered here (Unverified: how it is stored; do not rely on this page for bypassing it).

Layers

Recognition-level map (names from [MS-PST]):

  • NDB (node database): fixed-size pages (512 bytes; 4096 in the 4k variant) with a footer holding page type (0x80 BBT offset index node, 0x81 NBT descriptor index node, 0x82 free map, 0x83 page map, 0x84 allocation map, 0x85 free page map, 0x86 density list), the page type repeated, a signature, a weak CRC32 and a back pointer. Two B-trees: the block B-tree (BBT, offset index: block id to file offset and size) and the node B-tree (NBT, descriptor index: node id to data block and subnode block). Blocks are at most 8192 bytes (8176 data) and large values use XBLOCK/XXBLOCK arrays; SLBLOCK/SIBLOCK hold sub-node (local descriptor) trees.
  • Node id types (low 5 bits of a node id): 0x02 normal folder, 0x03 search folder, 0x04 normal message, 0x05 attachment, 0x08 associated message, 0x0D hierarchy table, 0x0E contents table, 0x11 attachment table, 0x12 recipient table, 0x1F LTP local descriptor value.
  • 4k variant: the page footer is at offset 4072, and blocks may be compressed with deflate (RFC 1951); the compressed size is what the index entry stores. libpff's documentation leaves open whether encryption comes before compression.
  • LTP (lists, tables, properties) on top of NDB: heap-on-node, BTree-on-heap, property contexts and table contexts hold folders, messages and their MAPI properties. Unverified: layout details of HN/BTH/PC/TC are not covered here; read [MS-PST] sections 2.3.
  • Messaging layer: well-known nodes (message store, root folder, name-to-id map) are fixed node ids per [MS-PST]. Unverified here.

Related stores

Messages exported singly are Format:Outlook MSG files (a Format:Compound File Binary). See Technique:Identifying mail and message stores.

Tools

libpff (pffinfo, pffexport, pffrecover; LGPL-3). Recovery mode of libpff handles files with missing index pages.

Code & repositories

  • https://github.com/libyal/libpff @ f92780abd5e1225fd5b028b4f25316643f154daa · license: LGPL-3.0-or-later (declared by the contributor; GitHub's detector did not recognize COPYING)
    libyal library and tools (pffinfo, pffexport) for PFF/PST/OST/PAB; documentation/Personal Folder File (PFF) format.asciidoc is a full file format specification with the [MS-PST] names.
    Tested on: source read, not run: source and documentation read, not run · checked 2026-10-19