Microsoft Windows Imaging Format file
application/octet-stream
Magic Bytes
Offset: 0
4D 53 57 49 4D 00 00 00 D0 00 00 00 00
Microsoft Windows Imaging Format (WIM) is a file-based disk image format developed and maintained by Microsoft for the Windows environment. It is primarily utilized for the deployment of the Windows operating system, management of installation images, and system recovery through administrative tools like DISM. Although generally considered safe, these compressed archives can contain bootable environments and executable files that require verified sources to ensure the integrity of the target system.
Validation Code
How to validate .wim files in Python
Python
def is_wim(file_path: str) -> bool:
"""Check if file is a valid WIM by magic bytes."""
signature = bytes([0x4D, 0x53, 0x57, 0x49, 0x4D, 0x00, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x00, 0x00])
with open(file_path, "rb") as f:
return f.read(13) == signature
How to validate .wim files in Node.js
Node.js
function isWIM(buffer: Buffer): boolean {
const signature = Buffer.from([0x4D, 0x53, 0x57, 0x49, 0x4D, 0x00, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x00, 0x00]);
return buffer.subarray(0, 13).equals(signature);
}
Go
func IsWIM(data []byte) bool {
signature := []byte{0x4D, 0x53, 0x57, 0x49, 0x4D, 0x00, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x00, 0x00}
if len(data) < 13 {
return false
}
return bytes.Equal(data[:13], signature)
}
API Endpoint
GET
/api/v1/wim
curl https://filesignature.org/api/v1/wim