public override byte[] GetBytes(bool isUnicode) { this.SMBParameters = new byte[ParametersLength]; LittleEndianWriter.WriteUInt16(this.SMBParameters, 0, FID); SMBHelper.WriteUTime(this.SMBParameters, 2, LastTimeModified); return(base.GetBytes(isUnicode)); }
public override byte[] GetParameters(bool isUnicode) { byte[] parameters = new byte[ParametersLength]; LittleEndianWriter.WriteUInt16(parameters, 0, FID); LittleEndianWriter.WriteUInt16(parameters, 2, (ushort)FileAttributes); SMBHelper.WriteUTime(parameters, 4, CreationTime); LittleEndianWriter.WriteUInt32(parameters, 8, FileDataSize); AccessMode.WriteBytes(parameters, 12); LittleEndianWriter.WriteUInt16(parameters, 14, (ushort)ResourceType); NMPipeStatus.WriteBytes(parameters, 16); ActionTaken.WriteBytes(parameters, 18); LittleEndianWriter.WriteUInt32(parameters, 20, Reserved); LittleEndianWriter.WriteUInt16(parameters, 24, ExtendedAttributeErrorOffset); LittleEndianWriter.WriteUInt32(parameters, 26, ExtendedAttributeLength); return(parameters); }
public override byte[] GetBytes(bool isUnicode) { this.SMBParameters = new byte[ParametersLength]; int parametersOffset = 4; LittleEndianWriter.WriteUInt16(this.SMBParameters, ref parametersOffset, FID); LittleEndianWriter.WriteUInt16(this.SMBParameters, ref parametersOffset, (ushort)FileAttrs); SMBHelper.WriteUTime(this.SMBParameters, ref parametersOffset, LastWriteTime); LittleEndianWriter.WriteUInt32(this.SMBParameters, ref parametersOffset, FileDataSize); LittleEndianWriter.WriteUInt16(this.SMBParameters, ref parametersOffset, (ushort)AccessRights); LittleEndianWriter.WriteUInt16(this.SMBParameters, ref parametersOffset, (ushort)ResourceType); NMPipeStatus.WriteBytes(this.SMBParameters, ref parametersOffset); OpenResults.WriteBytes(this.SMBParameters, ref parametersOffset); ByteWriter.WriteBytes(this.SMBParameters, ref parametersOffset, Reserved, 6); return(base.GetBytes(isUnicode)); }
public override byte[] GetBytes(bool isUnicode) { this.SMBParameters = new byte[ParametersLength]; LittleEndianWriter.WriteUInt16(this.SMBParameters, 0, (ushort)FileAttributes); SMBHelper.WriteUTime(this.SMBParameters, 2, LastWriteTime); ByteWriter.WriteBytes(this.SMBParameters, 6, Reserved, 10); int length = 1; if (isUnicode) { length += FileName.Length * 2 + 2; } else { length += FileName.Length + 1; } this.SMBData = new byte[length]; ByteWriter.WriteByte(this.SMBData, 0, BufferFormat); SMBHelper.WriteSMBString(this.SMBData, 1, isUnicode, FileName); return(base.GetBytes(isUnicode)); }
public override byte[] GetParameters(bool isUnicode) { int length = 28; if (isUnicode) { length += FileName.Length * 2 + 2; } else { length += FileName.Length + 1; } byte[] parameters = new byte[length]; LittleEndianWriter.WriteUInt16(parameters, 0, (ushort)Flags); AccessMode.WriteBytes(parameters, 2); LittleEndianWriter.WriteUInt16(parameters, 4, Reserved1); LittleEndianWriter.WriteUInt16(parameters, 6, (ushort)FileAttributes); SMBHelper.WriteUTime(parameters, 8, CreationTime); OpenMode.WriteBytes(parameters, 12); LittleEndianWriter.WriteUInt32(parameters, 14, AllocationSize); ByteWriter.WriteBytes(parameters, 18, Reserved, 10); SMBHelper.WriteSMBString(parameters, 28, isUnicode, FileName); return parameters; }