aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_magic/patterns.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-24 15:43:04 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-24 15:43:04 +0100
commit99cc1fcb693f0c08f48776bdc8ba76fc91856737 (patch)
treef2dd4a1c130a7c029dfb4b785ef9f683a82d368f /lualib/lua_magic/patterns.lua
parentd142728c2eef62bf3266e9c16eb73a5a3ba63b46 (diff)
downloadrspamd-99cc1fcb693f0c08f48776bdc8ba76fc91856737.tar.gz
rspamd-99cc1fcb693f0c08f48776bdc8ba76fc91856737.zip
[Project] Lua_magic: Add images patterns
Diffstat (limited to 'lualib/lua_magic/patterns.lua')
-rw-r--r--lualib/lua_magic/patterns.lua41
1 files changed, 41 insertions, 0 deletions
diff --git a/lualib/lua_magic/patterns.lua b/lualib/lua_magic/patterns.lua
index d9604b714..8d90a45ef 100644
--- a/lualib/lua_magic/patterns.lua
+++ b/lualib/lua_magic/patterns.lua
@@ -380,6 +380,47 @@ local patterns = {
}
}
},
+ jpg = {
+ matches = {
+ { -- JPEG2000
+ hex = [[0000000c6a5020200d0a870a]],
+ relative_position = 0,
+ weight = 60,
+ },
+ {
+ string = [[^\x{ff}\x{d8}\x{ff}(?:[\x{e0}\x{e1}])]],
+ weight = 60,
+ position = 4,
+ },
+ },
+ },
+ png = {
+ matches = {
+ {
+ string = [[^\x{89}PNG\x{0d}\x{0a}\x{1a}\x{0a}]],
+ position = 8,
+ weight = 60,
+ },
+ }
+ },
+ gif = {
+ matches = {
+ {
+ string = [[^GIF8\d]],
+ position = 5,
+ weight = 60,
+ },
+ }
+ },
+ bmp = {
+ matches = {
+ {
+ string = [[^BM...\x{00}\x{00}\x{00}\x{00}]],
+ position = 9,
+ weight = 60,
+ },
+ }
+ },
}
return patterns \ No newline at end of file