hex

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2019 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const StringChainingThreshold int64 = 200

Variables

View Source
var ParsedHexString ast.HexTokens

Functions

func Parse

func Parse(input io.Reader) (hexstr ast.HexTokens, err error)

Parse parses an hex string in a YARA rule from the provided input source

func YYmain

func YYmain(filenames ...string) (interface{}, error)

Types

type ByteWithMask

type ByteWithMask struct {
	Value byte
	Mask  byte
}

type Lexer

type Lexer struct {
	// contains filtered or unexported fields
}

Lexer is an adapter that fits the flexgo lexer ("Scanner") into goyacc

func (*Lexer) Error

func (l *Lexer) Error(e string)

Error satisfies the interface expected of the goyacc parser.

func (*Lexer) Lex

func (l *Lexer) Lex(lval *xxSymType) int

Lex provides the interface expected by the goyacc parser. It sets the global yylval pointer (defined in the lexer file) to the one passed as an argument so that the parser actions can make use of it.

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

func (*Scanner) Input

func (yy *Scanner) Input() (byte, error)

func (*Scanner) Lex

func (yy *Scanner) Lex() YYtype

The main scanner function which does all the work.

func (*Scanner) NewFile

func (yy *Scanner) NewFile()

func (*Scanner) Restart

func (yy *Scanner) Restart(input_file io.Reader)

* Immediately switch to a different input stream.

  • @param input_file A readable stream. *
  • @note This function does not reset the start condition to @c yyInitial .

type YYcontext

type YYcontext interface{}

type YYtype

type YYtype interface{}

Necessary types for flexgo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL