Documentation
¶
Index ¶
- Constants
- Variables
- func CheckPluginFun(pluginType string, fd FuncDecl) (bool, string)
- func CheckPluginMinorFunc(pType string, fd FuncDecl) (bool, string)
- func DefMinorFun(pluginType string) string
- func GenCodePType(pluginType string) string
- func GenPlugInfoFun(pName, pType, goVer, usageFile string, params []ParaMeta) string
- func GetContextArgs(pType string) []any
- func GetFullStruct(structType string) any
- func GetParamStrings(os, pluginType string, params []Param) (formal string, actual string)
- func GetPluginFunName(pluginType string) string
- func GetPluginType(pluginFunName string) string
- func GetRetPtr(retType string) any
- func GetStruct(structType string) any
- type FuncDecl
- type ParaMeta
- type Param
- type PluginInfo
Constants ¶
View Source
const ( IndPTypePlProc = iota IndPTypeReact IndPTypePlGen IndPTypeRequester IndPTypePreproc IndPTypeIterator IndPTypeIteratorMinor = 0 )
Variables ¶
View Source
var FuncDecls = map[string]FuncDecl{ PluginTypes[IndPTypePlProc]: { Params: []Param{{Name: "payload", Type: "string"}}, RetType: "string", }, PluginTypes[IndPTypeReact]: { Params: []Param{{Name: "req", Type: "*fuzzTypes.Req"}, {Name: "resp", Type: "*fuzzTypes.Resp"}}, RetType: "*fuzzTypes.Reaction", }, PluginTypes[IndPTypePlGen]: { Params: []Param{}, RetType: "[]string", }, PluginTypes[IndPTypeRequester]: { Params: []Param{{Name: "requestCtx", Type: "*fuzzTypes.RequestCtx"}}, RetType: "*fuzzTypes.Resp", }, PluginTypes[IndPTypePreproc]: { Params: []Param{{Name: "fuzz", Type: "*fuzzTypes.Fuzz"}}, RetType: "*fuzzTypes.Fuzz", }, PluginTypes[IndPTypeIterator]: { Params: []Param{{Name: "lengths", Type: "[]int"}, {"ind", "int"}}, RetType: "[]int", }, PluginMinorFun[IndPTypeIteratorMinor]: { Params: []Param{{Name: "lengths", Type: "[]int"}}, RetType: "int", }, }
FuncDecls 每种插件的约定函数原型
View Source
var PluginFunNames = []string{"PayloadProcessor", "React", "PayloadGenerator", "DoRequest", "Preprocess", "IterIndex"}
View Source
var PluginMinorFun = []string{"IterLen"}
View Source
var PluginTypes = []string{"payloadProc", "reactor", "payloadGen", "requester", "preprocess", "iterator"}
View Source
var Ranges = []fuzzTypes.Range{{500, 300}, {200, 100}, {404, 200}}
Functions ¶
func CheckPluginFun ¶
CheckPluginFun 判断插件函数的函数声明是否符合规范
func CheckPluginMinorFunc ¶ added in v0.1.0
func DefMinorFun ¶ added in v0.1.0
DefMinorFun 次要函数,目前只有iterator插件的IterLen使用这个函数生成
func GenCodePType ¶ added in v0.1.0
GenCodePType 根据插件类型生成一个完整的可通过编译的代码骨架
func GenPlugInfoFun ¶
GenPlugInfoFun 生成PluginInfo函数
func GetContextArgs ¶ added in v0.1.0
GetContextArgs 根据插件类型返回预留参数
func GetParamStrings ¶
GetParamStrings 获取用于替换go模板文件中的参数占位符的字符串
func GetPluginFunName ¶
GetPluginFunName 根据插件类型查找函数名
Types ¶
Click to show internal directories.
Click to hide internal directories.