Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateLuaDefinitionFile(L *lua.LState, filename string) error
- func GenerateMarkdownDefinitionFile(L *lua.LState, pkg, filename string) error
- func LoadLib(vm *lua.LState)
- func NewLuaVM() *lua.LState
- func NewYaegiInterpreter() *interp.Interpreter
- func RegisterAllProtobufMessages(L *lua.LState)
- func RegisterProtobufMessage(L *lua.LState, msgType string, msg proto.Message)
- func RegisterProtobufMessageType(L *lua.LState)
- func RegisterProtobufMessagesFromPackage(L *lua.LState, pkg string)
- type Command
- type Commands
- type DefaultPlugin
- type GoMalPlugin
- type LuaPlugin
- type MalManiFest
- type Plugin
Constants ¶
View Source
const ( LuaScript = "lua" GoPlugin = "go" )
View Source
const CMDSeq = ":"
Variables ¶
View Source
var ( ReservedARGS = "args" ReservedCMDLINE = "cmdline" ReservedWords = []string{ReservedCMDLINE, ReservedARGS} LuaPackages = map[string]*lua.LTable{} ProtoPackage = []string{"implantpb", "clientpb", "modulepb"} GlobalPlugins []*DefaultPlugin )
View Source
var (
MalType = "lua"
)
Functions ¶
func GenerateMarkdownDefinitionFile ¶ added in v0.0.3
func NewYaegiInterpreter ¶ added in v0.0.3
func NewYaegiInterpreter() *interp.Interpreter
func RegisterAllProtobufMessages ¶
RegisterAllProtobufMessages 注册 implantpb 和 clientpb 中的所有 Protobuf Message
func RegisterProtobufMessage ¶
RegisterProtobufMessage 注册 Protobuf message 类型到 Lua
func RegisterProtobufMessageType ¶
// 注册 Protobuf Message 的类型和方法
func RegisterProtobufMessagesFromPackage ¶
RegisterProtobufMessagesFromPackage 注册指定包中所有的 Protobuf Message
Types ¶
type DefaultPlugin ¶ added in v0.0.3
type DefaultPlugin struct { *MalManiFest Enable bool Content []byte Path string CMDs Commands Events map[intermediate.EventCondition]intermediate.OnEventFunc }
func LoadGlobalLuaPlugin ¶ added in v0.0.3
func LoadGlobalLuaPlugin() []*DefaultPlugin
func NewPlugin ¶
func NewPlugin(manifest *MalManiFest) (*DefaultPlugin, error)
func (*DefaultPlugin) Commands ¶ added in v0.0.3
func (plug *DefaultPlugin) Commands() Commands
func (*DefaultPlugin) GetEvents ¶ added in v0.0.3
func (plug *DefaultPlugin) GetEvents() map[intermediate.EventCondition]intermediate.OnEventFunc
func (*DefaultPlugin) Manifest ¶ added in v0.0.3
func (plug *DefaultPlugin) Manifest() *MalManiFest
type GoMalPlugin ¶ added in v0.0.3
type GoMalPlugin struct { *DefaultPlugin Interpreter *interp.Interpreter }
func NewGoMalPlugin ¶ added in v0.0.3
func NewGoMalPlugin(manifest *MalManiFest) (*GoMalPlugin, error)
func (*GoMalPlugin) Run ¶ added in v0.0.3
func (plug *GoMalPlugin) Run() error
type LuaPlugin ¶ added in v0.0.3
type LuaPlugin struct { *DefaultPlugin // contains filtered or unexported fields }
func NewLuaMalPlugin ¶ added in v0.0.3
func NewLuaMalPlugin(manifest *MalManiFest) (*LuaPlugin, error)
func (*LuaPlugin) RegisterLuaBuiltin ¶ added in v0.0.3
type MalManiFest ¶
type MalManiFest struct { Name string `json:"name" yaml:"name"` Type string `json:"type" yaml:"type"` // lua, tcl Author string `json:"author" yaml:"author"` Version string `json:"version" yaml:"version"` EntryFile string `json:"entry" yaml:"entry"` Lib bool `json:"lib" yaml:"lib"` DependModule []string `json:"depend_module" yaml:"depend_modules"` DependArmory []string `json:"depend_armory" yaml:"depend_armory"` }
func GetPluginManifest ¶ added in v0.0.3
func GetPluginManifest() []*MalManiFest
func LoadMalManiFest ¶ added in v0.0.3
func LoadMalManiFest(filename string) (*MalManiFest, error)
func ParseMalManifest ¶ added in v0.0.3
func ParseMalManifest(data []byte) (*MalManiFest, error)
type Plugin ¶
type Plugin interface { Run() error Manifest() *MalManiFest Commands() Commands GetEvents() map[intermediate.EventCondition]intermediate.OnEventFunc }
Click to show internal directories.
Click to hide internal directories.