pkgtofuzzinput

package
v0.0.0-...-fe7410f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const FNG_DSTSRC_DST = 1
View Source
const FNG_DSTSRC_SRC = 2
View Source
const FNG_TYPE_ARG uint8 = 2
View Source
const FNG_TYPE_CONST uint8 = 4

has some defined constants

View Source
const FNG_TYPE_RESULT uint8 = 1

Flags

View Source
const FNG_TYPE_STRUCTEXP uint8 = 8

struct with exported fields (which can be built without a function)

Variables

View Source
var ProtoGenerated = map[string]string{
	"io.RuneReader": "string",
	"io.ReaderAt":   "bytes",
	"io.Reader":     "bytes",
	"io.Writer":     "bytes",
	"bufio.Reader":  "bytes",
	"big.Int":       "bytes",
	"net.Conn":      "bytes",
	"int":           "int64",
	"rune":          "string",
	"byte":          "uint32",
	"uint":          "uint32",
	"uint8":         "uint32",
	"uint16":        "uint32",
	"[]int":         "repeated int64",
	"[]uint16":      "repeated int64",
}
View Source
var ProtoGenerators = map[string]string{
	"io.RuneReader": "strings.NewReader",
	"io.ReaderAt":   "bytes.NewReader",
	"io.Reader":     "bytes.NewReader",
	"io.Writer":     "bytes.NewBuffer",
	"bufio.Reader":  "CreateBufioReader",
	"big.Int":       "CreateBigInt",
	"net.Conn":      "CreateFuzzingConn",
	"int":           "int",
	"rune":          "GetRune",
	"byte":          "byte",
	"uint":          "uint",
	"uint8":         "uint8",
	"uint16":        "uint16",
	"[]int":         "ConvertIntArray",
	"[]uint16":      "ConvertUint16Array",
}

Functions

func CamelCase

func CamelCase(s string) string

func CamelUpper

func CamelUpper(s string) string

func PackageFromName

func PackageFromName(pkgname string) (*packages.Package, error)

func PackageToCorpus

func PackageToCorpus(pkg *packages.Package, descr PkgDescription, outdir string) error

func PackageToFuzzTarget

func PackageToFuzzTarget(pkg *packages.Package, descr PkgDescription, w io.StringWriter, outdir string, limits string) error

func PackageToFuzzer

func PackageToFuzzer(pkgname string, outdir string, exclude string, limits string) error

func PackageToProtobuf

func PackageToProtobuf(pkg *packages.Package, descr PkgDescription, w io.StringWriter, outdir string) error

func TitleCase

func TitleCase(s string) string

Types

type PkgDescription

type PkgDescription struct {
	Functions []PkgFunction
	Types     []PkgType
}

func PackageToProtobufMessagesDescription

func PackageToProtobufMessagesDescription(pkg *packages.Package, exclude string) (PkgDescription, error)

type PkgFuncArg

type PkgFuncArg struct {
	Name      string
	FieldType string
	Proto     PkgFuncArgClass
	Prefix    string
	Suffix    string
}

type PkgFuncArgClass

type PkgFuncArgClass uint8
const (
	PkgFuncArgClassProto     PkgFuncArgClass = 0
	PkgFuncArgClassUnhandled PkgFuncArgClass = 1
	PkgFuncArgClassPkgGen    PkgFuncArgClass = 2
	PkgFuncArgClassProtoGen  PkgFuncArgClass = 3
	PkgFuncArgClassPkgConst  PkgFuncArgClass = 4
	PkgFuncArgClassUnknown   PkgFuncArgClass = 5
	PkgFuncArgClassPkgGenA   PkgFuncArgClass = 6
	PkgFuncArgClassPkgStruct PkgFuncArgClass = 7
)

func GolangArgumentClassName

func GolangArgumentClassName(e ast.Expr) (PkgFuncArgClass, string)

type PkgFuncResult

type PkgFuncResult struct {
	FieldType string
	Used      bool
	Prefix    string
	Suffix    string
}

type PkgFunction

type PkgFunction struct {
	Name    string
	Recv    string
	Suffix  string
	Args    []PkgFuncArg
	Returns []PkgFuncResult
	SrcDst  uint8
}

type PkgType

type PkgType struct {
	Name   string
	Values []string
	Args   []PkgFuncArg
}

Jump to

Keyboard shortcuts

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