Skip to content

Windows prefetch file magic bytes (.pf)

.pf file signature: 53 43 43 41 | application/octet-stream

Windows Prefetch files are system-generated cache files created and maintained by Microsoft Windows to record application startup behavior. They are used by the operating system to improve program launch performance and are also examined by forensic tools to reconstruct recent application activity. These files are generally safe, but they may reveal usage patterns and are version-dependent, with internal structure varying across Windows releases.

Safe

Magic Bytes

Offset 4
53 43 43 41

Sources: Gary Kessler

Validation Code

How to validate .pf files in Python

Python
def is_pf(file_path: str) -> bool:
    """Check if file is a valid PF by magic bytes at offset 4."""
    signature = bytes([0x53, 0x43, 0x43, 0x41])
    with open(file_path, "rb") as f:
        f.seek(4)
        return f.read(4) == signature

How to validate .pf files in Node.js

Node.js
function isPF(buffer: Buffer): boolean {
  const signature = Buffer.from([0x53, 0x43, 0x43, 0x41]);
  if (buffer.length < 8) return false;
  return buffer.subarray(4, 8).equals(signature);
}

How to validate .pf files in Go

Go
func IsPF(data []byte) bool {
    signature := []byte{0x53, 0x43, 0x43, 0x41}
    if len(data) < 8 {
        return false
    }
    return bytes.Equal(data[4:8], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .pf file?

A .pf file is a Windows prefetch file. Windows Prefetch files are system-generated cache files created and maintained by Microsoft Windows to record application startup behavior. They are used by the operating system to improve program launch performance and are also examined by forensic tools to reconstruct recent application activity. These files are generally safe, but they may reveal usage patterns and are version-dependent, with internal structure varying across Windows releases.

What are the magic bytes for .pf files?

The magic bytes for Windows prefetch file (.pf) files are 53 43 43 41 at byte offset 4. These bytes identify the file format more reliably than the extension alone.

How do I validate a .pf file?

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

What is the MIME type for .pf files?

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

Is it safe to open .pf files?

Windows prefetch file (.pf) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.