import "pe" import "math" private rule helper_match { strings: $a = "MZ" $hex = { 4D 5A ?? ?? [0-4] 00 } $re = /foo(bar|baz)+/i nocase condition: $a at 0 or any of them } global rule gated { condition: filesize < 20MB } rule win_executable : windows malware { meta: author = "seed" description = "a rule with a // comment inside and a /* block */ comment" strings: $mz = { 4D 5A } condition: uint16(0) == 0x5A4D and ( pe.number_of_sections > 2 or filesize < 1MB ) and $mz } rule elf_only { condition: uint32(0) == 0x464c457f and filesize <= 4MB }