h2non / filetype

Fast, dependency-free Go package to infer binary file types based on the magic numbers header signature

Home Page:https://pkg.go.dev/github.com/h2non/filetype?tab=doc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why ppt matcher return false for a ppt file

guojin-bupt opened this issue · comments

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