Documentation
¶
Index ¶
- Constants
- Variables
- func CheckPluginFun(pluginType string, fd FuncDecl) (bool, string)
- func GenCodeByType(pluginType string) string
- func GenPlugInfoFun(pName, pType, goVer, usageFile string, params []ParaMeta) string
- func GetFullStruct(structType string) any
- func GetParamStrings(os, pluginType string, params []Param) (string, string)
- func GetPluginFunName(pluginType string) string
- func GetPluginType(pluginFunName string) string
- func GetPreDefinedArgs(pType string) []any
- func GetRetPtr(retType string) any
- func GetStruct(structType string) any
- type FuncDecl
- type ParaMeta
- type Param
- type PluginInfo
Constants ¶
View Source
const ( IndPTypePlProc = 0 IndPTypeReact = 1 IndPTypePlGen = 2 IndPTypeReqSender = 3 IndPTypePreproc = 4 )
Variables ¶
View Source
var FuncDecls = map[string]FuncDecl{ PluginTypes[0]: { Params: []Param{{Name: "payload", Type: "string"}}, RetType: "string", }, PluginTypes[1]: { Params: []Param{{Name: "req", Type: "*fuzzTypes.Req"}, {Name: "resp", Type: "*fuzzTypes.Resp"}}, RetType: "*fuzzTypes.Reaction", }, PluginTypes[2]: { Params: []Param{}, RetType: "[]string", }, PluginTypes[3]: { Params: []Param{{Name: "sendMeta", Type: "*fuzzTypes.SendMeta"}}, RetType: "*fuzzTypes.Resp", }, PluginTypes[4]: { Params: []Param{{Name: "fuzz", Type: "*fuzzTypes.Fuzz"}}, RetType: "*fuzzTypes.Fuzz", }, }
FuncDecls 每种插件的约定函数原型
View Source
var PluginFunNames = []string{"PayloadProcessor", "React", "PayloadGenerator", "SendRequest", "Preprocess"}
View Source
var PluginTypes = []string{"payloadProc", "reactor", "payloadGen", "reqSender", "preprocess"}
View Source
var Ranges = []fuzzTypes.Range{{500, 300}, {200, 100}, {404, 200}}
Functions ¶
func CheckPluginFun ¶
CheckPluginFun 判断插件函数的函数声明是否符合规范
func GenCodeByType ¶
GenCodeByType 根据插件类型生成一个完整的可通过编译的代码骨架
func GenPlugInfoFun ¶
GenPlugInfoFun 生成PluginInfo函数
func GetParamStrings ¶
GetParamStrings 获取用于替换go模板文件中的参数占位符的字符串
func GetPluginFunName ¶
GetPluginFunName 根据插件类型查找函数名
func GetPreDefinedArgs ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.