parser

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chunked

func Chunked(content []byte, max int) chan []byte

func Count

func Count(content []byte, max int) int

Types

type MessageParser

type MessageParser struct {
	Implant string
	PacketParser
}

func NewParser

func NewParser(name string) (*MessageParser, error)

func (*MessageParser) ReadMessage

func (parser *MessageParser) ReadMessage(conn *peek.Conn, length uint32) (*implantpb.Spites, error)

func (*MessageParser) ReadPacket

func (parser *MessageParser) ReadPacket(conn *peek.Conn) (uint32, *implantpb.Spites, error)

func (*MessageParser) WritePacket

func (parser *MessageParser) WritePacket(conn *peek.Conn, msg *implantpb.Spites, sid uint32) error

type PacketParser

type PacketParser interface {
	PeekHeader(conn *peek.Conn) (uint32, uint32, error)
	ReadHeader(conn *peek.Conn) (uint32, uint32, error)
	Parse([]byte) (*implantpb.Spites, error)
	Marshal(*implantpb.Spites, uint32) ([]byte, error)
}

PacketParser packet parser, like malefic, beacon ...

type SpitesCache

type SpitesCache struct {
	// contains filtered or unexported fields
}

func NewSpitesBuf

func NewSpitesBuf() *SpitesCache

func (*SpitesCache) Append

func (sc *SpitesCache) Append(spite *implantpb.Spite)

func (*SpitesCache) Build

func (sc *SpitesCache) Build() *implantpb.Spites

func (*SpitesCache) BuildOrEmpty

func (sc *SpitesCache) BuildOrEmpty() *implantpb.Spites

func (*SpitesCache) Len

func (sc *SpitesCache) Len() int

func (*SpitesCache) Reset

func (sc *SpitesCache) Reset()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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