SWM
application/octet-stream
Magic Bytes
Offset: 0
4D 53 57 49 4D 00 00 00 D0 00 00 00 00
SWM (Split Windows Imaging Format) is a file format created and maintained by Microsoft as a partitioned variant of the standard Windows Imaging (WIM) format. It is primarily used to store large disk images across multiple smaller volumes, facilitating distribution on size-restricted media such as DVDs or FAT32-formatted USB drives. As a read-only archive format, it is considered safe for deployment, though it has largely been superseded by single-file WIM images in modern high-capacity environments.
Validation Code
How to validate .swm files in Python
Python
def is_swm(file_path: str) -> bool:
"""Check if file is a valid SWM 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 .swm files in Node.js
Node.js
function isSWM(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 IsSWM(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/swm
curl https://filesignature.org/api/v1/swm