123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Utilities;
- namespace SMBLibrary.SMB1
- {
- public abstract class SMBAndXCommand : SMB1Command
- {
- public CommandName AndXCommand;
- public byte AndXReserved;
- public ushort AndXOffset;
- public SMBAndXCommand() : base()
- {
- }
- public SMBAndXCommand(byte[] buffer, int offset, bool isUnicode) : base(buffer, offset, isUnicode)
- {
- AndXCommand = (CommandName)ByteReader.ReadByte(this.SMBParameters, 0);
- AndXReserved = ByteReader.ReadByte(this.SMBParameters, 1);
- AndXOffset = LittleEndianConverter.ToUInt16(this.SMBParameters, 2);
- }
- public override byte[] GetBytes(bool isUnicode)
- {
- ByteWriter.WriteByte(this.SMBParameters, 0, (byte)AndXCommand);
- ByteWriter.WriteByte(this.SMBParameters, 1, AndXReserved);
- LittleEndianWriter.WriteUInt16(this.SMBParameters, 2, AndXOffset);
- return base.GetBytes(isUnicode);
- }
- public static void WriteAndXOffset(byte[] buffer, int commandOffset, ushort AndXOffset)
- {
-
- LittleEndianWriter.WriteUInt16(buffer, commandOffset + 3, AndXOffset);
- }
- }
- }
|