ANI
application/octet-stream
Magic Bytes
Offset: 0
52 49 46 46 41 43 4F 4E
The Windows Animated Cursor (ANI) is a specialized graphics container format developed by Microsoft for the Windows operating system. It is primarily used to display animated mouse pointers that provide visual feedback for system processes, such as loading or background tasks. While based on the legacy Resource Interchange File Format (RIFF) standard, it remains natively supported in modern versions of Windows and is generally considered a safe format for interface customization.
Validation Code
How to validate .ani files in Python
Python
def is_ani(file_path: str) -> bool:
"""Check if file is a valid ANI by magic bytes."""
signature = bytes([0x52, 0x49, 0x46, 0x46, 0x41, 0x43, 0x4F, 0x4E])
with open(file_path, "rb") as f:
return f.read(8) == signature
How to validate .ani files in Node.js
Node.js
function isANI(buffer: Buffer): boolean {
const signature = Buffer.from([0x52, 0x49, 0x46, 0x46, 0x41, 0x43, 0x4F, 0x4E]);
return buffer.subarray(0, 8).equals(signature);
}
Go
func IsANI(data []byte) bool {
signature := []byte{0x52, 0x49, 0x46, 0x46, 0x41, 0x43, 0x4F, 0x4E}
if len(data) < 8 {
return false
}
return bytes.Equal(data[:8], signature)
}
API Endpoint
GET
/api/v1/ani
curl https://filesignature.org/api/v1/ani