{"success":true,"data":{"ext":"pch","name":"Visual C PreCompiled header file","description":"A Visual C++ Precompiled Header file (PCH) is a file format created and maintained by Microsoft for use with the Visual C++ toolchain. It is used to store parsed header information so that large C and C++ projects can compile more quickly in Visual Studio and related build systems. The format is generally safe, though it is a build artifact rather than a document file and may be regenerated or incompatible across compiler versions.","mime":[],"risk_level":"Safe","signatures":[{"hex":"43 50 43 48","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"56 43 50 43 48 30","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["ctl","dsw","suo","vcw","dsp"],"usage":{"python":"def is_pch(file_path: str) -> bool:\n    \"\"\"Check if file is a valid PCH by magic bytes.\"\"\"\n    signature = bytes([0x43, 0x50, 0x43, 0x48])\n    with open(file_path, \"rb\") as f:\n        return f.read(4) == signature","node":"function isPCH(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x43, 0x50, 0x43, 0x48]);\n  return buffer.subarray(0, 4).equals(signature);\n}","go":"func IsPCH(data []byte) bool {\n    signature := []byte{0x43, 0x50, 0x43, 0x48}\n    if len(data) < 4 {\n        return false\n    }\n    return bytes.Equal(data[:4], signature)\n}"},"category":"Source Code"}}