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:WIM

From ReverseEngineering.wiki
Format
On this wiki Facts · Code · Notes · Topics

Windows Imaging format (.wim, .esd, .swm): magic 'MSWIM\0\0\0' and a 208-byte header whose flags name the compression (XPRESS 0x20000, LZX 0x40000, LZMS 0x80000) and chunk size; resources are compressed in chunks.

The WIM container used by Windows setup, WinPE and DISM. Documentation of the on-disk header here is from wimlib (LGPL-3.0-or-later), include/wimlib/header.h.

Header (208 bytes)

Magic 4D 53 57 49 4D 00 00 00 ('MSWIM' plus three zero bytes) at 0; wimlib's own pipable variant uses 'WLPWM'. Fields: +0x08 header size (208), +0x0C version, +0x10 flags, +0x14 chunk size (0 if uncompressed), +0x18 GUID (16 bytes), +0x28 part number (u16), +0x2A total parts (u16), +0x2C image count, then four 24-byte resource headers: blob (lookup) table at +0x30, XML data +0x48, boot metadata +0x60, then boot index at +0x78 and the integrity table header at +0x7C (4-byte aligned, so the structure is packed), 60 unused bytes to +0xD0. See Fact:WIM/struct/WIM header.

Versions and flags

  • Version 0x10D00 is the default (every blob compressed independently); version 0xE00 allows solid resources (several blobs in one compressed resource) and LZMS, new in Windows 8 WIMGAPI (header.h lines 15-22). wimlib notes a further pre-release Vista version that it does not support.
  • Header flags: 0x20000 XPRESS, 0x40000 LZX, 0x80000 LZMS (header.h lines 184-194); wimlib also names 0x200000 as 'XPRESS, with small chunk size???', a guess.

Compression per chunk

Resources are cut into chunks of chunk_size bytes (32768 is the usual value for XPRESS and LZX; Unverified for other sizes) and each chunk compressed independently. Format:Xpress here means the LZ77+Huffman variant; Format:LZX in WIM always uses E8 translation with the fixed file size 12000000 and has no per-stream header bit; Format:LZMS is used for solid resources.

Identification

MSWIM\0\0\0 at offset 0; also found in .esd/.swm files and appended in some installers. Unverified: install.wim in Windows ISOs may also be stored as install.esd.

Code & repositories

  • https://github.com/ebiggers/wimlib @ cd5e231c348c255ae5088873b5a66ee0eb96fa07 · license: LGPL-3.0-or-later OR GPL-3.0-or-later (declared by the contributor; GitHub's detector did not recognize COPYING)
    wimlib: WIM header (include/wimlib/header.h) and the LZMS decoder (src/lzms_decompress.c, include/wimlib/lzms_constants.h) with long explanatory comments.
    Tested on: source read, not run · checked 2026-10-19; last activity 2026-01-30