t128

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BITMAP_COMPRESSION        = 0x0001
	NO_BITMAP_COMPRESSION_HDR = 0x0400
)
View Source
const (
	CTRLACTION_REQUEST_CONTROL = 0x0001 //Request control
	CTRLACTION_GRANTED_CONTROL = 0x0002 //Granted control
	CTRLACTION_DETACH          = 0x0003 //Detach
	CTRLACTION_COOPERATE       = 0x0004 //Cooperate
)

Action

View Source
const (
	FASTPATH_INPUT_EVENT_SCANCODE = 0x0
	FASTPATH_INPUT_EVENT_MOUSE    = 0x1
	FASTPATH_INPUT_EVENT_MOUSEX   = 0x2
	FASTPATH_INPUT_EVENT_SYNC     = 0x3
	FASTPATH_INPUT_EVENT_UNICODE  = 0x4
)

FastPath Input Events

View Source
const (
	FASTPATH_INPUT_ACTION_FASTPATH = 0x0
	FASTPATH_INPUT_ACTION_X224     = 0x3
)

action

View Source
const (
	FASTPATH_INPUT_SECURE_CHECKSUM = 0x1
	FASTPATH_INPUT_ENCRYPTED       = 0x2
)

flags

View Source
const (
	FASTPATH_UPDATETYPE_ORDERS        = 0x0
	FASTPATH_UPDATETYPE_BITMAP        = 0x1
	FASTPATH_UPDATETYPE_PALETTE       = 0x2
	FASTPATH_UPDATETYPE_SYNCHRONIZE   = 0x3
	FASTPATH_UPDATETYPE_SURFCMDS      = 0x4
	FASTPATH_UPDATETYPE_PTR_NULL      = 0x5
	FASTPATH_UPDATETYPE_PTR_DEFAULT   = 0x6
	FASTPATH_UPDATETYPE_PTR_POSITION  = 0x8
	FASTPATH_UPDATETYPE_COLOR         = 0x9
	FASTPATH_UPDATETYPE_CACHED        = 0xA
	FASTPATH_UPDATETYPE_POINTER       = 0xB
	FASTPATH_UPDATETYPE_LARGE_POINTER = 0xC
)

update code

View Source
const (
	FASTPATH_FRAGMENT_SINGLE = 0x0
	FASTPATH_FRAGMENT_LAST   = 0x1
	FASTPATH_FRAGMENT_FIRST  = 0x2
	FASTPATH_FRAGMENT_NEXT   = 0x3
)

fragmentation

View Source
const (
	// Mouse wheel event:
	PTRFLAGS_HWHEEL         = 0x0400
	PTRFLAGS_WHEEL          = 0x0200
	PTRFLAGS_WHEEL_NEGATIVE = 0x0100
	WheelRotationMask       = 0x01FF

	// Mouse movement event:
	PTRFLAGS_MOVE = 0x0800

	// Mouse button events:
	PTRFLAGS_DOWN    = 0x8000
	PTRFLAGS_BUTTON1 = 0x1000
	PTRFLAGS_BUTTON2 = 0x2000
	PTRFLAGS_BUTTON3 = 0x4000
)
View Source
const (
	PDUTYPE_DEMANDACTIVEPDU  = 0x11 //Demand Active PDU (section 2.2.1.13.1).
	PDUTYPE_CONFIRMACTIVEPDU = 0x13 //Confirm Active PDU (section 2.2.1.13.2).
	PDUTYPE_DEACTIVATEALLPDU = 0x16 //Deactivate All PDU (section 2.2.3.1).
	PDUTYPE_DATAPDU          = 0x17 //Data PDU (actual type is revealed by the pduType2 field in the Share Data Header (section 2.2.8.1.1.1.2) structure).
	PDUTYPE_SERVER_REDIR_PKT = 0x1A //Enhanced Security Server Redirection PDU (section 2.2.13.3.1).
)
View Source
const (
	PDUTYPE2_UPDATE                      = 0x02
	PDUTYPE2_CONTROL                     = 0x14
	PDUTYPE2_POINTER                     = 0x1B
	PDUTYPE2_INPUT                       = 0x1C
	PDUTYPE2_SYNCHRONIZE                 = 0x1F
	PDUTYPE2_REFRESH_RECT                = 0x21
	PDUTYPE2_PLAY_SOUND                  = 0x22
	PDUTYPE2_SUPPRESS_OUTPUT             = 0x23
	PDUTYPE2_SHUTDOWN_REQUEST            = 0x24
	PDUTYPE2_SHUTDOWN_DENIED             = 0x25
	PDUTYPE2_SAVE_SESSION_INFO           = 0x26
	PDUTYPE2_FONTLIST                    = 0x27
	PDUTYPE2_FONTMAP                     = 0x28
	PDUTYPE2_SET_KEYBOARD_INDICATORS     = 0x29
	PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST = 0x2B
	PDUTYPE2_BITMAPCACHE_ERROR_PDU       = 0x2C
	PDUTYPE2_SET_KEYBOARD_IME_STATUS     = 0x2D
	PDUTYPE2_OFFSCRCACHE_ERROR_PDU       = 0x2E
	PDUTYPE2_SET_ERROR_INFO_PDU          = 0x2F
	PDUTYPE2_DRAWNINEGRID_ERROR_PDU      = 0x30
	PDUTYPE2_DRAWGDIPLUS_ERROR_PDU       = 0x31
	PDUTYPE2_ARC_STATUS_PDU              = 0x32
	PDUTYPE2_STATUS_INFO_PDU             = 0x36
	PDUTYPE2_MONITOR_LAYOUT_PDU          = 0x37
)
View Source
const (
	STREAM_UNDEFINED = 0x00
	STREAM_LOW       = 0x01
	STREAM_MED       = 0x02
	STREAM_HI        = 0x04
)

StreamId

View Source
const (
	PACKET_COMPRESSED = 0x20
	PACKET_AT_FRONT   = 0x40
	PACKET_FLUSHED    = 0x80
)

Level-2 Compression Flags

View Source
const (
	L1_PACKET_AT_FRONT   = 0x04
	L1_NO_COMPRESSION    = 0x02
	L1_COMPRESSED        = 0x01
	L1_INNER_COMPRESSION = 0x10
)

Level-1 Compression Flags

View Source
const (
	PACKET_COMPR_TYPE_8K    = 0x0
	PACKET_COMPR_TYPE_64K   = 0x1
	PACKET_COMPR_TYPE_RDP6  = 0x2
	PACKET_COMPR_TYPE_RDP61 = 0x3
)
View Source
const (
	FASTPATH_OUTPUT_COMPRESSION_USED = 0x2
)

compression

View Source
const (
	SYNCMSGTYPE_SYNC = 1
)

Variables

This section is empty.

Functions

func WriteDataPdu

func WriteDataPdu(w io.Writer, userId uint16, shareId uint32, pdu DataPDU)

func WriteFastPathInputPDU added in v0.0.4

func WriteFastPathInputPDU(w io.Writer, pdu *TsFpInputPdu)

func WritePDU

func WritePDU(w io.Writer, userId uint16, pdu PDU)

Types

type DataPDU

type DataPDU interface {
	Read(r io.Reader) DataPDU
	Serialize() []byte
	Type2() uint8
	// contains filtered or unexported methods
}

func ReadExpectedDataPDU

func ReadExpectedDataPDU(r io.Reader, typ2 uint8) DataPDU

type FpInputHeader added in v0.0.3

type FpInputHeader struct {
	Action    uint8
	NumEvents uint8
	Flags     uint8
}

FpInputHeader https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/b8e7c588-51cb-455b-bb73-92d480903133

func (*FpInputHeader) Write added in v0.0.3

func (h *FpInputHeader) Write(w io.Writer)

type FpOutputHeader

type FpOutputHeader struct {
	UpdateCode    uint8
	Fragmentation uint8
	Compression   uint8
}

FpOutputHeader https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/a1c4caa8-00ed-45bb-a06e-5177473766d3

func (*FpOutputHeader) Read

func (h *FpOutputHeader) Read(r io.Reader)

type PDU

type PDU interface {
	Read(r io.Reader) PDU
	Serialize() []byte
	Type() uint16
	// contains filtered or unexported methods
}

func ReadExpectedPDU

func ReadExpectedPDU(r io.Reader, typ uint16) PDU

func ReadFastPathPDU

func ReadFastPathPDU(r io.Reader) PDU

func ReadPDU

func ReadPDU(r io.Reader) PDU

type TsBitmapData

type TsBitmapData struct {
	DestLeft         uint16
	DestTop          uint16
	DestRight        uint16
	DestBottom       uint16
	Width            uint16
	Height           uint16
	BitsPerPixel     uint16
	Flags            uint16
	BitmapLength     uint16
	BitmapComprHdr   *TsCdHeader
	BitmapDataStream []byte
}

TsBitmapData https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/84a3d4d2-5523-4e49-9a48-33952c559485

func (*TsBitmapData) Read

func (d *TsBitmapData) Read(r io.Reader)

type TsCdHeader

type TsCdHeader struct {
	CbCompFirstRowSize uint16 // The field MUST be set to 0x0000.
	CbCompMainBodySize uint16 // The size in bytes of the compressed bitmap data
	CbScanWidth        uint16 // The width of the bitmap (which follows this header) in pixels (this value MUST be divisible by 4).
	CbUncompressedSize uint16 // The size in bytes of the bitmap data (which follows this header) after it has been decompressed.
}

TsCdHeader https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/3d1ccc49-51e2-4a2c-b300-3da9fb931d0e

func (*TsCdHeader) Read

func (h *TsCdHeader) Read(r io.Reader) *TsCdHeader

type TsConfirmActivePduData

type TsConfirmActivePduData struct {
	SharedId                   uint32
	OriginatorId               uint16 //This field MUST be set to the server channel ID (0x03EA).
	LengthSourceDescriptor     uint16
	LengthCombinedCapabilities uint16
	SourceDescriptor           []byte //A variable-length array of bytes containing a source descriptor
	NumberCapabilities         uint16
	Pad2Octets                 uint16
	CapabilitySets             []capability.TsCapsSet
}

TsConfirmActivePduData https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/4e9722c3-ad83-43f5-af5a-529f73d88b48

func NewTsConfirmActivePduData

func NewTsConfirmActivePduData(demandActivePdu *TsDemandActivePduData) *TsConfirmActivePduData

func (*TsConfirmActivePduData) Read

func (d *TsConfirmActivePduData) Read(r io.Reader) PDU

func (*TsConfirmActivePduData) Serialize

func (d *TsConfirmActivePduData) Serialize() []byte

func (*TsConfirmActivePduData) Type

func (d *TsConfirmActivePduData) Type() uint16

func (*TsConfirmActivePduData) Write

func (d *TsConfirmActivePduData) Write(w io.Writer)

type TsControlPDU

type TsControlPDU struct {
	Action    uint16
	GrantId   uint16
	ControlId uint32
}

TsControlPDU https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/0448f397-aa11-455d-81b1-f1265085239d

func (*TsControlPDU) Read

func (t *TsControlPDU) Read(r io.Reader) DataPDU

func (*TsControlPDU) Serialize

func (t *TsControlPDU) Serialize() []byte

func (*TsControlPDU) Type2

func (t *TsControlPDU) Type2() uint8

type TsDataPduData

type TsDataPduData struct {
	Header  TsShareDataHeader
	PduData []byte
	Pdu     DataPDU
}

func NewDataPdu

func NewDataPdu(pdu DataPDU, shareId uint32) *TsDataPduData

func (*TsDataPduData) Read

func (t *TsDataPduData) Read(r io.Reader) PDU

func (*TsDataPduData) Serialize

func (t *TsDataPduData) Serialize() []byte

func (*TsDataPduData) Type

func (t *TsDataPduData) Type() uint16

type TsDemandActivePduData

type TsDemandActivePduData struct {
	SharedId                   uint32
	LengthSourceDescriptor     uint16
	LengthCombinedCapabilities uint16
	SourceDescriptor           []byte
	NumberCapabilities         uint16
	Pad2Octets                 uint16
	CapabilitySets             []capability.TsCapsSet
	SessionId                  uint32
}

TsDemandActivePduData https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/bd612af5-cb54-43a2-9646-438bc3ecf5db

func (*TsDemandActivePduData) Read

func (d *TsDemandActivePduData) Read(r io.Reader) PDU

func (*TsDemandActivePduData) Serialize

func (d *TsDemandActivePduData) Serialize() []byte

func (*TsDemandActivePduData) Type

func (d *TsDemandActivePduData) Type() uint16

type TsFontListPDU

type TsFontListPDU struct {
	NumberFonts   uint16
	TotalNumFonts uint16
	ListFlags     uint16 //This field SHOULD be set to 0x0003
	EntrySize     uint16 //This field SHOULD be set to 0x0032 (50 bytes).
}

TsFontListPDU https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/e373575a-01e2-43a7-a6d8-e1952b83e787

func (*TsFontListPDU) Read

func (t *TsFontListPDU) Read(r io.Reader) DataPDU

func (*TsFontListPDU) Serialize

func (t *TsFontListPDU) Serialize() []byte

func (*TsFontListPDU) Type2

func (t *TsFontListPDU) Type2() uint8

type TsFontMapPDU

type TsFontMapPDU struct {
	NumberEntries   uint16
	TotalNumEntries uint16
	MapFlags        uint16
	EntrySize       uint16
}

TsFontMapPDU https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/b4e557f3-7540-46fc-815d-0c12299cf1ee

func (*TsFontMapPDU) Read

func (t *TsFontMapPDU) Read(r io.Reader) DataPDU

func (*TsFontMapPDU) Serialize

func (t *TsFontMapPDU) Serialize() []byte

func (*TsFontMapPDU) Type2

func (t *TsFontMapPDU) Type2() uint8

type TsFpInputEvent added in v0.0.3

type TsFpInputEvent interface {
	Serialize() []byte
	// contains filtered or unexported methods
}

TsFpInputEvent https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/76c4dd59-7ba0-445d-a03c-885212ab80f6

type TsFpInputPdu added in v0.0.3

type TsFpInputPdu struct {
	Header          FpInputHeader
	Length          uint16
	FipsInformation uint32           // Optional: when Server Security Data (TS_UD_SC_SEC1) is set
	DataSignature   [8]byte          // Optional: existed if (Header.Flag & FASTPATH_INPUT_SECURE_CHECKSUM)
	NumEvents       uint8            // Optional: if (header.NumEvent != 0)
	FpInputEvents   []TsFpInputEvent // An array of Fast-Path Input Event (section 2.2.8.1.2.2)
}

TsFpInputPdu https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/b8e7c588-51cb-455b-bb73-92d480903133

func NewFastPathMouseInputPDU added in v0.0.3

func NewFastPathMouseInputPDU(pointerFlags uint16, xPos, yPos uint16) *TsFpInputPdu

func (*TsFpInputPdu) Serialize added in v0.0.3

func (pdu *TsFpInputPdu) Serialize() []byte

type TsFpKeyboardEvent added in v0.0.3

type TsFpKeyboardEvent struct {
}

TsFpKeyboardEvent https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/089d362b-31eb-4a1a-b6fa-92fe61bb5dbf

func (*TsFpKeyboardEvent) Serialize added in v0.0.3

func (e *TsFpKeyboardEvent) Serialize() []byte

type TsFpUpdateBitmap

type TsFpUpdateBitmap struct {
	UpdateType       int16 // This field MUST be set to UPDATETYPE_BITMAP (0x0001).
	NumberRectangles uint16
	Rectangles       []TsBitmapData
}

TsFpUpdateBitmap https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/d681bb11-f3b5-4add-b092-19fe7075f9e3

func (*TsFpUpdateBitmap) Read

func (t *TsFpUpdateBitmap) Read(r io.Reader) UpdatePDU

type TsFpUpdatePDU

type TsFpUpdatePDU struct {
	Header FpOutputHeader
	Length uint16
	PDU    UpdatePDU
}

TsFpUpdatePDU https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/68b5ee54-d0d5-4d65-8d81-e1c4025f7597

func (*TsFpUpdatePDU) Read

func (p *TsFpUpdatePDU) Read(r io.Reader) PDU

func (*TsFpUpdatePDU) Serialize

func (p *TsFpUpdatePDU) Serialize() []byte

func (*TsFpUpdatePDU) Type

func (p *TsFpUpdatePDU) Type() uint16

type TsSaveSessionInfoPDU

type TsSaveSessionInfoPDU struct {
}

TsSaveSessionInfoPDU https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/d892bc5b-aecd-4aee-99b6-5f43b5a63d75

func (*TsSaveSessionInfoPDU) Read

func (*TsSaveSessionInfoPDU) Serialize

func (t *TsSaveSessionInfoPDU) Serialize() []byte

func (*TsSaveSessionInfoPDU) Type2

func (t *TsSaveSessionInfoPDU) Type2() uint8

type TsSetErrorInfoPDU

type TsSetErrorInfoPDU struct {
	ErrorInfo uint32
}

TsSetErrorInfoPDU https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/a21a1bd9-2303-49c1-90ec-3932435c248c

func (*TsSetErrorInfoPDU) Read

func (t *TsSetErrorInfoPDU) Read(r io.Reader) DataPDU

func (*TsSetErrorInfoPDU) Serialize

func (t *TsSetErrorInfoPDU) Serialize() []byte

func (*TsSetErrorInfoPDU) Type2

func (t *TsSetErrorInfoPDU) Type2() uint8

type TsShareControlHeader

type TsShareControlHeader struct {
	TotalLength uint16
	PDUType     uint16
	PDUSource   uint16
}

TsShareControlHeader https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/73d01865-2eae-407f-9b2c-87e31daac471

func (*TsShareControlHeader) Read

func (h *TsShareControlHeader) Read(r io.Reader)

func (*TsShareControlHeader) Serialize

func (h *TsShareControlHeader) Serialize() []byte

func (*TsShareControlHeader) Write

func (h *TsShareControlHeader) Write(w io.Writer)

type TsShareDataHeader

type TsShareDataHeader struct {
	SharedId           uint32
	Padding1           uint8
	StreamId           uint8
	UncompressedLength uint16
	PDUType2           uint8

	//https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/9355a663-ef22-4431-afeb-d72ac68f25fd
	CompressedType   uint8
	CompressedLength uint16
}

TsShareDataHeader https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/4b5d4c0d-a657-41e9-9c69-d58632f46d31

func (*TsShareDataHeader) Read

func (h *TsShareDataHeader) Read(r io.Reader)

type TsSynchronizePduData

type TsSynchronizePduData struct {
	MessageType uint16 // This field MUST be set to SYNCMSGTYPE_SYNC (1).
	TargetUser  uint16 //A 16-bit, unsigned integer. The MCS channel ID of the target user.
}

TsSynchronizePduData https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/3fb4c95e-ad2d-43d1-a46f-5bd49418da49

func NewTsSynchronizePduData

func NewTsSynchronizePduData(targetUser uint16) *TsSynchronizePduData

func (*TsSynchronizePduData) Read

func (*TsSynchronizePduData) Serialize

func (t *TsSynchronizePduData) Serialize() []byte

func (*TsSynchronizePduData) Type2

func (t *TsSynchronizePduData) Type2() uint8

type UpdatePDU

type UpdatePDU interface {
	Read(r io.Reader) UpdatePDU
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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