Executable

application/vnd.microsoft.portable-executable

High
⚠️

High Risk Format

This file type can contain executable code. Always validate source and scan with antivirus before opening.

Magic Bytes

Offset: 0
4D 5A

The Executable file format is a binary standard developed by Microsoft for running programs on MS-DOS and Windows operating systems. It serves as the primary container for desktop applications, system utilities, and software installers by encapsulating compiled machine code and required resources. Although originally introduced for DOS, modern versions use the Portable Executable structure; because these files trigger arbitrary code execution, they remain a high-risk vector for malware.

Extension

.exe

MIME Type

application/vnd.microsoft.portable-executable

Byte Offset

0

Risk Level

High

Validation Code

How to validate .exe files in Python

Python
def is_exe(file_path: str) -> bool:
    """Check if file is a valid EXE by magic bytes."""
    signature = bytes([0x4D, 0x5A])
    with open(file_path, "rb") as f:
        return f.read(2) == signature

How to validate .exe files in Node.js

Node.js
function isEXE(buffer: Buffer): boolean {
  const signature = Buffer.from([0x4D, 0x5A]);
  return buffer.subarray(0, 2).equals(signature);
}
Go
func IsEXE(data []byte) bool {
    signature := []byte{0x4D, 0x5A}
    if len(data) < 2 {
        return false
    }
    return bytes.Equal(data[:2], signature)
}

API Endpoint

GET /api/v1/exe
curl https://filesignature.org/api/v1/exe

Related Formats