mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-15 03:33:47 +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
|
@ -26,6 +26,11 @@ namespace SMBLibrary.SMB1
|
||||||
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 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 ServiceName Service; // OEM string
|
||||||
|
|
||||||
|
public TreeConnectAndXRequest()
|
||||||
|
{
|
||||||
|
Password = new byte[0];
|
||||||
|
}
|
||||||
|
|
||||||
public TreeConnectAndXRequest(byte[] buffer, int offset, bool isUnicode) : base(buffer, offset, isUnicode)
|
public TreeConnectAndXRequest(byte[] buffer, int offset, bool isUnicode) : base(buffer, offset, isUnicode)
|
||||||
{
|
{
|
||||||
int parametersOffset = 4;
|
int parametersOffset = 4;
|
||||||
|
@ -56,7 +61,7 @@ namespace SMBLibrary.SMB1
|
||||||
LittleEndianWriter.WriteUInt16(this.SMBParameters, ref parametersOffset, passwordLength);
|
LittleEndianWriter.WriteUInt16(this.SMBParameters, ref parametersOffset, passwordLength);
|
||||||
|
|
||||||
string serviceString = ServiceNameHelper.GetServiceString(Service);
|
string serviceString = ServiceNameHelper.GetServiceString(Service);
|
||||||
int dataLength = Password.Length + serviceString.Length;
|
int dataLength = Password.Length + serviceString.Length + 1;
|
||||||
if (isUnicode)
|
if (isUnicode)
|
||||||
{
|
{
|
||||||
int padding = (1 + passwordLength) % 2;
|
int padding = (1 + passwordLength) % 2;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue