Documentation ¶
Index ¶
- Variables
- func GenerateBatchQueryChunkedPacket(chunks int, query string) [][]byte
- func GenerateBatchQueryPacket(query string) []byte
- func GenerateCustomRPCCallPacket(procName string) []byte
- func GenerateExecuteSQLRPCChunkedPacket(chunks int, query string) [][]byte
- func GenerateExecuteSQLRPCPacket(query string) []byte
- func GenerateExecuteSQLRPCPacketNTEXT(query string) []byte
- func GeneratePacketHeader(packetType byte, packetStatus byte, length int, seq int) []byte
- func RPCClientPartiallyLength(procName string, length uint64, chunks uint64) []byte
Constants ¶
This section is empty.
Variables ¶
var ( // PreLogin is an example Pre-Login request packet from the protocol spec: // // https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/9420b4a3-eb9f-4f5e-90bd-3160444aa5a7 PreLogin = []byte{ 0x12, 0x01, 0x00, 0x2F, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x06, 0x01, 0x00, 0x20, 0x00, 0x01, 0x02, 0x00, 0x21, 0x00, 0x01, 0x03, 0x00, 0x22, 0x00, 0x04, 0x04, 0x00, 0x26, 0x00, 0x01, 0xFF, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xB8, 0x0D, 0x00, 0x00, 0x01, } // Login7 is an example Login7 request packet from the protocol spec: // // https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/ce5ad23f-6bf8-4fa5-9426-6b0d36e14da2 Login7 = []byte{}/* 144 elements not displayed */ // MalformedPacketTest is an RPC Request malformed packet. MalformedPacketTest = []byte{}/* 144 elements not displayed */ // AllHeadersSliceWithTransactionDescriptor is a ALL_HEADERS data stream // header containing the TransactionDescriptor data. It is required for // SQLBatch and RPC packets. // // https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/e17e54ae-0fac-48b7-b8a8-c267be297923 AllHeadersSliceWithTransactionDescriptor = []byte{ 0x16, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, } // FieldCollation definition for data parameters. Using "raw collation" is // ok for testing because the server is not processing it. // // https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/3d29e8dc-218a-42c6-9ba4-947ebca9fd7e FieldCollation = []byte{0x00, 0x00, 0x00, 0x00, 0x00} )
Functions ¶
func GenerateBatchQueryChunkedPacket ¶
GenerateBatchQueryChunkedPacket split a batch query into multiple network packets.
func GenerateBatchQueryPacket ¶
GenerateBatchQueryPacket generates a final SQLBatch with the provided query.
func GenerateCustomRPCCallPacket ¶
GenerateCustomRPCCallPacket generates a packet containing a custom RPC call with an empty integer parameter.
func GenerateExecuteSQLRPCChunkedPacket ¶
GenerateExecuteSQLRPCChunkedPacket slipt a RPC Call into multiple network packets.
func GenerateExecuteSQLRPCPacket ¶
GenerateExecuteSQLRPCPacket generates a RPC call packet containing a single parameter (NVARCHARTYPE).
func GenerateExecuteSQLRPCPacketNTEXT ¶
GenerateExecuteSQLRPCPacketNTEXT generates a RPC call packet containing a single parameter (NTEXT).
func GeneratePacketHeader ¶
GeneratePacketHeader generates a packet header based on the specified parameters.
func RPCClientPartiallyLength ¶
RPCClientVariableLength returns a RPCCLientRequest packet containing a partially Length-prefixed Bytes request, as described here: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/3f983fde-0509-485a-8c40-a9fa6679a828
Types ¶
This section is empty.