Microsoft Write file
application/x-mswrite
Magic Bytes
Offset: 0
31 BE 00 00
The Microsoft Write (WRI) file format is a legacy word processing document type developed by Microsoft for early Windows environments. It functioned as the native format for the Microsoft Write application, enabling text formatting and basic document creation before WordPad and Word became industry standards. Although primarily obsolete, contemporary word processors retain compatibility with the format, which is generally considered safe as it lacks support for complex executable scripts or macro-based vulnerabilities.
Validation Code
How to validate .wri files in Python
Python
def is_wri(file_path: str) -> bool:
"""Check if file is a valid WRI by magic bytes."""
signature = bytes([0x31, 0xBE, 0x00, 0x00])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .wri files in Node.js
Node.js
function isWRI(buffer: Buffer): boolean {
const signature = Buffer.from([0x31, 0xBE, 0x00, 0x00]);
return buffer.subarray(0, 4).equals(signature);
}
Go
func IsWRI(data []byte) bool {
signature := []byte{0x31, 0xBE, 0x00, 0x00}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
GET
/api/v1/wri
curl https://filesignature.org/api/v1/wri