distiller

package
v0.0.0-...-4e6bda9 Latest Latest
Warning

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

Go to latest
Published: May 20, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NumCallsLTPKself = 12712

Number of calls generated by distilling LTP + Kself

View Source
const NumCallsLTPKselfPosix = 15333

Number of calls generated by distilling LTP + Kself + Posix

View Source
const NumCallsLTPKselfPosixGlibc = 16442

Number of calls generated by distilling LTP + Kself + Posix + Glibc

Variables

View Source
var (
	RADIUS int = 2
)

Functions

This section is empty.

Types

type Distiller

type Distiller interface {
	Distill([]*prog.Prog) []*prog.Prog
	Add(domain.Seeds)
	Stats(domain.Seeds)
}

func NewDistiller

func NewDistiller(conf config.DistillConfig) (d Distiller)

type DistillerMetadata

type DistillerMetadata struct {
	StatFile                string
	Seeds                   domain.Seeds
	DistilledProgs          []*prog.Prog
	CallToSeed              map[*prog.Call]*domain.Seed
	CallToDistilledProg     map[*prog.Call]*prog.Prog
	CallToIdx               map[*prog.Call]int
	UpstreamDependencyGraph map[*domain.Seed]map[int]map[prog.Arg][]prog.Arg
	DownstreamDependents    map[*domain.Seed]map[int]bool
}

func (*DistillerMetadata) BuildDependency

func (d *DistillerMetadata) BuildDependency(seed *domain.Seed, distilledProg *prog.Prog)

func (*DistillerMetadata) Contributes

func (d *DistillerMetadata) Contributes(seed *domain.Seed, seenIps map[uint64]bool) int

func (*DistillerMetadata) GetAllDownstreamDependents

func (d *DistillerMetadata) GetAllDownstreamDependents(seed *domain.Seed, seen map[int]bool) []*prog.Call

func (*DistillerMetadata) GetAllUpstreamDependents

func (d *DistillerMetadata) GetAllUpstreamDependents(seed *domain.Seed, seen map[int]bool) []*prog.Call

func (*DistillerMetadata) Stats

func (d *DistillerMetadata) Stats(distilledSeeds domain.Seeds)

func (*DistillerMetadata) TrackDependencies

func (d *DistillerMetadata) TrackDependencies(prg *prog.Prog)

type ImplicitDistiller

type ImplicitDistiller struct {
	*DistillerMetadata
	// contains filtered or unexported fields
}

func NewImplicitDistiller

func NewImplicitDistiller(conf config.DistillConfig) (d *ImplicitDistiller)

func (*ImplicitDistiller) Add

func (d *ImplicitDistiller) Add(seeds domain.Seeds)

func (*ImplicitDistiller) AddImplicitDependencies

func (d *ImplicitDistiller) AddImplicitDependencies(
	calls []*prog.Call,
	seed *domain.Seed,
	seenMap map[int]bool,
) []*prog.Call

func (*ImplicitDistiller) AddToDistilledProg

func (d *ImplicitDistiller) AddToDistilledProg(seed *domain.Seed)

func (*ImplicitDistiller) Distill

func (d *ImplicitDistiller) Distill(progs []*prog.Prog) (distilled []*prog.Prog)

type RandomDistiller

type RandomDistiller struct {
	*DistillerMetadata
}

func NewRandomDistiller

func NewRandomDistiller(conf config.DistillConfig) (d *RandomDistiller)

func (*RandomDistiller) Add

func (d *RandomDistiller) Add(seeds domain.Seeds)

func (*RandomDistiller) Distill

func (d *RandomDistiller) Distill(progs []*prog.Prog) (distilled []*prog.Prog)

func (*RandomDistiller) StripDependencies

func (d *RandomDistiller) StripDependencies(distilledProgs []*prog.Prog) []*prog.Prog

type StrongDistiller

type StrongDistiller struct {
	*DistillerMetadata
}

func NewStrongDistiller

func NewStrongDistiller(conf config.DistillConfig) (d *StrongDistiller)

func (*StrongDistiller) Add

func (d *StrongDistiller) Add(seeds domain.Seeds)

func (*StrongDistiller) AddToDistilledProg

func (d *StrongDistiller) AddToDistilledProg(seed *domain.Seed)

func (*StrongDistiller) Distill

func (d *StrongDistiller) Distill(progs []*prog.Prog) (distilled []*prog.Prog)

type Trace

type Trace struct {
	Prog  *prog.Prog
	Cover []uint64
}

type TraceDistiller

type TraceDistiller struct {
	*DistillerMetadata
}

func NewTraceDistiller

func NewTraceDistiller(conf config.DistillConfig) (d *TraceDistiller)

func (*TraceDistiller) Add

func (d *TraceDistiller) Add(seeds domain.Seeds)

func (*TraceDistiller) Contributes

func (d *TraceDistiller) Contributes(trace *Trace, seenIps map[uint64]bool) int

func (*TraceDistiller) Distill

func (d *TraceDistiller) Distill(progs []*prog.Prog) (distilled []*prog.Prog)

type Traces

type Traces []*Trace

func (*Traces) Add

func (t *Traces) Add(trace *Trace)

func (Traces) Len

func (t Traces) Len() int

func (Traces) Less

func (t Traces) Less(i, j int) bool

func (Traces) Swap

func (t Traces) Swap(i, j int)

type WeakDistiller

type WeakDistiller struct {
	*DistillerMetadata
}

func NewWeakDistiller

func NewWeakDistiller(conf config.DistillConfig) (d *WeakDistiller)

func (*WeakDistiller) Add

func (d *WeakDistiller) Add(seeds domain.Seeds)

func (*WeakDistiller) AddToDistilledProg

func (d *WeakDistiller) AddToDistilledProg(seed *domain.Seed)

func (*WeakDistiller) Distill

func (d *WeakDistiller) Distill(progs []*prog.Prog) (distilled []*prog.Prog)

func (*WeakDistiller) GetDependents

func (d *WeakDistiller) GetDependents(seedCalls []*prog.Call) []*prog.Call

This is the core of the weak distiller. We start with the centroid and get all downstream dependents. Every call needs its upstream dependents to run correctly so we get those. We then pull all downstream dependents of those upstreams and if there are any new calls, we pull the upstream of them. We can keep going, but this is a heuristic

func (*WeakDistiller) GetNeighbors

func (d *WeakDistiller) GetNeighbors(seed *domain.Seed) []*prog.Call

Jump to

Keyboard shortcuts

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