Hamarsoft HAP 3
application/octet-stream
Magic Bytes
Offset: 0
95 00
Hamarsoft HAP 3 is a legacy file compression and archiving format developed by Hamarsoft in the early 1990s. It was primarily utilized in the MS-DOS environment to bundle multiple files into a single compressed archive for storage efficiency and distribution. As an obsolete archive format not supported by modern operating systems natively, it requires specialized retro-computing tools for extraction and generally poses minimal security risks.
Validation Code
How to validate .hap files in Python
Python
def is_hap(file_path: str) -> bool:
"""Check if file is a valid HAP by magic bytes."""
signature = bytes([0x95, 0x00])
with open(file_path, "rb") as f:
return f.read(2) == signature
How to validate .hap files in Node.js
Node.js
function isHAP(buffer: Buffer): boolean {
const signature = Buffer.from([0x95, 0x00]);
return buffer.subarray(0, 2).equals(signature);
}
Go
func IsHAP(data []byte) bool {
signature := []byte{0x95, 0x00}
if len(data) < 2 {
return false
}
return bytes.Equal(data[:2], signature)
}
API Endpoint
GET
/api/v1/hap
curl https://filesignature.org/api/v1/hap