MPX
application/x-project
Magic Bytes
Offset: 0
4D 50 58 2C 4D 69 63 72 6F 73 6F 66 74 20 50 72 6F 6A 65 63 74 20 66 6F 72 20 57 69 6E 64 6F 77 73 2C
The Microsoft Project Exchange (MPX) format is a legacy ASCII text-based file standard developed by Microsoft for data interchange. It facilitated the transfer of project management information, including tasks, resources, and calendars, between different versions of Microsoft Project and third-party software. Although largely superseded by XML and binary formats in modern project management tools, it remains viewable in older software versions and text editors.
Validation Code
How to validate .mpx files in Python
Python
def is_mpx(file_path: str) -> bool:
"""Check if file is a valid MPX by magic bytes."""
signature = bytes([0x4D, 0x50, 0x58, 0x2C, 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x2C])
with open(file_path, "rb") as f:
return f.read(34) == signature
How to validate .mpx files in Node.js
Node.js
function isMPX(buffer: Buffer): boolean {
const signature = Buffer.from([0x4D, 0x50, 0x58, 0x2C, 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x2C]);
return buffer.subarray(0, 34).equals(signature);
}
Go
func IsMPX(data []byte) bool {
signature := []byte{0x4D, 0x50, 0x58, 0x2C, 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x50, 0x72, 0x6F, 0x6A, 0x65, 0x63, 0x74, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x2C}
if len(data) < 34 {
return false
}
return bytes.Equal(data[:34], signature)
}
API Endpoint
GET
/api/v1/mpx
curl https://filesignature.org/api/v1/mpx