GuBuffer

package
v0.0.0-...-cf331e6 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGuPacketFun

func NewGuPacketFun(fun GuPackFun) []byte

NewGuPacketFun 仿Mirai,这种还挺好用的

func TlvEnum

func TlvEnum(bin []byte, store map[uint16]func(pack *GuUnPacket))

TlvEnum Tlv结构枚举

Types

type GuPackFun

type GuPackFun func(pack *GuPacket)

type GuPacket

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

func NewGuPacket

func NewGuPacket() (p *GuPacket)

func (*GuPacket) GetAll

func (p *GuPacket) GetAll() (bin []byte)

func (*GuPacket) GetHex

func (p *GuPacket) GetHex() string

func (*GuPacket) JmpHead

func (p *GuPacket) JmpHead()

func (*GuPacket) Reset

func (p *GuPacket) Reset()

func (*GuPacket) SetBytes

func (p *GuPacket) SetBytes(bin []byte)

func (*GuPacket) SetLitTlv

func (this *GuPacket) SetLitTlv(Type uint8, Val []byte)

SetLitTlv 一种Type只有8bit的tlv结构

func (*GuPacket) SetLitTlvS

func (this *GuPacket) SetLitTlvS(Type uint8, Val string)

SetLitTlvS 一种Type只有8bit的tlv结构

func (*GuPacket) SetSToken

func (p *GuPacket) SetSToken(bin string)

func (*GuPacket) SetString

func (p *GuPacket) SetString(bin string)

func (*GuPacket) SetTlv

func (p *GuPacket) SetTlv(t *Tlv)

func (*GuPacket) SetToken

func (p *GuPacket) SetToken(bin []byte)

func (*GuPacket) SetUint16

func (p *GuPacket) SetUint16(i uint16)

func (*GuPacket) SetUint32

func (p *GuPacket) SetUint32(i uint32)

func (*GuPacket) SetUint64

func (p *GuPacket) SetUint64(i uint64)

func (*GuPacket) SetUint8

func (p *GuPacket) SetUint8(i uint8)

func (*GuPacket) ToTlv

func (p *GuPacket) ToTlv(t uint16) (bin []byte)

type GuUnPackFun

type GuUnPackFun func(pack *GuUnPacket)

type GuUnPacket

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

func NewGuUnPacket

func NewGuUnPacket(bin []byte) (u *GuUnPacket)

func NewGuUnPacketFun

func NewGuUnPacketFun(Buffer []byte, fun GuUnPackFun) *GuUnPacket

NewGuUnPacketFun 仿Mirai,这种还挺好用的

func (*GuUnPacket) GetAll

func (r *GuUnPacket) GetAll() []byte

func (*GuUnPacket) GetAllHex

func (r *GuUnPacket) GetAllHex() string

func (*GuUnPacket) GetAllHexTmp

func (r *GuUnPacket) GetAllHexTmp() string

func (*GuUnPacket) GetBin

func (r *GuUnPacket) GetBin(i int) []byte

func (*GuUnPacket) GetLen

func (r *GuUnPacket) GetLen() int

func (*GuUnPacket) GetStr

func (r *GuUnPacket) GetStr(i int32) string

func (*GuUnPacket) GetTlv

func (r *GuUnPacket) GetTlv() (t *Tlv)

func (*GuUnPacket) GetToken

func (r *GuUnPacket) GetToken() []byte

func (*GuUnPacket) GetUint16

func (r *GuUnPacket) GetUint16() uint16

func (*GuUnPacket) GetUint32

func (r *GuUnPacket) GetUint32() uint32

func (*GuUnPacket) GetUint8

func (r *GuUnPacket) GetUint8() uint8

func (*GuUnPacket) Skip

func (this *GuUnPacket) Skip(len int64)

type Tlv

type Tlv struct {
	Tag   uint
	Len   uint
	Value []byte
}

Jump to

Keyboard shortcuts

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