Documentation
¶
Index ¶
Constants ¶
const ( ModGlobal modifiers = 1 << iota ModPrivate ModASCII ModWide ModXor ModFullword ModNocase )
const UNARY_MINUS = 57397
Variables ¶
This section is empty.
Functions ¶
func ParseString ¶
ParseString parses a YARA rule from the provided string.
Types ¶
type Scanner ¶
type Scanner struct {
In io.Reader
Out io.Writer
Lineno int
Filename string
Wrap func(*Scanner) bool
IsInteractive func(io.Reader) bool
Context YYcontext
Interactive bool
// contains filtered or unexported fields
}
func NewScanner ¶
func NewScanner() *Scanner
type YYcontext ¶
type YYcontext struct {
// contains filtered or unexported fields
}
Note that the parser is generated with the yr prefix to avoid name collisions with the hex and regexp parsers.
type YYtype ¶
YYtype is the structure returned by the lexer every time the scanner asks for the next token. If the lexer wants to return an error to the scanner it sets the Error field and leaves the Token empty.
type YaraSerializer ¶
type YaraSerializer struct {
// contains filtered or unexported fields
}
YaraSerializer converts a RuleSet from proto to YARA ruleset. Contains configuration options.
func NewSerializer ¶
func NewSerializer(w io.Writer) *YaraSerializer
NewSerializer returns a YaraSerializer that writes the serialization output to w.
func (*YaraSerializer) Serialize ¶
func (ys *YaraSerializer) Serialize(rs *pb.RuleSet) error
Serialize converts the provided RuleSet proto to a YARA ruleset.
func (*YaraSerializer) SerializeExpression ¶
func (ys *YaraSerializer) SerializeExpression(e *pb.Expression) error
SerializeExpression serializes an Expression in a YARA rule condition.
func (*YaraSerializer) SerializeStringValue ¶
func (ys *YaraSerializer) SerializeStringValue(str *pb.String) error
Serializes the value of a string in a YARA rule.
func (*YaraSerializer) SetIndent ¶
func (ys *YaraSerializer) SetIndent(indent string)
SetIndent sets the indentation string used for each indentation level. Default value: 2 whitespaces.