Skip to content

Program Information File (Windows DOS shortcut) magic bytes (.pif)

.pif file signature: 00 | application/octet-stream

Program Information File (PIF) is a Microsoft file format used by Windows to store configuration data for launching MS-DOS applications and shortcuts. It was used to define execution settings such as window behavior, memory requirements, and working directories for older programs. PIF files are a legacy format and can be associated with executable content, so files from untrusted sources should be handled carefully.

High

Magic Bytes

Offset 0
00

Sources: Wikipedia: Program information file

Validation Code

How to validate .pif files in Python

Python
def is_pif(file_path: str) -> bool:
    """Check if file is a valid PIF by magic bytes."""
    signature = bytes([0x00])
    with open(file_path, "rb") as f:
        return f.read(1) == signature

How to validate .pif files in Node.js

Node.js
function isPIF(buffer: Buffer): boolean {
  const signature = Buffer.from([0x00]);
  return buffer.subarray(0, 1).equals(signature);
}

How to validate .pif files in Go

Go
func IsPIF(data []byte) bool {
    signature := []byte{0x00}
    if len(data) < 1 {
        return false
    }
    return bytes.Equal(data[:1], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .pif file?

A .pif file is a Program Information File (Windows DOS shortcut) file. Program Information File (PIF) is a Microsoft file format used by Windows to store configuration data for launching MS-DOS applications and shortcuts. It was used to define execution settings such as window behavior, memory requirements, and working directories for older programs. PIF files are a legacy format and can be associated with executable content, so files from untrusted sources should be handled carefully.

What are the magic bytes for .pif files?

The magic bytes for Program Information File (Windows DOS shortcut) (.pif) files are 00 at byte offset 0. These bytes identify the file format more reliably than the extension alone.

How do I validate a .pif file?

To validate a .pif file, read the first bytes of the file and compare them against the known magic bytes (00) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .pif files?

There is no officially registered MIME type for .pif files. Systems typically use application/octet-stream as a generic fallback when handling this format.

Is it safe to open .pif files?

Program Information File (Windows DOS shortcut) (.pif) files are high risk because they can contain executable code. Never open .pif files from untrusted sources. Always scan with antivirus software, verify the source, and consider running in a sandboxed environment.