Beispiel #1
0
        public SMBMessage(byte[] buffer)
        {
            Header = new SMBHeader(buffer);
            SMBCommand command = SMBCommand.ReadCommand(buffer, SMBHeader.Length, Header.Command, Header);

            Commands.Add(command);
            while (command is SMBAndXCommand)
            {
                SMBAndXCommand andXCommand = (SMBAndXCommand)command;
                if (andXCommand.AndXCommand == CommandName.SMB_COM_NO_ANDX_COMMAND)
                {
                    break;
                }
                command = SMBCommand.ReadCommand(buffer, andXCommand.AndXOffset, andXCommand.AndXCommand, Header);
                Commands.Add(command);
            }
        }
Beispiel #2
0
 public static SMBCommand ReadCommand(byte[] buffer, int offset, CommandName commandName, SMBHeader header)
 {
     if ((header.Flags & HeaderFlags.Reply) > 0)
     {
         return(ReadCommandResponse(buffer, offset, commandName, header.UnicodeFlag));
     }
     else
     {
         return(ReadCommandRequest(buffer, offset, commandName, header.UnicodeFlag));
     }
 }
Beispiel #3
0
 public SMBMessage()
 {
     Header = new SMBHeader();
 }