Beispiel #1
0
        private static NTCreateAndXResponseExtended CreateResponseExtendedFromFileSystemEntry(FileSystemEntry entry, ushort fileID)
        {
            NTCreateAndXResponseExtended response = new NTCreateAndXResponseExtended();

            if (entry.IsDirectory)
            {
                response.ExtFileAttributes = ExtendedFileAttributes.Directory;
                response.Directory         = true;
            }
            else
            {
                response.ExtFileAttributes = ExtendedFileAttributes.Normal;
            }
            response.FID                      = fileID;
            response.CreateTime               = entry.CreationTime;
            response.LastAccessTime           = entry.LastAccessTime;
            response.LastWriteTime            = entry.LastWriteTime;
            response.LastChangeTime           = entry.LastWriteTime;
            response.CreateDisposition        = CreateDisposition.FILE_OPEN;
            response.AllocationSize           = InfoHelper.GetAllocationSize(entry.Size);
            response.EndOfFile                = entry.Size;
            response.ResourceType             = ResourceType.FileTypeDisk;
            response.FileStatus               = FileStatus.NO_EAS | FileStatus.NO_SUBSTREAMS | FileStatus.NO_REPARSETAG;
            response.MaximalAccessRights.File = FileAccessMask.FILE_READ_DATA | FileAccessMask.FILE_WRITE_DATA | FileAccessMask.FILE_APPEND_DATA |
                                                FileAccessMask.FILE_READ_EA | FileAccessMask.FILE_WRITE_EA |
                                                FileAccessMask.FILE_EXECUTE |
                                                FileAccessMask.FILE_READ_ATTRIBUTES | FileAccessMask.FILE_WRITE_ATTRIBUTES |
                                                FileAccessMask.DELETE | FileAccessMask.READ_CONTROL | FileAccessMask.WRITE_DAC | FileAccessMask.WRITE_OWNER | FileAccessMask.SYNCHRONIZE;
            response.GuestMaximalAccessRights.File = FileAccessMask.FILE_READ_DATA | FileAccessMask.FILE_WRITE_DATA |
                                                     FileAccessMask.FILE_READ_EA | FileAccessMask.FILE_WRITE_EA |
                                                     FileAccessMask.FILE_READ_ATTRIBUTES | FileAccessMask.FILE_WRITE_ATTRIBUTES |
                                                     FileAccessMask.READ_CONTROL | FileAccessMask.SYNCHRONIZE;
            return(response);
        }
Beispiel #2
0
        private static NTCreateAndXResponse CreateResponseFromFileSystemEntry(FileSystemEntry entry, ushort fileID)
        {
            NTCreateAndXResponse response = new NTCreateAndXResponse();

            if (entry.IsDirectory)
            {
                response.ExtFileAttributes = ExtendedFileAttributes.Directory;
                response.Directory         = true;
            }
            else
            {
                response.ExtFileAttributes = ExtendedFileAttributes.Normal;
            }
            response.FID = fileID;
            response.CreateDisposition = CreateDisposition.FILE_OPEN;
            response.AllocationSize    = InfoHelper.GetAllocationSize(entry.Size);
            response.EndOfFile         = entry.Size;
            response.CreateTime        = entry.CreationTime;
            response.LastAccessTime    = entry.LastAccessTime;
            response.LastWriteTime     = entry.LastWriteTime;
            response.LastChangeTime    = entry.LastWriteTime;
            response.ResourceType      = ResourceType.FileTypeDisk;
            return(response);
        }