Esempio n. 1
0
        internal static bool IsExpectedResponse(SMBCommands command, byte[] data)
        {
            SMBHeader candidate = new SMBHeader(data.ExtractData(sizeof(int)), true);

            if ((byte)command != candidate.Cmd[0])
            {
                return(false);
            }
            byte[] errorCodeData = candidate.GetData(_errorcodeDescriptor);
            for (int index = 0; index < errorCodeData.Length; index++)
            {
                if (0 != errorCodeData[index])
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 2
0
 internal byte[] CalculateAndBuild(SMBHeader header)
 {
     Calculate();
     return(Build(header));
 }
Esempio n. 3
0
 internal byte[] Build(SMBHeader header)
 {
     byte[] result = base.Build(sizeof(int), header, this);
     result.Write(0, true, (result.Length - sizeof(int)));
     return(result);
 }