1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Utilities;
- namespace SMBLibrary.SMB1
- {
-
-
-
- public class TransactionQueryNamedPipeInfoResponse : TransactionSubcommand
- {
- public const int ParametersLength = 0;
-
- public ushort OutputBufferSize;
- public ushort InputBufferSize;
- public byte MaximumInstances;
- public byte CurrentInstances;
- public byte PipeNameLength;
- public string PipeName;
- public TransactionQueryNamedPipeInfoResponse() : base()
- {}
- public TransactionQueryNamedPipeInfoResponse(byte[] data, bool isUnicode) : base()
- {
- OutputBufferSize = LittleEndianConverter.ToUInt16(data, 0);
- InputBufferSize = LittleEndianConverter.ToUInt16(data, 2);
- MaximumInstances = ByteReader.ReadByte(data, 4);
- CurrentInstances = ByteReader.ReadByte(data, 5);
- PipeNameLength = ByteReader.ReadByte(data, 6);
-
- PipeName = SMB1Helper.ReadSMBString(data, 8, isUnicode);
- }
- public override byte[] GetData(bool isUnicode)
- {
- int length = 8;
- if (isUnicode)
- {
- length += PipeName.Length * 2 + 2;
- }
- else
- {
- length += PipeName.Length + 1;
- }
- byte[] data = new byte[length];
- LittleEndianWriter.WriteUInt16(data, 0, OutputBufferSize);
- LittleEndianWriter.WriteUInt16(data, 2, InputBufferSize);
- ByteWriter.WriteByte(data, 4, MaximumInstances);
- ByteWriter.WriteByte(data, 5, CurrentInstances);
- ByteWriter.WriteByte(data, 6, PipeNameLength);
- SMB1Helper.WriteSMBString(data, 8, isUnicode, PipeName);
- return data;
- }
- public override TransactionSubcommandName SubcommandName
- {
- get
- {
- return TransactionSubcommandName.TRANS_QUERY_NMPIPE_INFO;
- }
- }
- }
- }
|