SMB1: Corrected implementation of SMB_COM_TRANSACTION subcommand requests

This commit is contained in:
Tal Aloni 2017-09-09 02:20:15 +03:00
parent 62556a1bdc
commit 144f5c1cbd
10 changed files with 23 additions and 20 deletions

View file

@ -23,7 +23,6 @@ namespace SMBLibrary.SMB1
public TransactionCallNamedPipeRequest() : base()
{
}
public TransactionCallNamedPipeRequest(byte[] setup, byte[] data) : base()
@ -38,7 +37,7 @@ namespace SMBLibrary.SMB1
byte[] setup = new byte[4];
LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
LittleEndianWriter.WriteUInt16(setup, 2, Priority);
return base.GetSetup();
return setup;
}
public override byte[] GetData()

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
*
* You can redistribute this program and/or modify it under the terms of
* the GNU Lesser Public License as published by the Free Software Foundation,
@ -20,7 +20,8 @@ namespace SMBLibrary.SMB1
public ushort FID;
public TransactionPeekNamedPipeRequest() : base()
{}
{
}
public TransactionPeekNamedPipeRequest(byte[] setup) : base()
{
@ -32,7 +33,7 @@ namespace SMBLibrary.SMB1
byte[] setup = new byte[4];
LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
LittleEndianWriter.WriteUInt16(setup, 2, FID);
return base.GetSetup();
return setup;
}
public override TransactionSubcommandName SubcommandName

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
*
* You can redistribute this program and/or modify it under the terms of
* the GNU Lesser Public License as published by the Free Software Foundation,
@ -37,7 +37,7 @@ namespace SMBLibrary.SMB1
byte[] setup = new byte[4];
LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
LittleEndianWriter.WriteUInt16(setup, 2, FID);
return base.GetSetup();
return setup;
}
public override byte[] GetParameters(bool isUnicode)

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
*
* You can redistribute this program and/or modify it under the terms of
* the GNU Lesser Public License as published by the Free Software Foundation,
@ -33,7 +33,7 @@ namespace SMBLibrary.SMB1
byte[] setup = new byte[4];
LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
LittleEndianWriter.WriteUInt16(setup, 2, FID);
return base.GetSetup();
return setup;
}
public override TransactionSubcommandName SubcommandName

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
*
* You can redistribute this program and/or modify it under the terms of
* the GNU Lesser Public License as published by the Free Software Foundation,
@ -24,6 +24,7 @@ namespace SMBLibrary.SMB1
public TransactionRawWriteNamedPipeRequest() : base()
{
}
public TransactionRawWriteNamedPipeRequest(byte[] setup, byte[] data) : base()
{
FID = LittleEndianConverter.ToUInt16(setup, 2);
@ -36,7 +37,7 @@ namespace SMBLibrary.SMB1
byte[] setup = new byte[4];
LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
LittleEndianWriter.WriteUInt16(setup, 2, FID);
return base.GetSetup();
return setup;
}
public override byte[] GetData()

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
*
* You can redistribute this program and/or modify it under the terms of
* the GNU Lesser Public License as published by the Free Software Foundation,
@ -20,7 +20,8 @@ namespace SMBLibrary.SMB1
public ushort FID;
public TransactionReadNamedPipeRequest() : base()
{}
{
}
public TransactionReadNamedPipeRequest(byte[] setup): base()
{
@ -32,7 +33,7 @@ namespace SMBLibrary.SMB1
byte[] setup = new byte[4];
LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
LittleEndianWriter.WriteUInt16(setup, 2, FID);
return base.GetSetup();
return setup;
}
public override TransactionSubcommandName SubcommandName

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
*
* You can redistribute this program and/or modify it under the terms of
* the GNU Lesser Public License as published by the Free Software Foundation,
@ -37,7 +37,7 @@ namespace SMBLibrary.SMB1
byte[] setup = new byte[4];
LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
LittleEndianWriter.WriteUInt16(setup, 2, FID);
return base.GetSetup();
return setup;
}
public override byte[] GetParameters(bool isUnicode)

View file

@ -36,7 +36,7 @@ namespace SMBLibrary.SMB1
byte[] setup = new byte[4];
LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
LittleEndianWriter.WriteUInt16(setup, 2, FID);
return base.GetSetup();
return setup;
}
public override byte[] GetData()

View file

@ -33,7 +33,7 @@ namespace SMBLibrary.SMB1
byte[] setup = new byte[4];
LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
LittleEndianWriter.WriteUInt16(setup, 2, Priority);
return base.GetSetup();
return setup;
}
public override TransactionSubcommandName SubcommandName

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
*
* You can redistribute this program and/or modify it under the terms of
* the GNU Lesser Public License as published by the Free Software Foundation,
@ -28,6 +28,7 @@ namespace SMBLibrary.SMB1
public TransactionWriteNamedPipeRequest(byte[] setup, byte[] data): base()
{
FID = LittleEndianConverter.ToUInt16(setup, 2);
WriteData = data;
}
@ -36,7 +37,7 @@ namespace SMBLibrary.SMB1
byte[] setup = new byte[4];
LittleEndianWriter.WriteUInt16(setup, 0, (ushort)this.SubcommandName);
LittleEndianWriter.WriteUInt16(setup, 2, FID);
return base.GetSetup();
return setup;
}
public override byte[] GetData()