-
Notifications
You must be signed in to change notification settings - Fork 11
/
collection.go
116 lines (114 loc) · 15 KB
/
collection.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package fleep
type collectionItem struct {
Type FileType
Extension string
Mime string
Offset int
Signature [][]byte
}
var collection = []collectionItem{
{Type: RasterImage, Extension: "bmp", Mime: "image/bmp", Offset: 0, Signature: [][]byte{{0x42, 0x4D}}},
{Type: RasterImage, Extension: "gif", Mime: "image/gif", Offset: 0, Signature: [][]byte{{0x47, 0x49, 0x46, 0x38}}},
{Type: RasterImage, Extension: "jpg", Mime: "image/jpeg", Offset: 0, Signature: [][]byte{{0xFF, 0xD8, 0xFF}}},
{Type: RasterImage, Extension: "jp2", Mime: "image/jp2", Offset: 0, Signature: [][]byte{{0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20}}},
{Type: RasterImage, Extension: "png", Mime: "image/png", Offset: 0, Signature: [][]byte{{0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A}}},
{Type: RasterImage, Extension: "webp", Mime: "image/webp", Offset: 8, Signature: [][]byte{{0x57, 0x45, 0x42, 0x50}}},
{Type: RasterImage, Extension: "ico", Mime: "image/x-icon", Offset: 0, Signature: [][]byte{{0x00, 0x00, 0x01, 0x00}}},
{Type: RasterImage, Extension: "psd", Mime: "image/vnd.adobe.photoshop", Offset: 0, Signature: [][]byte{{0x38, 0x42, 0x50, 0x53}}},
{Type: RasterImage, Extension: "tiff", Mime: "image/tiff", Offset: 0, Signature: [][]byte{{0x49, 0x20, 0x49}, {0x49, 0x49, 0x2A, 0x00}, {0x4D, 0x4D, 0x00, 0x2A}, {0x4D, 0x4D, 0x00, 0x2B}}},
{Type: RawImage, Extension: "raw", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x49, 0x49, 0x55, 0x00}}},
{Type: RawImage, Extension: "arw", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x49, 0x49, 0x2A, 0x00}}},
{Type: RawImage, Extension: "x3f", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x46, 0x4F, 0x56, 0x62}}},
{Type: RawImage, Extension: "srw", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x4D, 0x4D, 0x00, 0x2A}}},
{Type: RawImage, Extension: "pef", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x4D, 0x4D, 0x00, 0x2A}}},
{Type: RawImage, Extension: "rw2", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x49, 0x49, 0x55, 0x00}}},
{Type: RawImage, Extension: "nef", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x4D, 0x4D, 0x00, 0x2A}}},
{Type: RawImage, Extension: "nrw", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x49, 0x49, 0x2A, 0x00}}},
{Type: RawImage, Extension: "raf", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x46, 0x55, 0x4A, 0x49}}},
{Type: RawImage, Extension: "erf", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x4D, 0x4D, 0x00, 0x2A}}},
{Type: RawImage, Extension: "crw", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x49, 0x49, 0x1A, 0x00}}},
{Type: RawImage, Extension: "cr2", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x49, 0x49, 0x2A, 0x00}}},
{Type: RawImage, Extension: "orf", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x49, 0x49, 0x52, 0x4F}, {0x49, 0x49, 0x52, 0x53}}},
{Type: RawImage, Extension: "dng", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x4D, 0x4D, 0x00, 0x2A}, {0x49, 0x49, 0x2A, 0x00}}},
{Type: VectorImage, Extension: "ai", Mime: "application/postscript", Offset: 0, Signature: [][]byte{{0x25, 0x50, 0x44, 0x46}}},
{Type: VectorImage, Extension: "eps", Mime: "application/postscript", Offset: 0, Signature: [][]byte{{0xC5, 0xD0, 0xD3, 0xC6}, {0x25, 0x21, 0x50, 0x53, 0x2D, 0x41, 0x64, 0x6F}}},
{Type: ThreeDimensionalImage, Extension: "obj", Mime: "text/plain", Offset: 2, Signature: [][]byte{{0x4D, 0x61, 0x78, 0x32, 0x4F, 0x62, 0x6A}, {0x42, 0x6C, 0x65, 0x6E, 0x64, 0x65, 0x72}}},
{Type: ThreeDimensionalImage, Extension: "mtl", Mime: "text/plain", Offset: 2, Signature: [][]byte{{0x4D, 0x61, 0x78, 0x32, 0x4D, 0x74, 0x6C}, {0x42, 0x6C, 0x65, 0x6E, 0x64, 0x65, 0x72, 0x20, 0x4D, 0x54, 0x4C, 0x20, 0x46, 0x69, 0x6C, 0x65}}},
{Type: ThreeDimensionalImage, Extension: "xsi", Mime: "text/plain", Offset: 0, Signature: [][]byte{{0x78, 0x73, 0x69}}},
{Type: ThreeDimensionalImage, Extension: "ply", Mime: "text/plain", Offset: 50, Signature: [][]byte{{0x70, 0x6C, 0x79}}},
{Type: ThreeDimensionalImage, Extension: "ma", Mime: "text/plain", Offset: 2, Signature: [][]byte{{0x4D, 0x61, 0x79, 0x61}}},
{Type: ThreeDimensionalImage, Extension: "wrl", Mime: "text/plain", Offset: 1, Signature: [][]byte{{0x56, 0x52, 0x4D, 0x4C}}},
{Type: ThreeDimensionalImage, Extension: "x3d", Mime: "application/xml", Offset: 50, Signature: [][]byte{{0x58, 0x33, 0x44}}},
{Type: ThreeDimensionalImage, Extension: "fbx", Mime: "application/octet-stream", Offset: 2, Signature: [][]byte{{0x46, 0x42, 0x58}}},
{Type: ThreeDimensionalImage, Extension: "ms3d", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x4D, 0x53, 0x33, 0x44}}},
{Type: ThreeDimensionalImage, Extension: "c4d", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x58, 0x43, 0x34, 0x44, 0x43, 0x34, 0x44, 0x36}}},
{Type: Audio, Extension: "aiff", Mime: "audio/aiff", Offset: 0, Signature: [][]byte{{0x46, 0x4F, 0x52, 0x4D, 0x00}}},
{Type: Audio, Extension: "aac", Mime: "audio/aac", Offset: 0, Signature: [][]byte{{0xFF, 0xF1}, {0xFF, 0xF9}}},
{Type: Audio, Extension: "midi", Mime: "audio/midi", Offset: 0, Signature: [][]byte{{0x4D, 0x54, 0x68, 0x64}}},
{Type: Audio, Extension: "mp3", Mime: "audio/mpeg", Offset: 0, Signature: [][]byte{{0x49, 0x44, 0x33}}},
{Type: Audio, Extension: "m4a", Mime: "audio/mp4", Offset: 4, Signature: [][]byte{{0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41, 0x20}}},
{Type: Audio, Extension: "oga", Mime: "audio/ogg", Offset: 0, Signature: [][]byte{{0x4F, 0x67, 0x67, 0x53, 0x00, 0x02, 0x00, 0x00}}},
{Type: Audio, Extension: "wav", Mime: "audio/wav", Offset: 0, Signature: [][]byte{{0x52, 0x49, 0x46, 0x46}}},
{Type: Audio, Extension: "wma", Mime: "audio/x-ms-wma", Offset: 0, Signature: [][]byte{{0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11}}},
{Type: Audio, Extension: "flac", Mime: "audio/flac", Offset: 0, Signature: [][]byte{{0x66, 0x4C, 0x61, 0x43, 0x00, 0x00, 0x00, 0x22}}},
{Type: Audio, Extension: "mka", Mime: "audio/x-matroska", Offset: 31, Signature: [][]byte{{0x6D, 0x61, 0x74, 0x72, 0x6F, 0x73, 0x6B, 0x61}}},
{Type: Audio, Extension: "au", Mime: "audio/basic", Offset: 0, Signature: [][]byte{{0x2E, 0x73, 0x6E, 0x64}}},
{Type: Audio, Extension: "ra", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x2E, 0x52, 0x4D, 0x46}}},
{Type: Audio, Extension: "amr", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x23, 0x21, 0x41, 0x4D}}},
{Type: Audio, Extension: "ac3", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x0B, 0x77}}},
{Type: Audio, Extension: "voc", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x76, 65}}},
{Type: Video, Extension: "3g2", Mime: "video/3gpp2", Offset: 4, Signature: [][]byte{{0x66, 0x74, 0x79, 0x70, 0x33, 0x67, 70}}},
{Type: Video, Extension: "3gp", Mime: "video/3gpp", Offset: 4, Signature: [][]byte{{0x66, 0x74, 0x79, 0x70, 0x33, 0x67, 70}}},
{Type: Video, Extension: "avi", Mime: "video/avi", Offset: 8, Signature: [][]byte{{0x41, 0x56, 0x49, 0x20, 0x4C, 0x49, 0x53, 0x54}}},
{Type: Video, Extension: "flv", Mime: "video/x-flv", Offset: 0, Signature: [][]byte{{0x46, 0x4C, 0x56}}},
{Type: Video, Extension: "m4v", Mime: "video/mp4", Offset: 4, Signature: [][]byte{{0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x56, 0x20}, {0x66, 0x74, 0x79, 0x70, 0x6D, 0x70, 0x34, 0x32}}},
{Type: Video, Extension: "mkv", Mime: "video/x-matroska", Offset: 31, Signature: [][]byte{{0x6D, 0x61, 0x74, 0x72, 0x6F, 0x73, 0x6B, 0x61}}},
{Type: Video, Extension: "mov", Mime: "video/quicktime", Offset: 4, Signature: [][]byte{{0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20}, {0x6D, 0x6F, 0x6F, 0x76}, {0x66, 0x72, 0x65, 0x65}, {0x6D, 0x64, 0x61, 0x74}, {0x77, 0x69, 0x64, 0x65}, {0x70, 0x6E, 0x6F, 0x74}, {0x73, 0x6B, 0x69, 0x70}}},
{Type: Video, Extension: "mp4", Mime: "video/mp4", Offset: 4, Signature: [][]byte{{0x66, 0x74, 0x79, 0x70, 0x4D, 0x53, 0x4E, 0x56}, {0x66, 0x74, 0x79, 0x70, 0x69, 0x73, 0x6F, 0x6D}}},
{Type: Video, Extension: "swf", Mime: "application/vnd.adobe.flash-movie", Offset: 0, Signature: [][]byte{{0x43, 0x57, 0x53}, {0x46, 0x57, 0x53}}},
{Type: Video, Extension: "mpg", Mime: "video/mpeg", Offset: 0, Signature: [][]byte{{0x00, 0x00, 0x01, 0xBA}}},
{Type: Video, Extension: "vob", Mime: "video/dvd", Offset: 0, Signature: [][]byte{{0x00, 0x00, 0x01, 0xBA}}},
{Type: Video, Extension: "wmv", Mime: "video/x-ms-wmv", Offset: 0, Signature: [][]byte{{0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11}}},
{Type: Video, Extension: "asf", Mime: "video/x-ms-asf", Offset: 0, Signature: [][]byte{{0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11}}},
{Type: Video, Extension: "ogv", Mime: "video/ogg", Offset: 0, Signature: [][]byte{{0x4F, 0x67, 0x67, 0x53, 0x00, 0x02, 0x00, 0x00}}},
{Type: Video, Extension: "webm", Mime: "video/webm", Offset: 0, Signature: [][]byte{{0x1A, 0x45, 0xDF, 0xA3}}},
{Type: Document, Extension: "odt", Mime: "application/vnd.oasis.opendocument.text", Offset: 73, Signature: [][]byte{{0x74, 0x65, 0x78, 0x74}}},
{Type: Document, Extension: "odp", Mime: "application/vnd.oasis.opendocument.presentation", Offset: 73, Signature: [][]byte{{0x70, 0x72, 0x65, 0x73, 0x65, 0x6E, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E}}},
{Type: Document, Extension: "ods", Mime: "application/vnd.oasis.opendocument.spreadsheet", Offset: 73, Signature: [][]byte{{0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x73, 0x68, 0x65, 0x65, 0x74}}},
{Type: Document, Extension: "doc", Mime: "application/vnd.ms-excel", Offset: 0, Signature: [][]byte{{0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1}, {0x50, 0x4B, 0x03, 0x04, 0x14, 0x00, 0x06, 0x00}}},
{Type: Document, Extension: "pps", Mime: "application/vnd.ms-powerpoint", Offset: 0, Signature: [][]byte{{0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1}, {0x50, 0x4B, 0x03, 0x04, 0x14, 0x00, 0x06, 0x00}}},
{Type: Document, Extension: "ppt", Mime: "application/vnd.ms-powerpoint", Offset: 0, Signature: [][]byte{{0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1}, {0x50, 0x4B, 0x03, 0x04, 0x14, 0x00, 0x06, 0x00}}},
{Type: Document, Extension: "xls", Mime: "application/vnd.ms-excel", Offset: 0, Signature: [][]byte{{0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1}, {0x50, 0x4B, 0x03, 0x04, 0x14, 0x00, 0x06, 0x00}}},
{Type: Document, Extension: "docx", Mime: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", Offset: 0, Signature: [][]byte{{0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1}, {0x50, 0x4B, 0x03, 0x04, 0x14, 0x00, 0x06, 0x00}}},
{Type: Document, Extension: "pptx", Mime: "application/vnd.openxmlformats-officedocument.presentationml.presentation", Offset: 0, Signature: [][]byte{{0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1}, {0x50, 0x4B, 0x03, 0x04, 0x14, 0x00, 0x06, 0x00}}},
{Type: Document, Extension: "xlsx", Mime: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", Offset: 0, Signature: [][]byte{{0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1}, {0x50, 0x4B, 0x03, 0x04, 0x14, 0x00, 0x06, 0x00}}},
{Type: Document, Extension: "pages", Mime: "application/zip", Offset: 0, Signature: [][]byte{{0x50, 0x4B, 0x03, 0x04}}},
{Type: Document, Extension: "key", Mime: "application/zip", Offset: 0, Signature: [][]byte{{0x50, 0x4B, 0x03, 0x04}}},
{Type: Document, Extension: "numbers", Mime: "application/zip", Offset: 0, Signature: [][]byte{{0x50, 0x4B, 0x03, 0x04}}},
{Type: Document, Extension: "pdf", Mime: "application/pdf", Offset: 0, Signature: [][]byte{{0x25, 0x50, 0x44, 0x46}}},
{Type: Document, Extension: "rtf", Mime: "application/rtf", Offset: 0, Signature: [][]byte{{0x7B, 0x5C, 0x72, 0x74, 0x66, 0x31}}},
{Type: Document, Extension: "epub", Mime: "application/epub+zip", Offset: 0, Signature: [][]byte{{0x50, 0x4B, 0x03, 0x04}}},
{Type: Document, Extension: "xml", Mime: "application/xml", Offset: 2, Signature: [][]byte{{0x78, 0x6D, 0x6C}}},
{Type: Archive, Extension: "7z", Mime: "application/x-7z-compressed", Offset: 0, Signature: [][]byte{{0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C}}},
{Type: Archive, Extension: "rar", Mime: "application/vnd.rar", Offset: 0, Signature: [][]byte{{0x52, 0x61, 0x72, 0x21, 0x1A, 0x07, 0x00}, {0x52, 0x61, 0x72, 0x21, 0x1A, 0x07, 0x01, 0x00}}},
{Type: Archive, Extension: "tar.z", Mime: "application/x-compress", Offset: 0, Signature: [][]byte{{0x1F, 0x9D}, {0x1F, 0xA0}}},
{Type: Archive, Extension: "gz", Mime: "application/gzip", Offset: 0, Signature: [][]byte{{0x1F, 0x8B, 0x08}}},
{Type: Archive, Extension: "zip", Mime: "application/zip", Offset: 0, Signature: [][]byte{{0x50, 0x4B, 0x03, 0x04}, {0x50, 0x4B, 0x05, 0x06}, {0x50, 0x4B, 0x07, 0x08}}},
{Type: Archive, Extension: "dmg", Mime: "application/x-apple-diskimage", Offset: 0, Signature: [][]byte{{0x78, 0x01, 0x73, 0x0D, 0x62, 0x62, 0x60}}},
{Type: Archive, Extension: "iso", Mime: "application/octet-stream", Offset: 0, Signature: [][]byte{{0x43, 0x49, 0x53, 0x4F}, {0x43, 0x44, 0x30, 0x30, 0x31}}},
{Type: Executable, Extension: "com", Mime: "application/x-msdownload", Offset: 0, Signature: [][]byte{{0x4D, 0x5A}}},
{Type: Executable, Extension: "exe", Mime: "application/vnd.microsoft.portable-executable", Offset: 0, Signature: [][]byte{{0x4D, 0x5A, 0x90, 0x00}}},
{Type: Executable, Extension: "jar", Mime: "application/java-archive", Offset: 0, Signature: [][]byte{{0x50, 0x4B, 0x03, 0x04}}},
{Type: Font, Extension: "ttf", Mime: "font/ttf", Offset: 0, Signature: [][]byte{{0x00, 0x01, 0x00, 0x00}}},
{Type: Font, Extension: "otf", Mime: "font/otf", Offset: 0, Signature: [][]byte{{0x4F, 0x54, 0x54, 0x4F}}},
{Type: Font, Extension: "woff", Mime: "font/woff", Offset: 0, Signature: [][]byte{{0x77, 0x4F, 0x46, 0x46}}},
{Type: Font, Extension: "woff2", Mime: "font/woff2", Offset: 0, Signature: [][]byte{{0x77, 0x4F, 0x46, 0x32}}},
{Type: System, Extension: "cab", Mime: "application/vnd.ms-cab-compressed", Offset: 0, Signature: [][]byte{{0x4D, 0x53, 0x43, 0x46}}},
{Type: System, Extension: "cat", Mime: "application/vnd.microsoft.portable-executable", Offset: 0, Signature: [][]byte{{0x30, 0x82}}},
{Type: System, Extension: "dll", Mime: "application/vnd.microsoft.portable-executable", Offset: 0, Signature: [][]byte{{0x4D, 0x5A, 0x90, 0x00}}},
{Type: System, Extension: "drv", Mime: "application/vnd.microsoft.portable-executable", Offset: 0, Signature: [][]byte{{0x4D, 0x5A, 0x90, 0x00}}},
{Type: System, Extension: "sdb", Mime: "application/vnd.microsoft.portable-executable", Offset: 8, Signature: [][]byte{{0x73, 0x64, 0x62, 0x66}}},
{Type: System, Extension: "sys", Mime: "application/vnd.microsoft.portable-executable", Offset: 0, Signature: [][]byte{{0x4D, 0x5A, 0x80, 0x00}, {0x4D, 0x5A, 0x90, 0x00}}},
{Type: System, Extension: "reg", Mime: "application/vnd.microsoft.portable-executable", Offset: 0, Signature: [][]byte{{0x52, 0x45, 0x47, 0x45, 0x44, 0x49, 0x54}, {0x57, 0x69, 0x6E, 0x64, 0x6F, 0x77, 0x73, 0x20, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79}}},
{Type: Database, Extension: "sqlite", Mime: "application/x-sqlite3", Offset: 0, Signature: [][]byte{{0x53, 0x51, 0x4C, 0x69, 0x74, 0x65, 0x20, 0x66, 0x6F, 0x72, 0x6D, 0x61, 0x74, 0x20, 0x33, 0x00}}},
}