1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Utilities;
- namespace SMBLibrary
- {
-
-
-
- public class SecurityDescriptor
- {
- public byte Revision;
- public byte Sbz1;
- public ushort Control;
-
-
-
-
- public SID OwnerSid;
- public SID GroupSid;
- public ACL Sacl;
- public ACL Dacl;
- public SecurityDescriptor()
- {
- Revision = 0x01;
- }
- public SecurityDescriptor(byte[] buffer, int offset)
- {
- Revision = ByteReader.ReadByte(buffer, ref offset);
- Sbz1 = ByteReader.ReadByte(buffer, ref offset);
- Control = LittleEndianReader.ReadUInt16(buffer, ref offset);
- uint offsetOwner = LittleEndianReader.ReadUInt32(buffer, ref offset);
- uint offsetGroup = LittleEndianReader.ReadUInt32(buffer, ref offset);
- uint offsetSacl = LittleEndianReader.ReadUInt32(buffer, ref offset);
- uint offsetDacl = LittleEndianReader.ReadUInt32(buffer, ref offset);
- if (offsetOwner != 0)
- {
- OwnerSid = new SID(buffer, (int)offsetOwner);
- }
- if (offsetGroup != 0)
- {
- GroupSid = new SID(buffer, (int)offsetGroup);
- }
- if (offsetSacl != 0)
- {
- Sacl = new ACL(buffer, (int)offsetSacl);
- }
- if (offsetDacl != 0)
- {
- Dacl = new ACL(buffer, (int)offsetDacl);
- }
- }
- public byte[] GetBytes()
- {
- throw new NotImplementedException();
- }
- }
- }
|