WIM (Windows Imaging Format)

WIM is a file-based disk image format from Microsoft. Windows Vista and later install from install.wim, and it is used by Windows PE and recovery images and by deployment tools such as DISM. It stores compressed files with single-instance data, so it works as an archive of a volume rather than a block-level image.

Overview

A WIM archive holds one or more images, each a file tree, in compressed resources. A header (signature MSWIM) locates the lookup (blob) table, XML metadata and boot index. Files are single-instanced by SHA-1 hash, so identical content is stored once across images. Compression types are XPRESS, LZX and LZMS.

History

  • Introduced with Windows Vista (2006) and its ImageX tool.
  • ESD (LZMS-compressed) images were added with Windows 8.

Structures

Offsets are in bytes from the start of the structure named in each heading. Field names are descriptive and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.

Read Chunk Table

OffsetSizeTypeFieldNotes
(int)((i – 1) * 4)4u32 LE–
(int)((i – 1) * 8)8u64 LE–

Wim Archive

OffsetSizeTypeFieldNotes
0x182u16 LEBlob
0x1A4u32 LE–
0x1E20bytes–

Parse

OffsetSizeTypeFieldNotes
0x84u32 LE–
0xC4u32 LEVersion
0x104u32 LEFlags
0x144u32 LEChunk Size
0x1816bytesGuid
0x282u16 LEPart Number
0x2A2u16 LETotal Parts
0x2C4u32 LEImage Count
0x784u32 LEBoot Index

Parse

OffsetSizeTypeFieldNotes
0x08u64 LEFirst
0x88u64 LE–
0x108u64 LE–

Link Target

OffsetSizeTypeFieldNotes
0x02u16 LESubstitute Offset
0x22u16 LESubstitute Length
0x42u16 LEPrint Offset
0x62u16 LEPrint Length

Read Entry

OffsetSizeTypeFieldNotes
0x08u64 LEEntry Length
0x1020bytesHash
0x242u16 LEStream Name Bytes

Read Entry

OffsetSizeTypeFieldNotes
0x08u64 LELength
0x84u32 LEAttributes
0x108u64 LESubdir
0x288u64 LECreated
0x308u64 LEAccessed
0x388u64 LEModified
0x4020bytesAin Hash
0x584u32 LEReparse Tag
0x588u64 LEHard Link Group
0x602u16 LEExtra Streams
0x622u16 LEShort Name Bytes
0x642u16 LEName Bytes

Other fields read

Read inOffsetSizeTypeFieldNotes
Parse Tree0x04u32 LESecurity Length
Probe0x08bytes–

Constants

Struct

NameValueTypeNotes
FlagFree0x01byte
FlagMetadata0x02byte
FlagCompressed0x04byte
FlagSpanned0x08byte
FlagSolid0x10byte
Size24int

Wim Header

NameValueTypeNotes
Size208int

Wim File System

NameValueTypeNotes
DentrySize102int
StreamEntrySize38int

Implementation limits

ClassNameValueNotes
Wim ArchiveMaxTableBytes256 * 1024 * 1024
Wim File SystemMaxDepth1024

Wim Compression

NameValue
None(next)
Xpress(next)
Lzx(next)
Lzms(next)

Signatures and magic strings referenced

TextWhere checked
MSWIM\0\0\0Parse
WLPWM\0\0\0Parse
Structures and constants were extracted from the implementation. Prose sections are a summary from public sources; verify details before relying on them.