XLW
application/vnd.ms-excel
Magic Bytes
Offset: 2080
4D 69 63 72 6F 73 6F 66 74 20 45 78 63 65 6C 20 35 2E 30 20 57 6F 72 6B 73 68 65 65 74
XLW is a proprietary spreadsheet workspace format created by Microsoft for use with the Excel spreadsheet application. It serves to store a collection of workbook and sheet configurations, allowing users to restore the exact window layout and open files from a previous session simultaneously. As a legacy binary format superseded by modern XML-based standards, it is now largely obsolete, though users should remain cautious when opening files from untrusted sources due to potential risks associated with binary data.
Validation Code
How to validate .xlw files in Python
Python
def is_xlw(file_path: str) -> bool:
"""
Check if file is a valid XLW by magic bytes.
Signature offset: 2080 bytes
"""
signature = bytes([0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6C, 0x20, 0x35, 0x2E, 0x30, 0x20, 0x57, 0x6F, 0x72, 0x6B, 0x73, 0x68, 0x65, 0x65, 0x74])
with open(file_path, "rb") as f:
f.seek(2080)
return f.read(29) == signature
How to validate .xlw files in Node.js
Node.js
function isXLW(buffer: Buffer): boolean {
// Signature offset: 2080 bytes
const signature = Buffer.from([0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6C, 0x20, 0x35, 0x2E, 0x30, 0x20, 0x57, 0x6F, 0x72, 0x6B, 0x73, 0x68, 0x65, 0x65, 0x74]);
if (buffer.length < 2109) return false;
return buffer.subarray(2080, 2109).equals(signature);
}
Go
func IsXLW(data []byte) bool {
// Signature offset: 2080 bytes
signature := []byte{0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x45, 0x78, 0x63, 0x65, 0x6C, 0x20, 0x35, 0x2E, 0x30, 0x20, 0x57, 0x6F, 0x72, 0x6B, 0x73, 0x68, 0x65, 0x65, 0x74}
if len(data) < 2109 {
return false
}
return bytes.Equal(data[2080:2109], signature)
}
API Endpoint
GET
/api/v1/xlw
curl https://filesignature.org/api/v1/xlw