h2non / filetype

Fast, dependency-free Go package to infer binary file types based on the magic numbers header signature
https://pkg.go.dev/github.com/h2non/filetype?tab=doc
MIT License
2.13k stars 177 forks source link

Why ppt matcher return false for a ppt file #118

Open guojin-bupt opened 2 years ago

guojin-bupt commented 2 years ago

func Ppt(buf []byte) bool { if len(buf) > 513 { return buf[0] == 0xD0 && buf[1] == 0xCF && buf[2] == 0x11 && buf[3] == 0xE0 && buf[512] == 0xA0 && buf[513] == 0x46 } else { return len(buf) > 3 && buf[0] == 0xD0 && buf[1] == 0xCF && buf[2] == 0x11 && buf[3] == 0xE0 } }

location filetype/matchers/document the ppt file's buf 512 and 513 is not equal 0xA0 and 0x46. the value is 0xFD and 0xFF, file is in MAC OS and i create just now like this

image