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