mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-02 14:01:50 +02:00
SMB1: Corrected SMB_COM_TREE_CONNECT_ANDX request implementation and added constructor
This commit is contained in:
parent
573b14d9e1
commit
d98ed6c2b0
1 changed files with 7 additions and 2 deletions
|
@ -19,13 +19,18 @@ namespace SMBLibrary.SMB1
|
|||
public const int ParametersLength = 8;
|
||||
// Parameters:
|
||||
public TreeConnectFlags Flags;
|
||||
//ushort PasswordLength;
|
||||
// ushort PasswordLength;
|
||||
// Data:
|
||||
public byte[] Password;
|
||||
// Padding
|
||||
public string Path; // SMB_STRING (If Unicode, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header)
|
||||
public ServiceName Service; // OEM string
|
||||
|
||||
public TreeConnectAndXRequest()
|
||||
{
|
||||
Password = new byte[0];
|
||||
}
|
||||
|
||||
public TreeConnectAndXRequest(byte[] buffer, int offset, bool isUnicode) : base(buffer, offset, isUnicode)
|
||||
{
|
||||
int parametersOffset = 4;
|
||||
|
@ -56,7 +61,7 @@ namespace SMBLibrary.SMB1
|
|||
LittleEndianWriter.WriteUInt16(this.SMBParameters, ref parametersOffset, passwordLength);
|
||||
|
||||
string serviceString = ServiceNameHelper.GetServiceString(Service);
|
||||
int dataLength = Password.Length + serviceString.Length;
|
||||
int dataLength = Password.Length + serviceString.Length + 1;
|
||||
if (isUnicode)
|
||||
{
|
||||
int padding = (1 + passwordLength) % 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue