diff --git a/build_lists/regexes.yaml b/build_lists/regexes.yaml
index 7c24c53..42a4dd4 100644
--- a/build_lists/regexes.yaml
+++ b/build_lists/regexes.yaml
@@ -1,2 +1,2 @@
-This is a placeholder.
-To fill this yaml execute one of the scripts download_regexes.py or download_regexes.ps1
\ No newline at end of file
+# This is a placeholder.
+# To fill this yaml execute one of the scripts download_regexes.py or download_regexes.ps1
\ No newline at end of file
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/ChangeErrorMode.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/ChangeErrorMode.cs
new file mode 100644
index 0000000..e79a5cd
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/ChangeErrorMode.cs
@@ -0,0 +1,56 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ internal static partial class NativeMethods
+ {
+ /// Controls whether the system will handle the specified types of serious errors or whether the process will handle them.
+ /// Minimum supported client: Windows 2000 Professional
+ /// Minimum supported server: Windows 2000 Server
+ public sealed class ChangeErrorMode : IDisposable
+ {
+ private readonly ErrorMode _oldMode;
+
+ /// ChangeErrorMode is for the Win32 SetThreadErrorMode() method, used to suppress possible pop-ups.
+ /// One of the values.
+ public ChangeErrorMode(ErrorMode mode)
+ {
+ if (IsAtLeastWindows7)
+ SetThreadErrorMode(mode, out _oldMode);
+ else
+ _oldMode = SetErrorMode(mode);
+ }
+
+ void IDisposable.Dispose()
+ {
+ ErrorMode oldMode;
+
+ if (IsAtLeastWindows7)
+ SetThreadErrorMode(_oldMode, out oldMode);
+ else
+ SetErrorMode(_oldMode);
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Device.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Device.cs
new file mode 100644
index 0000000..3342f5b
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Device.cs
@@ -0,0 +1,522 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using Microsoft.Win32.SafeHandles;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Globalization;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Security.AccessControl;
+using System.Text;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ /// Provides static methods to retrieve device resource information from a local or remote host.
+ public static class Device
+ {
+ #region Enumerate Devices
+
+ /// [AlphaFS] Enumerates all available devices on the local host.
+ /// instances of type from the local host.
+ /// One of the devices.
+ //[SecurityCritical]
+ //public static IEnumerable EnumerateDevices(DeviceGuid deviceGuid)
+ //{
+ // return EnumerateDevicesCore(null, deviceGuid, true);
+ //}
+
+
+ ///// [AlphaFS] Enumerates all available devices of type on the local or remote host.
+ ///// instances of type for the specified .
+ ///// The name of the local or remote host on which the device resides. null refers to the local host.
+ ///// One of the devices.
+ //[SecurityCritical]
+ //public static IEnumerable EnumerateDevices(string hostName, DeviceGuid deviceGuid)
+ //{
+ // return EnumerateDevicesCore(hostName, deviceGuid, true);
+ //}
+
+
+
+
+ /// [AlphaFS] Enumerates all available devices on the local or remote host.
+ //[SecurityCritical]
+ //internal static IEnumerable EnumerateDevicesCore(string hostName, DeviceGuid deviceGuid, bool getAllProperties)
+ //{
+ // if (Utils.IsNullOrWhiteSpace(hostName))
+ // hostName = Environment.MachineName;
+
+
+ // // CM_Connect_Machine()
+ // // MSDN Note: Beginning in Windows 8 and Windows Server 2012 functionality to access remote machines has been removed.
+ // // You cannot access remote machines when running on these versions of Windows.
+ // // http://msdn.microsoft.com/en-us/library/windows/hardware/ff537948%28v=vs.85%29.aspx
+
+
+ // SafeCmConnectMachineHandle safeMachineHandle;
+
+ // var lastError = NativeMethods.CM_Connect_Machine(Host.GetUncName(hostName), out safeMachineHandle);
+
+ // NativeMethods.IsValidHandle(safeMachineHandle, lastError);
+
+
+ // var classGuid = new Guid(Utils.GetEnumDescription(deviceGuid));
+
+
+ // // Start at the "Root" of the device tree of the specified machine.
+
+ // using (safeMachineHandle)
+ // using (var safeHandle = NativeMethods.SetupDiGetClassDevsEx(ref classGuid, IntPtr.Zero, IntPtr.Zero, NativeMethods.SetupDiGetClassDevsExFlags.Present | NativeMethods.SetupDiGetClassDevsExFlags.DeviceInterface, IntPtr.Zero, hostName, IntPtr.Zero))
+ // {
+ // NativeMethods.IsValidHandle(safeHandle, Marshal.GetLastWin32Error());
+
+ // uint memberInterfaceIndex = 0;
+ // var interfaceStructSize = (uint)Marshal.SizeOf(typeof(NativeMethods.SP_DEVICE_INTERFACE_DATA));
+ // var dataStructSize = (uint)Marshal.SizeOf(typeof(NativeMethods.SP_DEVINFO_DATA));
+
+
+ // // Start enumerating device interfaces.
+
+ // while (true)
+ // {
+ // var interfaceData = new NativeMethods.SP_DEVICE_INTERFACE_DATA { cbSize = interfaceStructSize };
+
+ // var success = NativeMethods.SetupDiEnumDeviceInterfaces(safeHandle, IntPtr.Zero, ref classGuid, memberInterfaceIndex++, ref interfaceData);
+
+ // lastError = Marshal.GetLastWin32Error();
+
+ // if (!success)
+ // {
+ // if (lastError != Win32Errors.NO_ERROR && lastError != Win32Errors.ERROR_NO_MORE_ITEMS)
+ // NativeError.ThrowException(lastError, hostName);
+
+ // break;
+ // }
+
+
+ // // Create DeviceInfo instance.
+
+ // var diData = new NativeMethods.SP_DEVINFO_DATA {cbSize = dataStructSize};
+
+ // var deviceInfo = new DeviceInfo(hostName) {DevicePath = GetDeviceInterfaceDetail(safeHandle, ref interfaceData, ref diData).DevicePath};
+
+
+ // if (getAllProperties)
+ // {
+ // deviceInfo.InstanceId = GetDeviceInstanceId(safeMachineHandle, hostName, diData);
+
+ // SetDeviceProperties(safeHandle, deviceInfo, diData);
+ // }
+
+ // else
+ // SetMinimalDeviceProperties(safeHandle, deviceInfo, diData);
+
+
+ // yield return deviceInfo;
+ // }
+ // }
+ //}
+
+
+ #region Private Helpers
+
+ [SecurityCritical]
+ private static string GetDeviceInstanceId(SafeCmConnectMachineHandle safeMachineHandle, string hostName, NativeMethods.SP_DEVINFO_DATA diData)
+ {
+ uint ptrPrevious;
+
+ var lastError = NativeMethods.CM_Get_Parent_Ex(out ptrPrevious, diData.DevInst, 0, safeMachineHandle);
+
+ if (lastError != Win32Errors.CR_SUCCESS)
+ NativeError.ThrowException(lastError, hostName);
+
+
+ using (var safeBuffer = new SafeGlobalMemoryBufferHandle(NativeMethods.DefaultFileBufferSize / 8)) // 512
+ {
+ lastError = NativeMethods.CM_Get_Device_ID_Ex(diData.DevInst, safeBuffer, (uint) safeBuffer.Capacity, 0, safeMachineHandle);
+
+ if (lastError != Win32Errors.CR_SUCCESS)
+ NativeError.ThrowException(lastError, hostName);
+
+
+ // Device InstanceID, such as: "USB\VID_8087&PID_0A2B\5&2EDA7E1E&0&7", "SCSI\DISK&VEN_SANDISK&PROD_X400\4&288ED25&0&000200", ...
+
+ return safeBuffer.PtrToStringUni();
+ }
+ }
+
+
+ /// Builds a Device Interface Detail Data structure.
+ /// An initialized NativeMethods.SP_DEVICE_INTERFACE_DETAIL_DATA instance.
+ [SecurityCritical]
+ private static NativeMethods.SP_DEVICE_INTERFACE_DETAIL_DATA GetDeviceInterfaceDetail(SafeHandle safeHandle, ref NativeMethods.SP_DEVICE_INTERFACE_DATA interfaceData, ref NativeMethods.SP_DEVINFO_DATA infoData)
+ {
+ var didd = new NativeMethods.SP_DEVICE_INTERFACE_DETAIL_DATA {cbSize = (uint) (IntPtr.Size == 4 ? 6 : 8)};
+
+ var success = NativeMethods.SetupDiGetDeviceInterfaceDetail(safeHandle, ref interfaceData, ref didd, (uint) Marshal.SizeOf(didd), IntPtr.Zero, ref infoData);
+
+ var lastError = Marshal.GetLastWin32Error();
+
+ if (!success)
+ NativeError.ThrowException(lastError);
+
+ return didd;
+ }
+
+
+ [SecurityCritical]
+ private static string GetDeviceRegistryProperty(SafeHandle safeHandle, NativeMethods.SP_DEVINFO_DATA infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum property)
+ {
+ var bufferSize = NativeMethods.DefaultFileBufferSize / 8; // 512
+
+ while (true)
+ using (var safeBuffer = new SafeGlobalMemoryBufferHandle(bufferSize))
+ {
+ var success = NativeMethods.SetupDiGetDeviceRegistryProperty(safeHandle, ref infoData, property, IntPtr.Zero, safeBuffer, (uint) safeBuffer.Capacity, IntPtr.Zero);
+
+ var lastError = Marshal.GetLastWin32Error();
+
+ if (success)
+ {
+ var value = safeBuffer.PtrToStringUni();
+
+ return !Utils.IsNullOrWhiteSpace(value) ? value.Trim() : null;
+ }
+
+
+ // MSDN: SetupDiGetDeviceRegistryProperty returns ERROR_INVALID_DATA error code if
+ // the requested property does not exist for a device or if the property data is not valid.
+
+ if (lastError == Win32Errors.ERROR_INVALID_DATA)
+ return null;
+
+
+ bufferSize = GetDoubledBufferSizeOrThrowException(lastError, safeBuffer, bufferSize, property.ToString());
+ }
+ }
+
+
+
+ [SecurityCritical]
+ private static void SetDeviceProperties(SafeHandle safeHandle, DeviceInfo deviceInfo, NativeMethods.SP_DEVINFO_DATA infoData)
+ {
+ SetMinimalDeviceProperties(safeHandle, deviceInfo, infoData);
+
+
+ deviceInfo.CompatibleIds = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.CompatibleIds);
+
+ deviceInfo.Driver = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.Driver);
+
+ deviceInfo.EnumeratorName = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.EnumeratorName);
+
+ deviceInfo.HardwareId = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.HardwareId);
+
+ deviceInfo.LocationInformation = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.LocationInformation);
+
+ deviceInfo.LocationPaths = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.LocationPaths);
+
+ deviceInfo.Manufacturer = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.Manufacturer);
+
+ deviceInfo.Service = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.Service);
+ }
+
+
+ [SecurityCritical]
+ private static void SetMinimalDeviceProperties(SafeHandle safeHandle, DeviceInfo deviceInfo, NativeMethods.SP_DEVINFO_DATA infoData)
+ {
+ deviceInfo.BaseContainerId = new Guid(GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.BaseContainerId));
+
+ deviceInfo.ClassGuid = new Guid(GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.ClassGuid));
+
+ deviceInfo.DeviceClass = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.Class);
+
+ deviceInfo.DeviceDescription = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.DeviceDescription);
+
+ deviceInfo.FriendlyName = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.FriendlyName);
+
+ deviceInfo.PhysicalDeviceObjectName = GetDeviceRegistryProperty(safeHandle, infoData, NativeMethods.SetupDiGetDeviceRegistryPropertyEnum.PhysicalDeviceObjectName);
+ }
+
+
+ [SecurityCritical]
+ internal static int GetDoubledBufferSizeOrThrowException(int lastError, SafeHandle safeBuffer, int bufferSize, string pathForException)
+ {
+ if (null != safeBuffer && !safeBuffer.IsClosed)
+ safeBuffer.Close();
+
+
+ switch ((uint) lastError)
+ {
+ case Win32Errors.ERROR_MORE_DATA:
+ case Win32Errors.ERROR_INSUFFICIENT_BUFFER:
+ bufferSize *= 2;
+ break;
+
+
+ default:
+ NativeMethods.IsValidHandle(safeBuffer, lastError, string.Format(CultureInfo.InvariantCulture, "Buffer size: {0}. Path: {1}", bufferSize.ToString(CultureInfo.InvariantCulture), pathForException));
+ break;
+ }
+
+
+ return bufferSize;
+ }
+
+
+ /// Repeatedly invokes InvokeIoControl with the specified input until enough memory has been allocated.
+ [SecurityCritical]
+ private static void InvokeIoControlUnknownSize(SafeFileHandle handle, uint controlCode, T input, uint increment = 128)
+ {
+ var inputSize = (uint) Marshal.SizeOf(input);
+ var outputLength = increment;
+
+ do
+ {
+ var output = new byte[outputLength];
+ uint bytesReturned;
+
+ var success = NativeMethods.DeviceIoControlUnknownSize(handle, controlCode, input, inputSize, output, outputLength, out bytesReturned, IntPtr.Zero);
+
+ var lastError = Marshal.GetLastWin32Error();
+ if (!success)
+ {
+ switch ((uint) lastError)
+ {
+ case Win32Errors.ERROR_MORE_DATA:
+ case Win32Errors.ERROR_INSUFFICIENT_BUFFER:
+ outputLength += increment;
+ break;
+
+ default:
+ if (lastError != Win32Errors.ERROR_SUCCESS)
+ NativeError.ThrowException(lastError);
+ break;
+ }
+ }
+
+ else
+ break;
+
+ } while (true);
+ }
+
+ #endregion // Private Helpers
+
+
+ #endregion // Enumerate Devices
+
+
+ #region Compression
+
+ /// [AlphaFS] Sets the NTFS compression state of a file or directory on a volume whose file system supports per-file and per-directory compression.
+ /// The transaction.
+ /// Specifies that is a file or directory.
+ /// A path that describes a folder or file to compress or decompress.
+ /// true = compress, false = decompress
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static void ToggleCompressionCore(KernelTransaction transaction, bool isFolder, string path, bool compress, PathFormat pathFormat)
+ {
+ using (var handle = File.CreateFileCore(transaction, isFolder, path, ExtendedFileAttributes.BackupSemantics, null, FileMode.Open, FileSystemRights.Modify, FileShare.None, true, false, pathFormat))
+
+ InvokeIoControlUnknownSize(handle, NativeMethods.FSCTL_SET_COMPRESSION, compress ? 1 : 0);
+ }
+
+ #endregion // Compression
+
+
+ #region Link
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J").
+ internal static void CreateDirectoryJunction(SafeFileHandle safeHandle, string directoryPath)
+ {
+ var targetDirBytes = Encoding.Unicode.GetBytes(Path.NonInterpretedPathPrefix + Path.GetRegularPathCore(directoryPath, GetFullPathOptions.AddTrailingDirectorySeparator, false));
+
+ var header = new NativeMethods.ReparseDataBufferHeader
+ {
+ ReparseTag = ReparsePointTag.MountPoint,
+ ReparseDataLength = (ushort) (targetDirBytes.Length + 12)
+ };
+
+ var mountPoint = new NativeMethods.MountPointReparseBuffer
+ {
+ SubstituteNameOffset = 0,
+ SubstituteNameLength = (ushort) targetDirBytes.Length,
+ PrintNameOffset = (ushort) (targetDirBytes.Length + UnicodeEncoding.CharSize),
+ PrintNameLength = 0
+ };
+
+ var reparseDataBuffer = new NativeMethods.REPARSE_DATA_BUFFER
+ {
+ ReparseTag = header.ReparseTag,
+ ReparseDataLength = header.ReparseDataLength,
+
+ SubstituteNameOffset = mountPoint.SubstituteNameOffset,
+ SubstituteNameLength = mountPoint.SubstituteNameLength,
+ PrintNameOffset = mountPoint.PrintNameOffset,
+ PrintNameLength = mountPoint.PrintNameLength,
+
+ PathBuffer = new byte[NativeMethods.MAXIMUM_REPARSE_DATA_BUFFER_SIZE - 16] // 16368
+ };
+
+ targetDirBytes.CopyTo(reparseDataBuffer.PathBuffer, 0);
+
+
+ using (var safeBuffer = new SafeGlobalMemoryBufferHandle(Marshal.SizeOf(reparseDataBuffer)))
+ {
+ safeBuffer.StructureToPtr(reparseDataBuffer, false);
+
+ uint bytesReturned;
+ var succes = NativeMethods.DeviceIoControl2(safeHandle, NativeMethods.FSCTL_SET_REPARSE_POINT, safeBuffer, (uint) (targetDirBytes.Length + 20), IntPtr.Zero, 0, out bytesReturned, IntPtr.Zero);
+
+ var lastError = Marshal.GetLastWin32Error();
+ if (!succes)
+ NativeError.ThrowException(lastError, directoryPath);
+ }
+ }
+
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ internal static void DeleteDirectoryJunction(SafeFileHandle safeHandle)
+ {
+ var reparseDataBuffer = new NativeMethods.REPARSE_DATA_BUFFER
+ {
+ ReparseTag = ReparsePointTag.MountPoint,
+ ReparseDataLength = 0,
+ PathBuffer = new byte[NativeMethods.MAXIMUM_REPARSE_DATA_BUFFER_SIZE - 16] // 16368
+ };
+
+
+ using (var safeBuffer = new SafeGlobalMemoryBufferHandle(Marshal.SizeOf(reparseDataBuffer)))
+ {
+ safeBuffer.StructureToPtr(reparseDataBuffer, false);
+
+ uint bytesReturned;
+ var success = NativeMethods.DeviceIoControl2(safeHandle, NativeMethods.FSCTL_DELETE_REPARSE_POINT, safeBuffer, NativeMethods.REPARSE_DATA_BUFFER_HEADER_SIZE, IntPtr.Zero, 0, out bytesReturned, IntPtr.Zero);
+
+ var lastError = Marshal.GetLastWin32Error();
+ if (!success)
+ NativeError.ThrowException(lastError);
+ }
+ }
+
+
+ /// [AlphaFS] Get information about the target of a mount point or symbolic link on an NTFS file system.
+ ///
+ ///
+ [SecurityCritical]
+ internal static LinkTargetInfo GetLinkTargetInfo(SafeFileHandle safeHandle, string reparsePath)
+ {
+ using (var safeBuffer = GetLinkTargetData(safeHandle, reparsePath))
+ {
+ var header = safeBuffer.PtrToStructure(0);
+
+ var marshalReparseBuffer = (int) Marshal.OffsetOf(typeof(NativeMethods.ReparseDataBufferHeader), "data");
+
+ var dataOffset = (int) (marshalReparseBuffer + (header.ReparseTag == ReparsePointTag.MountPoint
+ ? Marshal.OffsetOf(typeof(NativeMethods.MountPointReparseBuffer), "data")
+ : Marshal.OffsetOf(typeof(NativeMethods.SymbolicLinkReparseBuffer), "data")).ToInt64());
+
+ var dataBuffer = new byte[NativeMethods.MAXIMUM_REPARSE_DATA_BUFFER_SIZE - dataOffset];
+
+
+ switch (header.ReparseTag)
+ {
+ // MountPoint can be a junction or mounted drive (mounted drive starts with "\??\Volume").
+
+ case ReparsePointTag.MountPoint:
+ var mountPoint = safeBuffer.PtrToStructure(marshalReparseBuffer);
+
+ safeBuffer.CopyTo(dataOffset, dataBuffer);
+
+ return new LinkTargetInfo(
+ Encoding.Unicode.GetString(dataBuffer, mountPoint.SubstituteNameOffset, mountPoint.SubstituteNameLength),
+ Encoding.Unicode.GetString(dataBuffer, mountPoint.PrintNameOffset, mountPoint.PrintNameLength));
+
+
+ case ReparsePointTag.SymLink:
+ var symLink = safeBuffer.PtrToStructure(marshalReparseBuffer);
+
+ safeBuffer.CopyTo(dataOffset, dataBuffer);
+
+ return new SymbolicLinkTargetInfo(
+ Encoding.Unicode.GetString(dataBuffer, symLink.SubstituteNameOffset, symLink.SubstituteNameLength),
+ Encoding.Unicode.GetString(dataBuffer, symLink.PrintNameOffset, symLink.PrintNameLength), symLink.Flags);
+
+
+ default:
+ throw new UnrecognizedReparsePointException(reparsePath);
+ }
+ }
+ }
+
+
+ /// [AlphaFS] Get information about the target of a mount point or symbolic link on an NTFS file system.
+ ///
+ ///
+ [SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")]
+ [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Disposing is controlled.")]
+ [SecurityCritical]
+ private static SafeGlobalMemoryBufferHandle GetLinkTargetData(SafeFileHandle safeHandle, string reparsePath)
+ {
+ var safeBuffer = new SafeGlobalMemoryBufferHandle(NativeMethods.MAXIMUM_REPARSE_DATA_BUFFER_SIZE);
+
+ while (true)
+ {
+ uint bytesReturned;
+ var success = NativeMethods.DeviceIoControl(safeHandle, NativeMethods.FSCTL_GET_REPARSE_POINT, IntPtr.Zero, 0, safeBuffer, (uint) safeBuffer.Capacity, out bytesReturned, IntPtr.Zero);
+
+ var lastError = Marshal.GetLastWin32Error();
+ if (!success)
+ {
+ switch ((uint) lastError)
+ {
+ case Win32Errors.ERROR_MORE_DATA:
+ case Win32Errors.ERROR_INSUFFICIENT_BUFFER:
+
+ // Should not happen since we already use the maximum size.
+
+ if (safeBuffer.Capacity < bytesReturned)
+ safeBuffer.Close();
+ break;
+
+
+ default:
+ if (lastError != Win32Errors.ERROR_SUCCESS)
+ NativeError.ThrowException(lastError, reparsePath);
+ break;
+ }
+ }
+
+ else
+ break;
+ }
+
+
+ return safeBuffer;
+ }
+
+ #endregion // Link
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/DeviceInfo.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/DeviceInfo.cs
new file mode 100644
index 0000000..bf92834
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/DeviceInfo.cs
@@ -0,0 +1,141 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+
+using System;
+using System.Collections.Generic;
+using System.Security;
+using System.Security.Permissions;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ /// Provides access to information of a device, on a local or remote host.
+ [SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode = true)]
+ [Serializable]
+ [SecurityCritical]
+ public sealed class DeviceInfo
+ {
+ #region Constructors
+
+ /// Initializes a DeviceInfo class.
+ //[SecurityCritical]
+ //public DeviceInfo()
+ //{
+ // HostName = Host.GetUncName();
+ //}
+
+ /// Initializes a DeviceInfo class.
+ /// The DNS or NetBIOS name of the remote server. null refers to the local host.
+ //[SecurityCritical]
+ //public DeviceInfo(string host)
+ //{
+ // HostName = Host.GetUncName(host).Replace(Path.UncPrefix, string.Empty);
+ //}
+
+ #endregion // Constructors
+
+
+ #region Methods
+
+ /// Enumerates all available devices on the local host.
+ /// One of the devices.
+ /// instances of type from the local host.
+ //[SecurityCritical]
+ //public IEnumerable EnumerateDevices(DeviceGuid deviceGuid)
+ //{
+ // return Device.EnumerateDevicesCore(HostName, deviceGuid, true);
+ //}
+
+ #endregion // Methods
+
+
+ #region Properties
+
+ /// Represents the value of the base container identifier (ID) .The Windows Plug and Play (PnP) manager assigns this value to the device node (devnode).
+ public Guid BaseContainerId { get; internal set; }
+
+
+ /// Represents the name of the device setup class that a device instance belongs to.
+ public string DeviceClass { get; internal set; }
+
+
+ /// Represents the of the device setup class that a device instance belongs to.
+ public Guid ClassGuid { get; internal set; }
+
+
+ /// Represents the list of compatible identifiers for a device instance.
+ public string CompatibleIds { get; internal set; }
+
+
+ /// Represents a description of a device instance.
+ public string DeviceDescription { get; internal set; }
+
+
+ /// The device interface path.
+ public string DevicePath { get; internal set; }
+
+
+ /// Represents the registry entry name of the driver key for a device instance.
+ public string Driver { get; internal set; }
+
+
+ /// Represents the name of the enumerator for a device instance.
+ public string EnumeratorName { get; internal set; }
+
+
+ /// Represents the friendly name of a device instance.
+ public string FriendlyName { get; internal set; }
+
+
+ /// Represents the list of hardware identifiers for a device instance.
+ public string HardwareId { get; internal set; }
+
+
+ /// The host name that was passed to the class constructor.
+ public string HostName { get; internal set; }
+
+
+ /// Gets the instance Id of the device.
+ public string InstanceId { get; internal set; }
+
+
+ /// Represents the bus-specific physical location of a device instance.
+ public string LocationInformation { get; internal set; }
+
+
+ /// Represents the location of a device instance in the device tree.
+ public string LocationPaths { get; internal set; }
+
+
+ /// Represents the name of the manufacturer of a device instance.
+ public string Manufacturer { get; internal set; }
+
+
+ /// Encapsulates the physical device location information provided by a device's firmware to Windows.
+ public string PhysicalDeviceObjectName { get; internal set; }
+
+
+ /// Represents the name of the service that is installed for a device instance.
+ public string Service { get; internal set; }
+
+ #endregion // Properties
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/DiskSpaceInfo.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/DiskSpaceInfo.cs
new file mode 100644
index 0000000..26b89fd
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/DiskSpaceInfo.cs
@@ -0,0 +1,272 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Globalization;
+using System.Runtime.InteropServices;
+using System.Security;
+using winPEAS._3rdParty.AlphaFS;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ /// Retrieves information about the amount of space that is available on a disk volume, which is the total amount of space,
+ /// the total amount of free space, and the total amount of free space available to the user that is associated with the calling thread.
+ /// This class cannot be inherited.
+ ///
+ [Serializable]
+ [SecurityCritical]
+ public sealed class DiskSpaceInfo
+ {
+ [NonSerialized] private readonly bool _initGetClusterInfo = true;
+ [NonSerialized] private readonly bool _initGetSpaceInfo = true;
+ [NonSerialized] private readonly CultureInfo _cultureInfo = CultureInfo.CurrentCulture;
+ [NonSerialized] private readonly bool _continueOnAccessError;
+
+
+ /// Initializes a DiskSpaceInfo instance.
+ /// A valid drive path or drive letter. This can be either uppercase or lowercase, 'a' to 'z' or a network share in the format: \\server\share
+ /// This is a Lazyloading object; call to populate all properties first before accessing.
+ [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Utils.IsNullOrWhiteSpace validates arguments.")]
+ [SecurityCritical]
+ public DiskSpaceInfo(string drivePath)
+ {
+ if (Utils.IsNullOrWhiteSpace(drivePath))
+ throw new ArgumentNullException("drivePath");
+
+
+ drivePath = drivePath.Length == 1 ? drivePath + Path.VolumeSeparatorChar : Path.GetPathRoot(drivePath, false);
+
+ if (Utils.IsNullOrWhiteSpace(drivePath))
+ throw new ArgumentException(Resources.InvalidDriveLetterArgument, "drivePath");
+
+
+ // MSDN:
+ // If this parameter is a UNC name, it must include a trailing backslash (for example, "\\MyServer\MyShare\").
+ // Furthermore, a drive specification must have a trailing backslash (for example, "C:\").
+ // The calling application must have FILE_LIST_DIRECTORY access rights for this directory.
+ DriveName = Path.AddTrailingDirectorySeparator(drivePath, false);
+ }
+
+
+ /// Initializes a DiskSpaceInfo instance.
+ /// A valid drive path or drive letter. This can be either uppercase or lowercase, 'a' to 'z' or a network share in the format: \\server\share
+ /// null gets both size- and disk cluster information. true Get only disk cluster information, false Get only size information.
+ /// Refreshes the state of the object.
+ /// true suppress any Exception that might be thrown as a result from a failure, such as unavailable resources.
+ [SecurityCritical]
+ public DiskSpaceInfo(string drivePath, bool? spaceInfoType, bool refresh, bool continueOnException) : this(drivePath)
+ {
+ if (spaceInfoType == null)
+ {
+ _initGetSpaceInfo = true;
+ _initGetClusterInfo = true;
+ }
+
+ else
+ {
+ _initGetSpaceInfo = (bool) !spaceInfoType;
+ _initGetClusterInfo = (bool) spaceInfoType;
+ }
+
+ _continueOnAccessError = continueOnException;
+
+ if (refresh)
+ Refresh();
+ }
+
+
+ /// Indicates the amount of available free space on a drive, formatted as percentage.
+ public string AvailableFreeSpacePercent
+ {
+ get
+ {
+ return PercentCalculate(TotalNumberOfBytes - (TotalNumberOfBytes - TotalNumberOfFreeBytes), 0, TotalNumberOfBytes).ToString("0.##", _cultureInfo) + "%";
+ }
+ }
+
+
+ /// Indicates the amount of available free space on a drive, formatted as a unit size.
+ public string AvailableFreeSpaceUnitSize
+ {
+ get { return Utils.UnitSizeToText(TotalNumberOfFreeBytes, _cultureInfo); }
+ }
+
+
+ /// Returns the Clusters size.
+ public long ClusterSize
+ {
+ get { return SectorsPerCluster * BytesPerSector; }
+ }
+
+
+ /// Gets the name of a drive.
+ /// The name of the drive.
+ /// This property is the name assigned to the drive, such as C:\ or E:\
+ public string DriveName { get; private set; }
+
+
+ /// The total number of bytes on a disk that are available to the user who is associated with the calling thread, formatted as a unit size.
+ public string TotalSizeUnitSize
+ {
+ get { return Utils.UnitSizeToText(TotalNumberOfBytes, _cultureInfo); }
+ }
+
+
+ /// Indicates the amount of used space on a drive, formatted as percentage.
+ public string UsedSpacePercent
+ {
+ get
+ {
+ return PercentCalculate(TotalNumberOfBytes - FreeBytesAvailable, 0, TotalNumberOfBytes).ToString("0.##", _cultureInfo) + "%";
+ }
+ }
+
+
+ /// Indicates the amount of used space on a drive, formatted as a unit size.
+ public string UsedSpaceUnitSize
+ {
+ get { return Utils.UnitSizeToText(TotalNumberOfBytes - FreeBytesAvailable, _cultureInfo); }
+ }
+
+
+ /// The total number of free bytes on a disk that are available to the user who is associated with the calling thread.
+ public long FreeBytesAvailable { get; private set; }
+
+
+ /// The total number of bytes on a disk that are available to the user who is associated with the calling thread.
+ public long TotalNumberOfBytes { get; private set; }
+
+
+ /// The total number of free bytes on a disk.
+ public long TotalNumberOfFreeBytes { get; private set; }
+
+
+ /// The number of bytes per sector.
+ public int BytesPerSector { get; private set; }
+
+
+ /// The total number of free clusters on the disk that are available to the user who is associated with the calling thread.
+ public int NumberOfFreeClusters { get; private set; }
+
+
+ /// The number of sectors per cluster.
+ public int SectorsPerCluster { get; private set; }
+
+
+ /// The total number of clusters on the disk that are available to the user who is associated with the calling thread.
+ /// If per-user disk quotas are in use, this value may be less than the total number of clusters on the disk.
+ ///
+ public long TotalNumberOfClusters { get; private set; }
+
+
+
+
+ /// Refreshes the state of the object.
+ public void Refresh()
+ {
+ Reset();
+
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ {
+ int lastError;
+
+
+ // Get size information.
+
+ if (_initGetSpaceInfo)
+ {
+ long freeBytesAvailable, totalNumberOfBytes, totalNumberOfFreeBytes;
+
+ var success = NativeMethods.GetDiskFreeSpaceEx(DriveName, out freeBytesAvailable, out totalNumberOfBytes, out totalNumberOfFreeBytes);
+
+ lastError = Marshal.GetLastWin32Error();
+
+ if (!success && !_continueOnAccessError && lastError != Win32Errors.ERROR_NOT_READY)
+ NativeError.ThrowException(lastError, DriveName);
+
+
+ FreeBytesAvailable = freeBytesAvailable;
+ TotalNumberOfBytes = totalNumberOfBytes;
+ TotalNumberOfFreeBytes = totalNumberOfFreeBytes;
+ }
+
+
+ // Get cluster information.
+
+ if (_initGetClusterInfo)
+ {
+ int sectorsPerCluster, bytesPerSector, numberOfFreeClusters;
+ uint totalNumberOfClusters;
+
+ var success = NativeMethods.GetDiskFreeSpace(DriveName, out sectorsPerCluster, out bytesPerSector, out numberOfFreeClusters, out totalNumberOfClusters);
+
+ lastError = Marshal.GetLastWin32Error();
+
+ if (!success && !_continueOnAccessError && lastError != Win32Errors.ERROR_NOT_READY)
+ NativeError.ThrowException(lastError, DriveName);
+
+
+ BytesPerSector = bytesPerSector;
+ NumberOfFreeClusters = numberOfFreeClusters;
+ SectorsPerCluster = sectorsPerCluster;
+ TotalNumberOfClusters = totalNumberOfClusters;
+ }
+ }
+ }
+
+
+ /// Initializes all properties to 0.
+ private void Reset()
+ {
+ if (_initGetSpaceInfo)
+ {
+ FreeBytesAvailable = 0;
+ TotalNumberOfBytes = 0;
+ TotalNumberOfFreeBytes = 0;
+ }
+
+
+ if (_initGetClusterInfo)
+ {
+ BytesPerSector = 0;
+ NumberOfFreeClusters = 0;
+ SectorsPerCluster = 0;
+ TotalNumberOfClusters = 0;
+ }
+ }
+
+
+ /// Returns the drive name.
+ /// A string that represents this object.
+ public override string ToString()
+ {
+ return DriveName;
+ }
+
+
+ /// Calculates a percentage value.
+ private static double PercentCalculate(double currentValue, double minimumValue, double maximumValue)
+ {
+ return currentValue < 0 || maximumValue <= 0 ? 0 : currentValue * 100 / (maximumValue - minimumValue);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/DriveInfo.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/DriveInfo.cs
new file mode 100644
index 0000000..9578591
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/DriveInfo.cs
@@ -0,0 +1,415 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Linq;
+using System.Security;
+using winPEAS._3rdParty.AlphaFS;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ /// Provides access to information on a local or remote drive.
+ ///
+ /// This class models a drive and provides methods and properties to query for drive information.
+ /// Use DriveInfo to determine what drives are available, and what type of drives they are.
+ /// You can also query to determine the capacity and available free space on the drive.
+ ///
+ [Serializable]
+ [SecurityCritical]
+ public sealed class DriveInfo
+ {
+ [NonSerialized] private readonly VolumeInfo _volumeInfo;
+ [NonSerialized] private readonly DiskSpaceInfo _dsi;
+ [NonSerialized] private bool _initDsie;
+ [NonSerialized] private DriveType? _driveType;
+ [NonSerialized] private string _dosDeviceName;
+ [NonSerialized] private DirectoryInfo _rootDirectory;
+ [NonSerialized] private readonly string _name;
+
+
+ #region Constructors
+
+ /// Provides access to information on the specified drive.
+ ///
+ ///
+ ///
+ /// A valid drive path or drive letter.
+ /// This can be either uppercase or lowercase,
+ /// 'a' to 'z' or a network share in the format: \\server\share
+ ///
+ [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Utils.IsNullOrWhiteSpace validates arguments.")]
+ [SecurityCritical]
+ public DriveInfo(string driveName)
+ {
+ if (Utils.IsNullOrWhiteSpace(driveName))
+ throw new ArgumentNullException("driveName");
+
+
+ driveName = driveName.Length == 1 ? driveName + Path.VolumeSeparatorChar : Path.GetPathRoot(driveName, false);
+
+ if (Utils.IsNullOrWhiteSpace(driveName))
+ throw new ArgumentException(Resources.InvalidDriveLetterArgument, "driveName");
+
+
+ _name = Path.AddTrailingDirectorySeparator(driveName, false);
+
+ // Initiate VolumeInfo() lazyload instance.
+ _volumeInfo = new VolumeInfo(_name, false, true);
+
+ // Initiate DiskSpaceInfo() lazyload instance.
+ _dsi = new DiskSpaceInfo(_name, null, false, true);
+ }
+
+ #endregion // Constructors
+
+
+ #region Properties
+
+ /// Indicates the amount of available free space on a drive.
+ /// The amount of free space available on the drive, in bytes.
+ /// This property indicates the amount of free space available on the drive. Note that this number may be different from the number because this property takes into account disk quotas.
+ public long AvailableFreeSpace
+ {
+ get
+ {
+ GetDeviceInfo(3, 0);
+ return null == _dsi ? 0 : _dsi.FreeBytesAvailable;
+ }
+ }
+
+ /// Gets the name of the file system, such as NTFS or FAT32.
+ /// Use DriveFormat to determine what formatting a drive uses.
+ public string DriveFormat
+ {
+ get { return (string) GetDeviceInfo(0, 1); }
+ }
+
+
+ /// Gets the drive type.
+ /// One of the values.
+ ///
+ /// The DriveType property indicates whether a drive is any of: CDRom, Fixed, Unknown, Network, NoRootDirectory,
+ /// Ram, Removable, or Unknown. Values are listed in the enumeration.
+ ///
+ public DriveType DriveType
+ {
+ get { return (DriveType) GetDeviceInfo(2, 0); }
+ }
+
+
+ /// Gets a value indicating whether a drive is ready.
+ /// true if the drive is ready; otherwise, false.
+ ///
+ /// IsReady indicates whether a drive is ready. For example, it indicates whether a CD is in a CD drive or whether
+ /// a removable storage device is ready for read/write operations. If you do not test whether a drive is ready, and
+ /// it is not ready, querying the drive using DriveInfo will raise an IOException.
+ ///
+ /// Do not rely on IsReady() to avoid catching exceptions from other members such as TotalSize, TotalFreeSpace, and DriveFormat.
+ /// Between the time that your code checks IsReady and then accesses one of the other properties
+ /// (even if the access occurs immediately after the check), a drive may have been disconnected or a disk may have been removed.
+ ///
+ public bool IsReady
+ {
+ get { return File.ExistsCore(null, true, Name, PathFormat.LongFullPath); }
+ }
+
+
+ /// Gets the name of the drive.
+ /// The name of the drive.
+ /// This property is the name assigned to the drive, such as C:\ or E:\
+ public string Name
+ {
+ get { return _name; }
+ }
+
+
+ /// Gets the root directory of a drive.
+ /// A DirectoryInfo object that contains the root directory of the drive.
+ public DirectoryInfo RootDirectory
+ {
+ get { return (DirectoryInfo) GetDeviceInfo(2, 1); }
+ }
+
+ /// Gets the total amount of free space available on a drive.
+ /// The total free space available on a drive, in bytes.
+ /// This property indicates the total amount of free space available on the drive, not just what is available to the current user.
+ public long TotalFreeSpace
+ {
+ get
+ {
+ GetDeviceInfo(3, 0);
+ return null == _dsi ? 0 : _dsi.TotalNumberOfFreeBytes;
+ }
+ }
+
+
+ /// Gets the total size of storage space on a drive.
+ /// The total size of the drive, in bytes.
+ /// This property indicates the total size of the drive in bytes, not just what is available to the current user.
+ public long TotalSize
+ {
+ get
+ {
+ GetDeviceInfo(3, 0);
+ return null == _dsi ? 0 : _dsi.TotalNumberOfBytes;
+ }
+ }
+
+
+ /// Gets or sets the volume label of a drive.
+ /// The volume label.
+ ///
+ /// The label length is determined by the operating system. For example, NTFS allows a volume label
+ /// to be up to 32 characters long. Note that null is a valid VolumeLabel.
+ ///
+ public string VolumeLabel
+ {
+ get { return (string) GetDeviceInfo(0, 2); }
+ set { Volume.SetVolumeLabel(Name, value); }
+ }
+
+ /// [AlphaFS] Returns the instance.
+ public DiskSpaceInfo DiskSpaceInfo
+ {
+ get
+ {
+ GetDeviceInfo(3, 0);
+ return _dsi;
+ }
+ }
+
+
+ /// [AlphaFS] The MS-DOS device name.
+ public string DosDeviceName
+ {
+ get { return (string) GetDeviceInfo(1, 0); }
+ }
+
+
+ /// [AlphaFS] Indicates if this drive is a SUBST.EXE / DefineDosDevice drive mapping.
+ public bool IsDosDeviceSubstitute
+ {
+ get { return !Utils.IsNullOrWhiteSpace(DosDeviceName) && DosDeviceName.StartsWith(Path.NonInterpretedPathPrefix, StringComparison.OrdinalIgnoreCase); }
+ }
+
+
+ /// [AlphaFS] Indicates if this drive is a UNC path.
+ public bool IsUnc
+ {
+ get
+ {
+ return !IsDosDeviceSubstitute && DriveType == DriveType.Network ||
+
+ // Handle Host devices with file systems: FAT/FAT32, UDF (CDRom), ...
+ Name.StartsWith(Path.UncPrefix, StringComparison.Ordinal) && DriveType == DriveType.NoRootDirectory && DriveFormat.Equals(DriveType.Unknown.ToString(), StringComparison.OrdinalIgnoreCase);
+ }
+ }
+
+
+ /// [AlphaFS] Determines whether the specified volume name is a defined volume on the current computer.
+ public bool IsVolume
+ {
+ get { return null != GetDeviceInfo(0, 0); }
+ }
+
+
+ /// [AlphaFS] Contains information about a file-system volume.
+ /// A VolumeInfo object that contains file-system volume information of the drive.
+ public VolumeInfo VolumeInfo
+ {
+ get { return (VolumeInfo) GetDeviceInfo(0, 0); }
+ }
+
+
+ #endregion // Properties
+
+
+ #region Methods
+
+ #region .NET
+
+ /// Retrieves the of all logical drives on the Computer.
+ /// An array of type that represents the logical drives on the Computer.
+ [SecurityCritical]
+ public static DriveInfo[] GetDrives()
+ {
+ return Directory.EnumerateLogicalDrivesCore(false, false).ToArray();
+ }
+
+
+ /// Returns a drive name as a string.
+ /// The name of the drive.
+ /// This method returns the Name property.
+ public override string ToString()
+ {
+ return _name;
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Enumerates the drive names of all logical drives on the Computer.
+ /// Retrieve logical drives as known by the Environment.
+ /// Retrieve only when accessible (IsReady) logical drives.
+ ///
+ /// An IEnumerable of type that represents
+ /// the logical drives on the Computer.
+ ///
+ [SecurityCritical]
+ public static IEnumerable EnumerateDrives(bool fromEnvironment, bool isReady)
+ {
+ return Directory.EnumerateLogicalDrivesCore(fromEnvironment, isReady);
+ }
+
+
+ /// [AlphaFS] Gets the first available drive letter on the local system.
+ /// A drive letter as . When no drive letters are available, an exception is thrown.
+ /// The letters "A" and "B" are reserved for floppy drives and will never be returned by this function.
+ public static char GetFreeDriveLetter()
+ {
+ return GetFreeDriveLetter(false);
+ }
+
+
+ /// Gets an available drive letter on the local system.
+ /// When true get the last available drive letter. When false gets the first available drive letter.
+ /// A drive letter as . When no drive letters are available, an exception is thrown.
+ /// The letters "A" and "B" are reserved for floppy drives and will never be returned by this function.
+ /// No drive letters available.
+ [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
+ public static char GetFreeDriveLetter(bool getLastAvailable)
+ {
+ var freeDriveLetters = "CDEFGHIJKLMNOPQRSTUVWXYZ".Except(Directory.EnumerateLogicalDrivesCore(false, false).Select(d => d.Name[0]));
+
+ try
+ {
+ return getLastAvailable ? freeDriveLetters.Last() : freeDriveLetters.First();
+ }
+ catch
+ {
+ throw new ArgumentOutOfRangeException(Resources.No_Drive_Letters_Available);
+ }
+ }
+
+ #endregion // Methods
+
+
+ #region Private Methods
+
+ /// Retrieves information about the file system and volume associated with the specified root file or directorystream.
+ [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+ [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
+ [SecurityCritical]
+ private object GetDeviceInfo(int type, int mode)
+ {
+ try
+ {
+ switch (type)
+ {
+ #region Volume
+
+ // VolumeInfo properties.
+ case 0:
+ if (Utils.IsNullOrWhiteSpace(_volumeInfo.FullPath))
+ _volumeInfo.Refresh();
+
+ switch (mode)
+ {
+ case 0:
+ // IsVolume, VolumeInfo
+ return _volumeInfo;
+
+ case 1:
+ // DriveFormat
+ return null == _volumeInfo ? DriveType.Unknown.ToString() : _volumeInfo.FileSystemName ?? DriveType.Unknown.ToString();
+
+ case 2:
+ // VolumeLabel
+ return null == _volumeInfo ? string.Empty : _volumeInfo.Name ?? string.Empty;
+ }
+
+ break;
+
+
+ // Volume related.
+ case 1:
+ switch (mode)
+ {
+ case 0:
+ // DosDeviceName
+ return _dosDeviceName ?? (_dosDeviceName = Volume.GetVolumeDeviceName(Name));
+ }
+
+ break;
+
+ #endregion // Volume
+
+
+ #region Drive
+
+ // Drive related.
+ case 2:
+ switch (mode)
+ {
+ case 0:
+ // DriveType
+ return _driveType ?? (_driveType = Volume.GetDriveType(Name));
+
+ case 1:
+ // RootDirectory
+ return _rootDirectory ?? (_rootDirectory = new DirectoryInfo(null, Name, PathFormat.RelativePath));
+ }
+
+ break;
+
+ // DiskSpaceInfo related.
+ case 3:
+ switch (mode)
+ {
+ case 0:
+ // AvailableFreeSpace, TotalFreeSpace, TotalSize, DiskSpaceInfo
+ if (!_initDsie)
+ {
+ _dsi.Refresh();
+ _initDsie = true;
+ }
+
+ break;
+ }
+
+ break;
+
+ #endregion // Drive
+ }
+ }
+ catch
+ {
+ }
+
+ return type == 0 && mode > 0 ? string.Empty : null;
+ }
+
+ #endregion // Private
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DefineDosDevice.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DefineDosDevice.cs
new file mode 100644
index 0000000..a9f1f77
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DefineDosDevice.cs
@@ -0,0 +1,119 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Defines, redefines, or deletes MS-DOS device names.
+ /// An MS-DOS device name string specifying the device the function is defining, redefining, or deleting.
+ /// An MS-DOS path that will implement this device.
+ [SecurityCritical]
+ public static void DefineDosDevice(string deviceName, string targetPath)
+ {
+ DefineDosDeviceCore(true, deviceName, targetPath, DosDeviceAttributes.None, false);
+ }
+
+ /// [AlphaFS] Defines, redefines, or deletes MS-DOS device names.
+ ///
+ /// An MS-DOS device name string specifying the device the function is defining, redefining, or deleting.
+ ///
+ ///
+ /// >An MS-DOS path that will implement this device. If parameter has the
+ /// flag specified, is used as-is.
+ ///
+ ///
+ /// The controllable aspects of the DefineDosDevice function, flags which will be combined with the
+ /// default.
+ ///
+ [SecurityCritical]
+ public static void DefineDosDevice(string deviceName, string targetPath, DosDeviceAttributes deviceAttributes)
+ {
+ DefineDosDeviceCore(true, deviceName, targetPath, deviceAttributes, false);
+ }
+
+
+
+
+ /// Defines, redefines, or deletes MS-DOS device names.
+ ///
+ ///
+ ///
+ /// true defines a new MS-DOS device. false deletes a previously defined MS-DOS device.
+ ///
+ ///
+ /// An MS-DOS device name string specifying the device the function is defining, redefining, or deleting.
+ ///
+ ///
+ /// A pointer to a path string that will implement this device. The string is an MS-DOS path string unless the
+ /// flag is specified, in which case this string is a path string.
+ ///
+ ///
+ /// The controllable aspects of the DefineDosDevice function, flags which will be combined with the
+ /// default.
+ ///
+ ///
+ /// Only delete MS-DOS device on an exact name match. If is true,
+ /// must be the same path used to create the mapping.
+ ///
+ [SecurityCritical]
+ internal static void DefineDosDeviceCore(bool isDefine, string deviceName, string targetPath, DosDeviceAttributes deviceAttributes, bool exactMatch)
+ {
+ if (Utils.IsNullOrWhiteSpace(deviceName))
+ throw new ArgumentNullException("deviceName");
+
+ if (isDefine)
+ {
+ // targetPath is allowed to be null.
+
+ // In no case is a trailing backslash ("\") allowed.
+ deviceName = Path.GetRegularPathCore(deviceName, GetFullPathOptions.RemoveTrailingDirectorySeparator | GetFullPathOptions.CheckInvalidPathChars, false);
+
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ {
+ var success = NativeMethods.DefineDosDevice(deviceAttributes, deviceName, targetPath);
+
+ var lastError = Marshal.GetLastWin32Error();
+ if (!success)
+ NativeError.ThrowException(lastError, deviceName, targetPath);
+ }
+ }
+
+ else
+ {
+ // A pointer to a path string that will implement this device.
+ // The string is an MS-DOS path string unless the DDD_RAW_TARGET_PATH flag is specified, in which case this string is a path string.
+
+ if (exactMatch && !Utils.IsNullOrWhiteSpace(targetPath))
+ deviceAttributes = deviceAttributes | DosDeviceAttributes.ExactMatchOnRemove | DosDeviceAttributes.RawTargetPath;
+
+ // Remove the MS-DOS device name. First, get the name of the Windows NT device
+ // from the symbolic link and then delete the symbolic link from the namespace.
+
+ DefineDosDevice(deviceName, targetPath, deviceAttributes);
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DeleteDosDevice.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DeleteDosDevice.cs
new file mode 100644
index 0000000..60f7c62
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DeleteDosDevice.cs
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Diagnostics.CodeAnalysis;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Deletes an MS-DOS device name.
+ /// An MS-DOS device name specifying the device to delete.
+ [SecurityCritical]
+ public static void DeleteDosDevice(string deviceName)
+ {
+ DefineDosDeviceCore(false, deviceName, null, DosDeviceAttributes.RemoveDefinition, false);
+ }
+
+ /// [AlphaFS] Deletes an MS-DOS device name.
+ /// An MS-DOS device name string specifying the device to delete.
+ ///
+ /// A pointer to a path string that will implement this device. The string is an MS-DOS path string unless the
+ /// flag is specified, in which case this string is a path string.
+ ///
+ [SecurityCritical]
+ public static void DeleteDosDevice(string deviceName, string targetPath)
+ {
+ DefineDosDeviceCore(false, deviceName, targetPath, DosDeviceAttributes.RemoveDefinition, false);
+ }
+
+ /// [AlphaFS] Deletes an MS-DOS device name.
+ /// An MS-DOS device name string specifying the device to delete.
+ ///
+ /// A pointer to a path string that will implement this device. The string is an MS-DOS path string unless the
+ /// flag is specified, in which case this string is a path string.
+ ///
+ ///
+ /// Only delete MS-DOS device on an exact name match. If is true,
+ /// must be the same path used to create the mapping.
+ ///
+ [SecurityCritical]
+ public static void DeleteDosDevice(string deviceName, string targetPath, bool exactMatch)
+ {
+ DefineDosDeviceCore(false, deviceName, targetPath, DosDeviceAttributes.RemoveDefinition, exactMatch);
+ }
+
+ /// [AlphaFS] Deletes an MS-DOS device name.
+ /// An MS-DOS device name string specifying the device to delete.
+ ///
+ /// A pointer to a path string that will implement this device. The string is an MS-DOS path string unless the
+ /// flag is specified, in which case this string is a path string.
+ ///
+ ///
+ /// The controllable aspects of the DefineDosDevice function flags which will be combined with the
+ /// default.
+ ///
+ ///
+ /// Only delete MS-DOS device on an exact name match. If is true,
+ /// must be the same path used to create the mapping.
+ ///
+ [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
+ [SecurityCritical]
+ public static void DeleteDosDevice(string deviceName, string targetPath, DosDeviceAttributes deviceAttributes, bool exactMatch)
+ {
+ DefineDosDeviceCore(false, deviceName, targetPath, deviceAttributes, exactMatch);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DeleteVolumeMountPoint.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DeleteVolumeMountPoint.cs
new file mode 100644
index 0000000..8204503
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DeleteVolumeMountPoint.cs
@@ -0,0 +1,95 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Deletes a Drive letter or mounted folder.
+ /// Deleting a mounted folder does not cause the underlying directory to be deleted.
+ ///
+ /// If the parameter is a directory that is not a mounted folder, the function does nothing. The
+ /// directory is not deleted.
+ ///
+ ///
+ /// It's not an error to attempt to unmount a volume from a volume mount point when there is no volume actually mounted at that volume
+ /// mount point.
+ ///
+ /// The Drive letter or mounted folder to be deleted. For example, X:\ or Y:\MountX\.
+ [SecurityCritical]
+ public static void DeleteVolumeMountPoint(string volumeMountPoint)
+ {
+ DeleteVolumeMountPointCore(null, volumeMountPoint, false, false, PathFormat.RelativePath);
+ }
+
+
+
+
+ /// Deletes a Drive letter or mounted folder.
+ ///
+ /// It's not an error to attempt to unmount a volume from a volume mount point when there is no volume actually mounted at that volume mount point.
+ /// Deleting a mounted folder does not cause the underlying directory to be deleted.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The Drive letter or mounted folder to be deleted. For example, X:\ or Y:\MountX\.
+ /// true suppress any Exception that might be thrown as a result from a failure, such as unavailable resources.
+ /// true suppress an exception due to this mount point being a Junction.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static void DeleteVolumeMountPointCore(KernelTransaction transaction, string volumeMountPoint, bool continueOnException, bool continueIfJunction, PathFormat pathFormat)
+ {
+ if (pathFormat != PathFormat.LongFullPath)
+ Path.CheckSupportedPathFormat(volumeMountPoint, true, true);
+
+ volumeMountPoint = Path.GetExtendedLengthPathCore(transaction, volumeMountPoint, pathFormat, GetFullPathOptions.RemoveTrailingDirectorySeparator);
+
+
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ {
+ // DeleteVolumeMountPoint()
+ // 2013-01-13: MSDN does not confirm LongPath usage but a Unicode version of this function exists.
+
+ // A trailing backslash is required.
+ var success = NativeMethods.DeleteVolumeMountPoint(Path.AddTrailingDirectorySeparator(volumeMountPoint, false));
+
+ var lastError = Marshal.GetLastWin32Error();
+ if (!success && !continueOnException)
+ {
+ if (lastError == Win32Errors.ERROR_INVALID_PARAMETER && continueIfJunction)
+ return;
+
+ if (lastError == Win32Errors.ERROR_FILE_NOT_FOUND)
+ lastError = (int)Win32Errors.ERROR_PATH_NOT_FOUND;
+
+ NativeError.ThrowException(lastError, volumeMountPoint);
+ }
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DiskFreeSpace.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DiskFreeSpace.cs
new file mode 100644
index 0000000..fb35794
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DiskFreeSpace.cs
@@ -0,0 +1,63 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS]
+ /// Retrieves information about the amount of space that is available on a disk volume, which is the total amount of space, the total
+ /// amount of free space, and the total amount of free space available to the user that is associated with the calling thread.
+ ///
+ /// The calling application must have FILE_LIST_DIRECTORY access rights for this directory.
+ ///
+ /// A path to a drive. For example: "C:\", "\\server\share", or "\\?\Volume{c0580d5e-2ad6-11dc-9924-806e6f6e6963}\".
+ ///
+ /// A class instance.
+ [SecurityCritical]
+ public static DiskSpaceInfo GetDiskFreeSpace(string drivePath)
+ {
+ return new DiskSpaceInfo(drivePath, null, true, true);
+ }
+
+
+ /// [AlphaFS]
+ /// Retrieves information about the amount of space that is available on a disk volume, which is the total amount of space, the total
+ /// amount of free space, and the total amount of free space available to the user that is associated with the calling thread.
+ ///
+ /// The calling application must have FILE_LIST_DIRECTORY access rights for this directory.
+ ///
+ /// A path to a drive. For example: "C:\", "\\server\share", or "\\?\Volume{c0580d5e-2ad6-11dc-9924-806e6f6e6963}\".
+ ///
+ ///
+ /// null gets both size- and disk cluster information. true Get only disk cluster information,
+ /// false Get only size information.
+ ///
+ /// A class instance.
+ [SecurityCritical]
+ public static DiskSpaceInfo GetDiskFreeSpace(string drivePath, bool? spaceInfoType)
+ {
+ return new DiskSpaceInfo(drivePath, spaceInfoType, true, true);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DriveType.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DriveType.cs
new file mode 100644
index 0000000..024f43a
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.DriveType.cs
@@ -0,0 +1,58 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Determines the disk , based on the root of the current directory.
+ /// A enum value.
+ [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
+ [SecurityCritical]
+ public static DriveType GetCurrentDriveType()
+ {
+ return GetDriveType(null);
+ }
+
+
+ /// [AlphaFS] Determines the disk .
+ /// A path to a drive. For example: "C:\", "\\server\share", or "\\?\Volume{c0580d5e-2ad6-11dc-9924-806e6f6e6963}\"
+ /// A enum value.
+ [SecurityCritical]
+ public static DriveType GetDriveType(string drivePath)
+ {
+ // drivePath is allowed to be == null.
+
+ drivePath = Path.AddTrailingDirectorySeparator(drivePath, false);
+
+
+ // ChangeErrorMode is for the Win32 SetThreadErrorMode() method, used to suppress possible pop-ups.
+
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+
+ return NativeMethods.GetDriveType(drivePath);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.EnumerateVolumeMountPoints.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.EnumerateVolumeMountPoints.cs
new file mode 100644
index 0000000..b0bc6d3
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.EnumerateVolumeMountPoints.cs
@@ -0,0 +1,91 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Text;
+using winPEAS._3rdParty.AlphaFS;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Returns an enumerable collection of of all mounted folders (volume mount points) on the specified volume.
+ ///
+ ///
+ /// A containing the volume .
+ /// An enumerable collection of of all volume mount points on the specified volume.
+ [SecurityCritical]
+ public static IEnumerable EnumerateVolumeMountPoints(string volumeGuid)
+ {
+ if (Utils.IsNullOrWhiteSpace(volumeGuid))
+ throw new ArgumentNullException("volumeGuid");
+
+ if (!volumeGuid.StartsWith(Path.VolumePrefix + "{", StringComparison.OrdinalIgnoreCase))
+ throw new ArgumentException(Resources.Not_A_Valid_Guid, "volumeGuid");
+
+
+ // A trailing backslash is required.
+ volumeGuid = Path.AddTrailingDirectorySeparator(volumeGuid, false);
+
+
+ var buffer = new StringBuilder(NativeMethods.MaxPathUnicode);
+
+
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ using (var handle = NativeMethods.FindFirstVolumeMountPoint(volumeGuid, buffer, (uint)buffer.Capacity))
+ {
+ var lastError = Marshal.GetLastWin32Error();
+
+ if (!NativeMethods.IsValidHandle(handle, false))
+ {
+ switch ((uint)lastError)
+ {
+ case Win32Errors.ERROR_NO_MORE_FILES:
+ case Win32Errors.ERROR_PATH_NOT_FOUND: // Observed with USB stick, FAT32 formatted.
+ yield break;
+
+ default:
+ NativeError.ThrowException(lastError, volumeGuid);
+ break;
+ }
+ }
+
+ yield return buffer.ToString();
+
+
+ while (NativeMethods.FindNextVolumeMountPoint(handle, buffer, (uint)buffer.Capacity))
+ {
+ lastError = Marshal.GetLastWin32Error();
+
+ var throwException = lastError != Win32Errors.ERROR_NO_MORE_FILES && lastError != Win32Errors.ERROR_PATH_NOT_FOUND && lastError != Win32Errors.ERROR_MORE_DATA;
+
+ if (!NativeMethods.IsValidHandle(handle, lastError, volumeGuid, throwException))
+ yield break;
+
+ yield return buffer.ToString();
+ }
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.EnumerateVolumePathNames.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.EnumerateVolumePathNames.cs
new file mode 100644
index 0000000..bdfaaee
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.EnumerateVolumePathNames.cs
@@ -0,0 +1,90 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Text;
+using winPEAS._3rdParty.AlphaFS;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Returns an enumerable collection of drive letters and mounted folder paths for the specified volume.
+ /// An enumerable collection of containing the path names for the specified volume.
+ ///
+ ///
+ /// A volume path: \\?\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\.
+ [SecurityCritical]
+ public static IEnumerable EnumerateVolumePathNames(string volumeGuid)
+ {
+ if (Utils.IsNullOrWhiteSpace(volumeGuid))
+ throw new ArgumentNullException("volumeGuid");
+
+ if (!volumeGuid.StartsWith(Path.VolumePrefix + "{", StringComparison.OrdinalIgnoreCase))
+ throw new ArgumentException(Resources.Not_A_Valid_Guid, "volumeGuid");
+
+
+ var volName = Path.AddTrailingDirectorySeparator(volumeGuid, false);
+
+
+ uint requiredLength = 10;
+ var cBuffer = new char[requiredLength];
+
+
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ while (!NativeMethods.GetVolumePathNamesForVolumeName(volName, cBuffer, (uint)cBuffer.Length, out requiredLength))
+ {
+ var lastError = Marshal.GetLastWin32Error();
+
+ switch ((uint)lastError)
+ {
+ case Win32Errors.ERROR_MORE_DATA:
+ case Win32Errors.ERROR_INSUFFICIENT_BUFFER:
+ cBuffer = new char[requiredLength];
+ break;
+
+ default:
+ NativeError.ThrowException(lastError, volumeGuid);
+ break;
+ }
+ }
+
+
+ var buffer = new StringBuilder(cBuffer.Length);
+ foreach (var c in cBuffer)
+ {
+ if (c != Path.StringTerminatorChar)
+ buffer.Append(c);
+ else
+ {
+ if (buffer.Length > 0)
+ {
+ yield return buffer.ToString();
+ buffer.Length = 0;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.EnumerateVolumes.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.EnumerateVolumes.cs
new file mode 100644
index 0000000..d45b0c8
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.EnumerateVolumes.cs
@@ -0,0 +1,68 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Text;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Returns an enumerable collection of volumes on the computer.
+ /// An enumerable collection of volume names on the computer.
+ [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateVolumes()
+ {
+ var buffer = new StringBuilder(NativeMethods.MaxPathUnicode);
+
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ using (var handle = NativeMethods.FindFirstVolume(buffer, (uint)buffer.Capacity))
+ {
+ var lastError = Marshal.GetLastWin32Error();
+
+ var throwException = lastError != Win32Errors.ERROR_NO_MORE_FILES && lastError != Win32Errors.ERROR_PATH_NOT_FOUND;
+
+ if (!NativeMethods.IsValidHandle(handle, lastError, String.Empty, throwException))
+ yield break;
+
+ yield return buffer.ToString();
+
+
+ while (NativeMethods.FindNextVolume(handle, buffer, (uint)buffer.Capacity))
+ {
+ lastError = Marshal.GetLastWin32Error();
+
+ throwException = lastError != Win32Errors.ERROR_NO_MORE_FILES && lastError != Win32Errors.ERROR_PATH_NOT_FOUND && lastError != Win32Errors.ERROR_MORE_DATA;
+
+ if (!NativeMethods.IsValidHandle(handle, lastError, String.Empty, throwException))
+ yield break;
+
+ yield return buffer.ToString();
+ }
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetDriveFormat.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetDriveFormat.cs
new file mode 100644
index 0000000..8b887d3
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetDriveFormat.cs
@@ -0,0 +1,44 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Diagnostics.CodeAnalysis;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Gets the name of the file system, such as NTFS or FAT32.
+ /// Use DriveFormat to determine what formatting a drive uses.
+ ///
+ /// A path to a drive. For example: "C:\", "\\server\share", or "\\?\Volume{c0580d5e-2ad6-11dc-9924-806e6f6e6963}\".
+ ///
+ /// The name of the file system on the specified drive or null on failure or if not available.
+ [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
+ [SecurityCritical]
+ public static string GetDriveFormat(string drivePath)
+ {
+ var fsName = new VolumeInfo(drivePath, true, true).FileSystemName;
+
+ return Utils.IsNullOrWhiteSpace(fsName) ? null : fsName;
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetDriveNameForNtDeviceName.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetDriveNameForNtDeviceName.cs
new file mode 100644
index 0000000..f6f81d8
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetDriveNameForNtDeviceName.cs
@@ -0,0 +1,44 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Gets the drive letter from an MS-DOS device name. For example: "\Device\HarddiskVolume2" returns "C:\".
+ /// An MS-DOS device name.
+ /// The drive letter from an MS-DOS device name.
+ [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Nt")]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Nt")]
+ public static string GetDriveNameForNtDeviceName(string deviceName)
+ {
+ return (from drive in Directory.EnumerateLogicalDrivesCore(false, false)
+
+ where drive.DosDeviceName.Equals(deviceName, StringComparison.OrdinalIgnoreCase)
+
+ select drive.Name).FirstOrDefault();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetUniqueVolumeNameForPath.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetUniqueVolumeNameForPath.cs
new file mode 100644
index 0000000..b56224d
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetUniqueVolumeNameForPath.cs
@@ -0,0 +1,58 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Get the unique volume name for the given path.
+ ///
+ ///
+ /// A path string. Both absolute and relative file and directory names, for example "..", is acceptable in this path. If you specify a
+ /// relative file or directory name without a volume qualifier, GetUniqueVolumeNameForPath returns the Drive letter of the current
+ /// volume.
+ ///
+ ///
+ /// Returns the unique volume name in the form: "\\?\Volume{GUID}\",
+ /// or null on error or if unavailable.
+ ///
+ [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
+ [SecurityCritical]
+ public static string GetUniqueVolumeNameForPath(string volumePathName)
+ {
+ if (Utils.IsNullOrWhiteSpace(volumePathName))
+ throw new ArgumentNullException("volumePathName");
+
+ try
+ {
+ return GetVolumeGuid(GetVolumePathName(volumePathName));
+ }
+ catch
+ {
+ return null;
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeDeviceName.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeDeviceName.cs
new file mode 100644
index 0000000..39da2a1
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeDeviceName.cs
@@ -0,0 +1,42 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Retrieves the Win32 Device name from the Volume name.
+ /// The Win32 Device name from the Volume name, for example: "\Device\HarddiskVolume2", or null on error or if unavailable.
+ /// This is the same method as .
+ ///
+ ///
+ /// Name of the Volume.
+ [SecurityCritical]
+ public static string GetVolumeDeviceName(string volumeName)
+ {
+ return QueryDosDevice(volumeName);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeDisplayName.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeDisplayName.cs
new file mode 100644
index 0000000..d1ce9e9
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeDisplayName.cs
@@ -0,0 +1,56 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Gets the shortest display name for the specified .
+ /// This method basically returns the shortest string returned by
+ /// A volume path: \\?\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\.
+ ///
+ /// The shortest display name for the specified volume found, or null if no display names were found.
+ ///
+ [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
+ [SecurityCritical]
+ public static string GetVolumeDisplayName(string volumeName)
+ {
+ string[] smallestMountPoint = { new string(Path.WildcardStarMatchAllChar, NativeMethods.MaxPathUnicode) };
+
+ try
+ {
+ foreach (var m in EnumerateVolumePathNames(volumeName).Where(m => !Utils.IsNullOrWhiteSpace(m) && m.Length < smallestMountPoint[0].Length))
+ smallestMountPoint[0] = m;
+ }
+ catch
+ {
+ }
+
+ var result = smallestMountPoint[0][0] == Path.WildcardStarMatchAllChar ? null : smallestMountPoint[0];
+ return Utils.IsNullOrWhiteSpace(result) ? null : result;
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeGuid.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeGuid.cs
new file mode 100644
index 0000000..14b0f98
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeGuid.cs
@@ -0,0 +1,91 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Text;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS]
+ /// Retrieves a volume path for the volume that is associated with the specified volume mount point (drive letter,
+ /// volume GUID path, or mounted folder).
+ ///
+ ///
+ ///
+ /// The path of a mounted folder (for example, "Y:\MountX\") or a drive letter (for example, "X:\").
+ ///
+ /// The unique volume name of the form: "\\?\Volume{GUID}\".
+ [SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke", Justification = "Marshal.GetLastWin32Error() is manipulated.")]
+ [SecurityCritical]
+ public static string GetVolumeGuid(string volumeMountPoint)
+ {
+ if (Utils.IsNullOrWhiteSpace(volumeMountPoint))
+ throw new ArgumentNullException("volumeMountPoint");
+
+ // The string must end with a trailing backslash ('\').
+ volumeMountPoint = Path.GetFullPathCore(null, false, volumeMountPoint, GetFullPathOptions.AsLongPath | GetFullPathOptions.AddTrailingDirectorySeparator | GetFullPathOptions.FullCheck);
+
+ var volumeGuid = new StringBuilder(100);
+ var uniqueName = new StringBuilder(100);
+
+ try
+ {
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ {
+ // GetVolumeNameForVolumeMountPoint()
+ // 2013-07-18: MSDN does not confirm LongPath usage but a Unicode version of this function exists.
+
+ return NativeMethods.GetVolumeNameForVolumeMountPoint(volumeMountPoint, volumeGuid, (uint)volumeGuid.Capacity)
+
+ // The string must end with a trailing backslash.
+ ? NativeMethods.GetVolumeNameForVolumeMountPoint(Path.AddTrailingDirectorySeparator(volumeGuid.ToString(), false), uniqueName, (uint)uniqueName.Capacity)
+ ? uniqueName.ToString()
+ : null
+
+ : null;
+ }
+ }
+ finally
+ {
+ var lastError = (uint) Marshal.GetLastWin32Error();
+
+ switch (lastError)
+ {
+ case Win32Errors.ERROR_MORE_DATA:
+ // (1) When GetVolumeNameForVolumeMountPoint() succeeds, lastError is set to Win32Errors.ERROR_MORE_DATA.
+ break;
+
+ default:
+ // (2) When volumeMountPoint is a network drive mapping or UNC path, lastError is set to Win32Errors.ERROR_INVALID_PARAMETER.
+
+ // Throw IOException.
+ NativeError.ThrowException(lastError, volumeMountPoint);
+ break;
+ }
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeGuidForNtDeviceName.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeGuidForNtDeviceName.cs
new file mode 100644
index 0000000..dc59ca6
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeGuidForNtDeviceName.cs
@@ -0,0 +1,47 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS]
+ /// Tranlates DosDevicePath to a Volume GUID. For example: "\Device\HarddiskVolumeX\path\filename.ext" can translate to: "\path\
+ /// filename.ext" or: "\\?\Volume{GUID}\path\filename.ext".
+ ///
+ /// A DosDevicePath, for example: \Device\HarddiskVolumeX\path\filename.ext.
+ /// A translated dos path.
+ [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Nt")]
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Nt")]
+ public static string GetVolumeGuidForNtDeviceName(string dosDevice)
+ {
+ return (from drive in Directory.EnumerateLogicalDrivesCore(false, false)
+
+ where drive.DosDeviceName.Equals(dosDevice, StringComparison.OrdinalIgnoreCase)
+
+ select drive.VolumeInfo.Guid).FirstOrDefault();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeInfo.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeInfo.cs
new file mode 100644
index 0000000..4396aa0
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumeInfo.cs
@@ -0,0 +1,48 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Security;
+using Microsoft.Win32.SafeHandles;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Retrieves information about the file system and volume associated with the specified root file or directorystream.
+ /// A path that contains the root directory.
+ /// A instance describing the volume associatied with the specified root directory.
+ [SecurityCritical]
+ public static VolumeInfo GetVolumeInfo(string volumePath)
+ {
+ return new VolumeInfo(volumePath, true, false);
+ }
+
+
+ /// [AlphaFS] Retrieves information about the file system and volume associated with the specified root file or directorystream.
+ /// An instance to a handle.
+ /// A instance describing the volume associatied with the specified root directory.
+ [SecurityCritical]
+ public static VolumeInfo GetVolumeInfo(SafeFileHandle volumeHandle)
+ {
+ return new VolumeInfo(volumeHandle, true, true);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumePathName.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumePathName.cs
new file mode 100644
index 0000000..a7e6ddd
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.GetVolumePathName.cs
@@ -0,0 +1,81 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Text;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Retrieves the volume mount point where the specified path is mounted.
+ ///
+ /// The path to the volume, for example: "C:\Windows".
+ ///
+ /// Returns the nearest volume root path for a given directory.
+ /// The volume path name, for example: "C:\Windows" returns: "C:\".
+ ///
+ [SecurityCritical]
+ public static string GetVolumePathName(string path)
+ {
+ if (Utils.IsNullOrWhiteSpace(path))
+ throw new ArgumentNullException("path");
+
+
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ {
+ var volumeRootPath = new StringBuilder(NativeMethods.MaxPathUnicode / 32);
+ var pathLp = Path.GetFullPathCore(null, false, path, GetFullPathOptions.AsLongPath | GetFullPathOptions.FullCheck);
+
+
+ // GetVolumePathName()
+ // 2013-07-18: MSDN does not confirm LongPath usage but a Unicode version of this function exists.
+
+ var success = NativeMethods.GetVolumePathName(pathLp, volumeRootPath, (uint) volumeRootPath.Capacity);
+
+ var lastError = Marshal.GetLastWin32Error();
+
+ if (success)
+ return Path.GetRegularPathCore(volumeRootPath.ToString(), GetFullPathOptions.None, false);
+
+
+ switch ((uint) lastError)
+ {
+ // Don't throw exception on these errors.
+ case Win32Errors.ERROR_NO_MORE_FILES:
+ case Win32Errors.ERROR_INVALID_PARAMETER:
+ case Win32Errors.ERROR_INVALID_NAME:
+ break;
+
+ default:
+ NativeError.ThrowException(lastError, path);
+ break;
+ }
+
+
+ // Return original path.
+ return path;
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.IsReady.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.IsReady.cs
new file mode 100644
index 0000000..e976334
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.IsReady.cs
@@ -0,0 +1,39 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Gets a value indicating whether a drive is ready.
+ ///
+ /// A path to a drive. For example: "C:\", "\\server\share", or "\\?\Volume{c0580d5e-2ad6-11dc-9924-806e6f6e6963}\".
+ ///
+ /// true if is ready; otherwise, false.
+ [SecurityCritical]
+ public static bool IsReady(string drivePath)
+ {
+ return File.ExistsCore(null, true, drivePath, PathFormat.FullPath);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.IsSameVolume.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.IsSameVolume.cs
new file mode 100644
index 0000000..56e805c
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.IsSameVolume.cs
@@ -0,0 +1,50 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Determines whether the volume of two file system objects is the same, by comparing their serial numbers.
+ /// The first filesystem object with full path information.
+ /// The second file system object with full path information.
+ /// true if both filesytem objects reside on the same volume, false otherwise.
+ [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
+ [SecurityCritical]
+ public static bool IsSameVolume(string path1, string path2)
+ {
+ try
+ {
+ var volInfo1 = new VolumeInfo(GetVolumePathName(path1), true, true);
+ var volInfo2 = new VolumeInfo(GetVolumePathName(path2), true, true);
+
+ return volInfo1.SerialNumber.Equals(volInfo2.SerialNumber) || volInfo1.Guid.Equals(volInfo2.Guid, StringComparison.OrdinalIgnoreCase);
+ }
+ catch { }
+
+ return false;
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.IsVolume.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.IsVolume.cs
new file mode 100644
index 0000000..8e29d10
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.IsVolume.cs
@@ -0,0 +1,39 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Determines whether the specified volume name is a defined volume on the current computer.
+ ///
+ /// A path to a volume. For example: "C:\", "\\server\share", or "\\?\Volume{c0580d5e-2ad6-11dc-9924-806e6f6e6963}\".
+ ///
+ /// true on success, false otherwise.
+ [SecurityCritical]
+ public static bool IsVolume(string volumeMountPoint)
+ {
+ return !Utils.IsNullOrWhiteSpace(GetVolumeGuid(volumeMountPoint));
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.QueryDosDevice.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.QueryDosDevice.cs
new file mode 100644
index 0000000..c5e993f
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.QueryDosDevice.cs
@@ -0,0 +1,164 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Text;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Retrieves a sorted list of all existing MS-DOS device names.
+ /// An sorted list of all existing MS-DOS device names.
+ [SecurityCritical]
+ public static IEnumerable QueryAllDosDevices()
+ {
+ return QueryDosDeviceCore(null, true);
+ }
+
+
+ /// [AlphaFS] Retrieves the current mapping for a particular MS-DOS device name.
+ /// The current mapping for a particular MS-DOS device name.
+ ///
+ ///
+ /// An MS-DOS device name string specifying the target of the query, such as: "C:", "D:" or "\\?\Volume{GUID}".
+ [SecurityCritical]
+ public static string QueryDosDevice(string deviceName)
+ {
+ if (Utils.IsNullOrWhiteSpace(deviceName))
+ throw new ArgumentNullException("deviceName");
+
+
+ var devName = QueryDosDeviceCore(deviceName, false).ToArray()[0];
+
+ return !Utils.IsNullOrWhiteSpace(devName) ? devName : null;
+ }
+
+
+
+
+ /// [AlphaFS] Retrieves the current mapping for a particular MS-DOS device name. The function can also obtain a list of all existing MS-DOS device names.
+ /// An sorted list of all existing MS-DOS device names or the .
+ ///
+ ///
+ /// An MS-DOS device name string specifying the target of the query, such as: "C:", "D:" or "\\?\Volume{GUID}".
+ /// true to sort the list with MS-DOS device names.
+ [SecurityCritical]
+ internal static IEnumerable QueryDosDeviceCore(string deviceName, bool sort)
+ {
+ // deviceName is allowed to be null: Retrieve a list of all existing MS-DOS device names.
+ // The deviceName cannot have a trailing backslash.
+
+ if (!Utils.IsNullOrWhiteSpace(deviceName))
+ {
+ if (deviceName.StartsWith(Path.GlobalRootPrefix, StringComparison.OrdinalIgnoreCase))
+ {
+ yield return deviceName.Substring(Path.GlobalRootPrefix.Length);
+
+ yield break;
+ }
+
+
+ if (deviceName.StartsWith(Path.VolumePrefix, StringComparison.OrdinalIgnoreCase))
+
+ deviceName = deviceName.Substring(Path.LongPathPrefix.Length);
+
+
+ deviceName = Path.RemoveTrailingDirectorySeparator(deviceName);
+ }
+
+
+
+
+ uint returnedBufferSize = 0;
+
+ var bufferSize = (uint) (sort ? NativeMethods.DefaultFileBufferSize : 64);
+
+ var sortedList = new List(sort ? 256 : 0);
+
+
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ while (returnedBufferSize == 0)
+ {
+ var cBuffer = new char[bufferSize];
+
+ returnedBufferSize = NativeMethods.QueryDosDevice(deviceName, cBuffer, bufferSize);
+
+ var lastError = Marshal.GetLastWin32Error();
+
+ if (returnedBufferSize == 0)
+ switch ((uint) lastError)
+ {
+ case Win32Errors.ERROR_MORE_DATA:
+ case Win32Errors.ERROR_INSUFFICIENT_BUFFER:
+ bufferSize *= 2;
+ continue;
+
+ default:
+ NativeError.ThrowException(lastError, deviceName);
+ break;
+ }
+
+
+ var buffer = new StringBuilder((int) returnedBufferSize);
+
+
+ for (var i = 0; i < returnedBufferSize; i++)
+ {
+ if (cBuffer[i] != Path.StringTerminatorChar)
+
+ buffer.Append(cBuffer[i]);
+
+
+ else if (buffer.Length > 0)
+ {
+ var assembledPath = buffer.ToString();
+
+ assembledPath = !Utils.IsNullOrWhiteSpace(assembledPath) ? assembledPath : null;
+
+
+ if (sort)
+ sortedList.Add(assembledPath);
+
+ else
+ yield return assembledPath;
+
+
+ buffer.Length = 0;
+ }
+ }
+ }
+
+
+ if (sort)
+ {
+ foreach (var devName in sortedList.OrderBy(devName => devName))
+
+ yield return devName;
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.SetVolumeMountPoint.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.SetVolumeMountPoint.cs
new file mode 100644
index 0000000..6c3a7a8
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.SetVolumeMountPoint.cs
@@ -0,0 +1,82 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Runtime.InteropServices;
+using System.Security;
+using winPEAS._3rdParty.AlphaFS;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Associates a volume with a Drive letter or a directory on another volume.
+ ///
+ ///
+ ///
+ /// The user-mode path to be associated with the volume. This may be a Drive letter (for example, "X:\")
+ /// or a directory on another volume (for example, "Y:\MountX\").
+ ///
+ /// A containing the volume .
+ [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Justification = "Utils.IsNullOrWhiteSpace validates arguments.")]
+ [SecurityCritical]
+ public static void SetVolumeMountPoint(string volumeMountPoint, string volumeGuid)
+ {
+ if (Utils.IsNullOrWhiteSpace(volumeMountPoint))
+ throw new ArgumentNullException("volumeMountPoint");
+
+ if (Utils.IsNullOrWhiteSpace(volumeGuid))
+ throw new ArgumentNullException("volumeGuid");
+
+ if (!volumeGuid.StartsWith(Path.VolumePrefix + "{", StringComparison.OrdinalIgnoreCase))
+ throw new ArgumentException(Resources.Not_A_Valid_Guid, "volumeGuid");
+
+
+ volumeMountPoint = Path.GetFullPathCore(null, false, volumeMountPoint, GetFullPathOptions.AsLongPath | GetFullPathOptions.AddTrailingDirectorySeparator | GetFullPathOptions.FullCheck);
+
+
+ // This string must be of the form "\\?\Volume{GUID}\"
+ volumeGuid = Path.AddTrailingDirectorySeparator(volumeGuid, false);
+
+
+ // ChangeErrorMode is for the Win32 SetThreadErrorMode() method, used to suppress possible pop-ups.
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ {
+ // SetVolumeMountPoint()
+ // 2014-01-29: MSDN does not confirm LongPath usage but a Unicode version of this function exists.
+
+ // The string must end with a trailing backslash.
+ var success = NativeMethods.SetVolumeMountPoint(volumeMountPoint, volumeGuid);
+
+ var lastError = Marshal.GetLastWin32Error();
+ if (!success)
+ {
+ // If the lpszVolumeMountPoint parameter contains a path to a mounted folder,
+ // GetLastError returns ERROR_DIR_NOT_EMPTY, even if the directory is empty.
+
+ if (lastError != Win32Errors.ERROR_DIR_NOT_EMPTY)
+ NativeError.ThrowException(lastError, volumeGuid);
+ }
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.VolumeLabel.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.VolumeLabel.cs
new file mode 100644
index 0000000..3be4de8
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.VolumeLabel.cs
@@ -0,0 +1,114 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Volume
+ {
+ /// [AlphaFS] Deletes the label of the file system volume that is the root of the current directory.
+ [SecurityCritical]
+ public static void DeleteCurrentVolumeLabel()
+ {
+ SetVolumeLabel(null, null);
+ }
+
+
+ /// [AlphaFS] Deletes the label of a file system volume.
+ ///
+ /// The root directory of a file system volume. This is the volume the function will remove the label.
+ [SecurityCritical]
+ public static void DeleteVolumeLabel(string rootPathName)
+ {
+ if (Utils.IsNullOrWhiteSpace(rootPathName))
+ throw new ArgumentNullException("rootPathName");
+
+
+ SetVolumeLabel(rootPathName, null);
+ }
+
+
+ /// [AlphaFS] Retrieve the label of a file system volume.
+ ///
+ /// A path to a volume. For example: "C:\", "\\server\share", or "\\?\Volume{c0580d5e-2ad6-11dc-9924-806e6f6e6963}\".
+ ///
+ /// The the label of the file system volume. This function can return string.Empty since a volume label is generally not mandatory.
+ [SecurityCritical]
+ public static string GetVolumeLabel(string volumePath)
+ {
+ return new VolumeInfo(volumePath, true, true).Name;
+ }
+
+
+ /// [AlphaFS] Sets the label of the file system volume that is the root of the current directory.
+ ///
+ /// A name for the volume.
+ [SecurityCritical]
+ public static void SetCurrentVolumeLabel(string volumeName)
+ {
+ if (Utils.IsNullOrWhiteSpace(volumeName))
+ throw new ArgumentNullException("volumeName");
+
+
+ var success = NativeMethods.SetVolumeLabel(null, volumeName);
+
+ var lastError = Marshal.GetLastWin32Error();
+ if (!success)
+ NativeError.ThrowException(lastError, volumeName);
+ }
+
+
+ /// [AlphaFS] Sets the label of a file system volume.
+ ///
+ /// A path to a volume. For example: "C:\", "\\server\share", or "\\?\Volume{c0580d5e-2ad6-11dc-9924-806e6f6e6963}\"
+ /// If this parameter is null, the function uses the current drive.
+ ///
+ ///
+ /// A name for the volume.
+ /// If this parameter is null, the function deletes any existing label
+ /// from the specified volume and does not assign a new label.
+ ///
+ [SecurityCritical]
+ public static void SetVolumeLabel(string volumePath, string volumeName)
+ {
+ // rootPathName == null is allowed, means current drive.
+
+ // Setting volume label only applies to Logical Drives pointing to local resources.
+ //if (!Path.IsLocalPath(rootPathName))
+ //return false;
+
+ volumePath = Path.AddTrailingDirectorySeparator(volumePath, false);
+
+ // NTFS uses a limit of 32 characters for the volume label as of Windows Server 2003.
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ {
+ var success = NativeMethods.SetVolumeLabel(volumePath, volumeName);
+
+ var lastError = Marshal.GetLastWin32Error();
+ if (!success)
+ NativeError.ThrowException(lastError, volumePath, volumeName);
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.cs
new file mode 100644
index 0000000..1566731
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/Volume.cs
@@ -0,0 +1,28 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ /// [AlphaFS] Static class providing utility methods for working with Microsoft Windows devices and volumes.
+ public static partial class Volume
+ {
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/VolumeInfo.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/VolumeInfo.cs
new file mode 100644
index 0000000..9b90199
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Device/Volume/VolumeInfo.cs
@@ -0,0 +1,380 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using Microsoft.Win32.SafeHandles;
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Text;
+using winPEAS._3rdParty.AlphaFS;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ /// Contains information about a filesystem Volume.
+ [Serializable]
+ [SecurityCritical]
+ public sealed class VolumeInfo
+ {
+ [NonSerialized] private readonly bool _continueOnAccessError;
+ [NonSerialized] private readonly SafeFileHandle _volumeHandle;
+ [NonSerialized] private NativeMethods.VOLUME_INFO_FLAGS _volumeInfoAttributes;
+
+
+ /// Initializes a VolumeInfo instance.
+ ///
+ ///
+ /// A valid drive path or drive letter. This can be either uppercase or lowercase, 'a' to 'z' or a network share in the format: \\server\share.
+ [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Utils.IsNullOrWhiteSpace validates arguments.")]
+ [SecurityCritical]
+ public VolumeInfo(string volumeName)
+ {
+ if (Utils.IsNullOrWhiteSpace(volumeName))
+ throw new ArgumentNullException("volumeName");
+
+
+ if (!volumeName.StartsWith(Path.LongPathPrefix, StringComparison.Ordinal))
+ volumeName = Path.IsUncPathCore(volumeName, false, false) ? Path.GetLongPathCore(volumeName, GetFullPathOptions.None) : Path.LongPathPrefix + volumeName;
+
+ else
+ {
+ volumeName = volumeName.Length == 1 ? volumeName + Path.VolumeSeparatorChar : Path.GetPathRoot(volumeName, false);
+
+ if (!volumeName.StartsWith(Path.GlobalRootPrefix, StringComparison.OrdinalIgnoreCase))
+ volumeName = Path.GetPathRoot(volumeName, false);
+ }
+
+
+ if (Utils.IsNullOrWhiteSpace(volumeName))
+ throw new ArgumentException(Resources.InvalidDriveLetterArgument, "volumeName");
+
+
+ Name = Path.AddTrailingDirectorySeparator(volumeName, false);
+
+ _volumeHandle = null;
+ }
+
+
+ /// Initializes a VolumeInfo instance.
+ /// A valid drive path or drive letter. This can be either uppercase or lowercase, 'a' to 'z' or a network share in the format: "\\server\share".
+ /// Refreshes the state of the object.
+ /// true suppress any Exception that might be thrown as a result from a failure, such as unavailable resources.
+ [SecurityCritical]
+ public VolumeInfo(string driveName, bool refresh, bool continueOnException) : this(driveName)
+ {
+ _continueOnAccessError = continueOnException;
+
+ if (refresh)
+ Refresh();
+ }
+
+
+ /// Initializes a VolumeInfo instance.
+ /// An instance to a handle.
+ [SecurityCritical]
+ public VolumeInfo(SafeFileHandle volumeHandle)
+ {
+ _volumeHandle = volumeHandle;
+ }
+
+
+ /// Initializes a VolumeInfo instance.
+ /// An instance to a handle.
+ /// Refreshes the state of the object.
+ /// true suppress any Exception that might be thrown as a result from a failure, such as unavailable resources.
+ [SecurityCritical]
+ public VolumeInfo(SafeFileHandle volumeHandle, bool refresh, bool continueOnException) : this(volumeHandle)
+ {
+ _continueOnAccessError = continueOnException;
+
+ if (refresh)
+ Refresh();
+ }
+
+
+
+
+ /// Refreshes the state of the object.
+ public void Refresh()
+ {
+ var volumeNameBuffer = new StringBuilder(NativeMethods.MaxPath + 1);
+ var fileSystemNameBuffer = new StringBuilder(NativeMethods.MaxPath + 1);
+ int maximumComponentLength;
+ uint serialNumber;
+
+ using (new NativeMethods.ChangeErrorMode(NativeMethods.ErrorMode.FailCriticalErrors))
+ {
+ // GetVolumeInformationXxx()
+ // 2013-07-18: MSDN does not confirm LongPath usage but a Unicode version of this function exists.
+
+ uint lastError;
+
+ do
+ {
+ var success = null != _volumeHandle && NativeMethods.IsAtLeastWindowsVista
+
+ // GetVolumeInformationByHandle() / GetVolumeInformation()
+ // 2013-07-18: MSDN does not confirm LongPath usage but a Unicode version of this function exists.
+
+ ? NativeMethods.GetVolumeInformationByHandle(_volumeHandle, volumeNameBuffer, (uint) volumeNameBuffer.Capacity, out serialNumber, out maximumComponentLength, out _volumeInfoAttributes, fileSystemNameBuffer, (uint) fileSystemNameBuffer.Capacity)
+
+ // A trailing backslash is required.
+ : NativeMethods.GetVolumeInformation(Path.AddTrailingDirectorySeparator(Name, false), volumeNameBuffer, (uint) volumeNameBuffer.Capacity, out serialNumber, out maximumComponentLength, out _volumeInfoAttributes, fileSystemNameBuffer, (uint) fileSystemNameBuffer.Capacity);
+
+
+ lastError = (uint) Marshal.GetLastWin32Error();
+ if (!success)
+ {
+ switch (lastError)
+ {
+ case Win32Errors.ERROR_NOT_READY:
+ if (!_continueOnAccessError)
+ throw new DeviceNotReadyException(Name, true);
+ break;
+
+ case Win32Errors.ERROR_MORE_DATA:
+ // With a large enough buffer this code never executes.
+ volumeNameBuffer.Capacity = volumeNameBuffer.Capacity*2;
+ fileSystemNameBuffer.Capacity = fileSystemNameBuffer.Capacity*2;
+ break;
+
+ default:
+ if (!_continueOnAccessError)
+ NativeError.ThrowException(lastError, Name);
+ break;
+ }
+ }
+
+ else
+ break;
+
+ } while (lastError == Win32Errors.ERROR_MORE_DATA);
+ }
+
+ FullPath = Path.GetRegularPathCore(Name, GetFullPathOptions.None, false);
+ Name = volumeNameBuffer.ToString();
+
+ FileSystemName = fileSystemNameBuffer.ToString();
+ FileSystemName = !Utils.IsNullOrWhiteSpace(FileSystemName) ? FileSystemName : null;
+
+ MaximumComponentLength = maximumComponentLength;
+ SerialNumber = serialNumber;
+ }
+
+
+ /// Returns the full path of the volume.
+ /// A string that represents this instance.
+ public override string ToString()
+ {
+ return Guid;
+ }
+
+
+
+
+ /// The specified volume supports preserved case of file names when it places a name on disk.
+ public bool CasePreservedNames
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_CASE_PRESERVED_NAMES) != 0; }
+ }
+
+
+ /// The specified volume supports case-sensitive file names.
+ public bool CaseSensitiveSearch
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_CASE_SENSITIVE_SEARCH) != 0; }
+ }
+
+
+ /// The specified volume supports file-based compression.
+ public bool Compression
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_FILE_COMPRESSION) != 0; }
+ }
+
+
+ /// The specified volume is a direct access (DAX) volume.
+ public bool DirectAccess
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_DAX_VOLUME) != 0; }
+ }
+
+
+ /// Gets the name of the file system, for example, the FAT file system or the NTFS file system.
+ /// The name of the file system.
+ public string FileSystemName { get; private set; }
+
+
+ /// The full path to the volume.
+ public string FullPath { get; private set; }
+
+
+ private string _guid;
+ /// The volume GUID.
+ public string Guid
+ {
+ get
+ {
+ if (Utils.IsNullOrWhiteSpace(_guid))
+ _guid = !Utils.IsNullOrWhiteSpace(FullPath) ? Volume.GetUniqueVolumeNameForPath(FullPath) : null;
+
+ return _guid;
+ }
+ }
+
+
+ /// Gets the maximum length of a file name component that the file system supports.
+ /// The maximum length of a file name component that the file system supports.
+ public int MaximumComponentLength { get; set; }
+
+
+ /// Gets the label of the volume.
+ /// The label of the volume.
+ /// This property is the label assigned to the volume, such "MyDrive"
+ public string Name { get; private set; }
+
+
+ /// The specified volume supports named streams.
+ public bool NamedStreams
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_NAMED_STREAMS) != 0; }
+ }
+
+
+ /// The specified volume preserves and enforces access control lists (ACL).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Acls")]
+ public bool PersistentAcls
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_PERSISTENT_ACLS) != 0; }
+ }
+
+
+ /// The specified volume is read-only.
+ public bool ReadOnlyVolume
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_READ_ONLY_VOLUME) != 0; }
+ }
+
+
+ /// The specified volume supports a single sequential write.
+ public bool SequentialWriteOnce
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_SEQUENTIAL_WRITE_ONCE) != 0; }
+ }
+
+
+ /// Gets the volume serial number that the operating system assigns when a hard disk is formatted.
+ /// The volume serial number that the operating system assigns when a hard disk is formatted.
+ public long SerialNumber { get; private set; }
+
+
+ /// The specified volume supports the Encrypted File System (EFS).
+ public bool SupportsEncryption
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_SUPPORTS_ENCRYPTION) != 0; }
+ }
+
+
+ /// The specified volume supports extended attributes.
+ public bool SupportsExtendedAttributes
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_SUPPORTS_EXTENDED_ATTRIBUTES) != 0; }
+ }
+
+
+ /// The specified volume supports hard links.
+ public bool SupportsHardLinks
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_SUPPORTS_HARD_LINKS) != 0; }
+ }
+
+
+ /// The specified volume supports object identifiers.
+ public bool SupportsObjectIds
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_SUPPORTS_OBJECT_IDS) != 0; }
+ }
+
+
+ /// The file system supports open by FileID.
+ public bool SupportsOpenByFileId
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_SUPPORTS_OPEN_BY_FILE_ID) != 0; }
+ }
+
+
+ /// The specified volume supports remote storage. (This property does not appear on MSDN)
+ public bool SupportsRemoteStorage
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_SUPPORTS_REMOTE_STORAGE) != 0; }
+ }
+
+
+ /// The specified volume supports re-parse points.
+ public bool SupportsReparsePoints
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_SUPPORTS_REPARSE_POINTS) != 0; }
+ }
+
+
+ /// The specified volume supports sparse files.
+ public bool SupportsSparseFiles
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_SUPPORTS_SPARSE_FILES) != 0; }
+ }
+
+
+ /// The specified volume supports transactions.
+ public bool SupportsTransactions
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_SUPPORTS_TRANSACTIONS) != 0; }
+ }
+
+
+ /// The specified volume supports update sequence number (USN) journals.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Usn")]
+ public bool SupportsUsnJournal
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_SUPPORTS_USN_JOURNAL) != 0; }
+ }
+
+
+ /// The specified volume supports Unicode in file names as they appear on disk.
+ public bool UnicodeOnDisk
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_UNICODE_ON_DISK) != 0; }
+ }
+
+
+ /// The specified volume is a compressed volume, for example, a DoubleSpace volume.
+ public bool VolumeIsCompressed
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_VOLUME_IS_COMPRESSED) != 0; }
+ }
+
+
+ /// The specified volume supports disk quotas.
+ public bool VolumeQuotas
+ {
+ get { return (_volumeInfoAttributes & NativeMethods.VOLUME_INFO_FLAGS.FILE_VOLUME_QUOTAS) != 0; }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/ByHandleFileInfo.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/ByHandleFileInfo.cs
new file mode 100644
index 0000000..461810f
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/ByHandleFileInfo.cs
@@ -0,0 +1,132 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ /// Contains information that the GetFileInformationByHandle function retrieves.
+ [Serializable]
+ [SecurityCritical]
+ public sealed class ByHandleFileInfo
+ {
+ internal ByHandleFileInfo(NativeMethods.BY_HANDLE_FILE_INFORMATION fibh)
+ {
+ CreationTimeUtc = DateTime.FromFileTimeUtc(fibh.ftCreationTime);
+ LastAccessTimeUtc = DateTime.FromFileTimeUtc(fibh.ftLastAccessTime);
+ LastWriteTimeUtc = DateTime.FromFileTimeUtc(fibh.ftLastWriteTime);
+
+ Attributes = fibh.dwFileAttributes;
+ FileIndex = NativeMethods.ToLong(fibh.nFileIndexHigh, fibh.nFileIndexLow);
+ FileSize = NativeMethods.ToLong(fibh.nFileSizeHigh, fibh.nFileSizeLow);
+ NumberOfLinks = (int) fibh.nNumberOfLinks;
+ VolumeSerialNumber = fibh.dwVolumeSerialNumber;
+ }
+
+
+ /// Gets the file attributes.
+ /// The file attributes.
+ public FileAttributes Attributes { get; private set; }
+
+
+ /// Gets the time this entry was created.
+ /// The time this entry was created.
+ public DateTime CreationTime
+ {
+ get { return CreationTimeUtc.ToLocalTime(); }
+ }
+
+
+ /// Gets the time, in coordinated universal time (UTC), this entry was created.
+ /// The time, in coordinated universal time (UTC), this entry was created.
+ public DateTime CreationTimeUtc { get; private set; }
+
+
+ /// Gets the time this entry was last accessed.
+ /// For a file, the structure specifies the last time that a file is read from or written to.
+ /// For a directory, the structure specifies when the directory is created.
+ /// For both files and directories, the specified date is correct, but the time of day is always set to midnight.
+ /// If the underlying file system does not support the last access time, this member is zero (0).
+ ///
+ /// The time this entry was last accessed.
+ public DateTime LastAccessTime
+ {
+ get { return LastAccessTimeUtc.ToLocalTime(); }
+ }
+
+
+ /// Gets the time, in coordinated universal time (UTC), this entry was last accessed.
+ /// For a file, the structure specifies the last time that a file is read from or written to.
+ /// For a directory, the structure specifies when the directory is created.
+ /// For both files and directories, the specified date is correct, but the time of day is always set to midnight.
+ /// If the underlying file system does not support the last access time, this member is zero (0).
+ ///
+ /// The time, in coordinated universal time (UTC), this entry was last accessed.
+ public DateTime LastAccessTimeUtc { get; private set; }
+
+
+ /// Gets the time this entry was last modified.
+ /// For a file, the structure specifies the last time that a file is written to.
+ /// For a directory, the structure specifies when the directory is created.
+ /// If the underlying file system does not support the last access time, this member is zero (0).
+ ///
+ /// The time this entry was last modified.
+ public DateTime LastWriteTime
+ {
+ get { return LastWriteTimeUtc.ToLocalTime(); }
+ }
+
+
+ /// Gets the time, in coordinated universal time (UTC), this entry was last modified.
+ /// For a file, the structure specifies the last time that a file is written to.
+ /// For a directory, the structure specifies when the directory is created.
+ /// If the underlying file system does not support the last access time, this member is zero (0).
+ ///
+ /// The time, in coordinated universal time (UTC), this entry was last modified.
+ public DateTime LastWriteTimeUtc { get; private set; }
+
+
+ /// Gets the serial number of the volume that contains a file.
+ /// The serial number of the volume that contains a file.
+ public long VolumeSerialNumber { get; private set; }
+
+
+ /// Gets the size of the file.
+ /// The size of the file.
+ public long FileSize { get; private set; }
+
+
+ /// Gets the number of links to this file. For the FAT file system this member is always 1. For the NTFS file system, it can be more than 1.
+ /// The number of links to this file.
+ public int NumberOfLinks { get; private set; }
+
+
+ ///
+ /// Gets the unique identifier associated with the file. The identifier and the volume serial number uniquely identify a
+ /// file on a single computer. To determine whether two open handles represent the same file, combine the identifier
+ /// and the volume serial number for each file and compare them.
+ ///
+ /// The unique identifier of the file.
+ public long FileIndex { get; private set; }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/CopyMoveArguments.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/CopyMoveArguments.cs
new file mode 100644
index 0000000..b2fd188
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/CopyMoveArguments.cs
@@ -0,0 +1,61 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ internal struct CopyMoveArguments
+ {
+ public int Retry;
+ public int RetryTimeout;
+
+ public KernelTransaction Transaction;
+ public string SourcePath;
+ public string DestinationPath;
+
+ public bool CopyTimestamps;
+
+ public CopyOptions? CopyOptions;
+ public MoveOptions? MoveOptions;
+
+ public CopyMoveProgressRoutine ProgressHandler;
+ public object UserProgressData;
+
+ public PathFormat PathFormat;
+
+
+ internal DirectoryEnumerationFilters DirectoryEnumerationFilters;
+ internal string SourcePathLp;
+ internal string DestinationPathLp;
+ internal bool IsCopy;
+
+ /// A Move action fallback using Copy + Delete.
+ internal bool EmulateMove;
+
+ /// A file/folder will be deleted or renamed on Computer startup.
+ internal bool DelayUntilReboot;
+
+ internal bool DeleteOnStartup;
+
+ internal NativeMethods.NativeCopyMoveProgressRoutine Routine;
+
+ internal bool PathsChecked;
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/CopyMoveProgressRoutine.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/CopyMoveProgressRoutine.cs
new file mode 100644
index 0000000..64b21d0
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/CopyMoveProgressRoutine.cs
@@ -0,0 +1,26 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ /// Callback used by CopyFileXxx and MoveFileXxx to report progress about the copy/move operation.
+ public delegate CopyMoveProgressResult CopyMoveProgressRoutine(long totalFileSize, long totalBytesTransferred, long streamSize, long streamBytesTransferred, int streamNumber, CopyMoveProgressCallbackReason callbackReason, object userData);
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/CopyMoveResult.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/CopyMoveResult.cs
new file mode 100644
index 0000000..c17f02d
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/CopyMoveResult.cs
@@ -0,0 +1,171 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ /// Class for CopyMoveResult that contains the results for the Copy or Move action.
+ /// Normally there is no need to manually instantiate and/or populate this class.
+ [Serializable]
+ public sealed class CopyMoveResult
+ {
+ #region Private Fields
+
+ [NonSerialized] internal readonly Stopwatch Stopwatch;
+
+ #endregion // Private Fields
+
+
+ #region Constructors
+
+ /// Initializes a CopyMoveResult instance for the Copy or Move action.
+ /// Indicates the full path to the source file or directory.
+ /// Indicates the full path to the destination file or directory.
+ private CopyMoveResult(string source, string destination)
+ {
+ Source = source;
+
+ Destination = destination;
+
+ IsCopy = true;
+
+ Retries = 0;
+
+ Stopwatch = new Stopwatch();
+ }
+
+
+ internal CopyMoveResult(CopyMoveArguments cma, bool isFolder) : this(cma.SourcePath, cma.DestinationPath)
+ {
+ IsEmulatedMove = cma.EmulateMove;
+
+ IsCopy = cma.IsCopy;
+
+ IsDirectory = isFolder;
+
+ TimestampsCopied = cma.CopyTimestamps;
+ }
+
+
+ internal CopyMoveResult(CopyMoveArguments cma, bool isFolder, string source, string destination) : this(source, destination)
+ {
+ IsEmulatedMove = cma.EmulateMove;
+
+ IsCopy = cma.IsCopy;
+
+ IsDirectory = isFolder;
+
+ TimestampsCopied = cma.CopyTimestamps;
+ }
+
+ #endregion // Constructors
+
+
+ #region Properties
+
+ /// Indicates the duration of the Copy or Move action.
+ public TimeSpan Duration
+ {
+ get { return TimeSpan.FromMilliseconds(Stopwatch.Elapsed.TotalMilliseconds); }
+ }
+
+
+ /// Indicates the destination file or directory.
+ public string Destination { get; private set; }
+
+
+ /// The error code encountered during the Copy or Move action.
+ /// 0 (zero) indicates success.
+ public int ErrorCode { get; internal set; }
+
+
+ /// The error message from the that was encountered during the Copy or Move action.
+ /// A message describing the error.
+ [SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
+ public string ErrorMessage { get { return new Win32Exception(ErrorCode).Message; } }
+
+
+ /// When true indicates that the Copy or Move action was canceled.
+ /// true when the Copy/Move action was canceled. Otherwise false.
+ public bool IsCanceled { get; internal set; }
+
+
+ /// When true the action was a Copy, Move otherwise.
+ /// true when the action was a Copy. Otherwise a Move action was performed.
+ public bool IsCopy { get; private set; }
+
+
+ /// Gets a value indicating whether this instance represents a directory.
+ /// true if this instance represents a directory; otherwise, false.
+ public bool IsDirectory { get; private set; }
+
+
+ /// Indicates the Move action used a fallback of Copy + Delete actions.
+ public bool IsEmulatedMove { get; private set; }
+
+
+ /// Gets a value indicating whether this instance represents a file.
+ /// true if this instance represents a file; otherwise, false.
+ public bool IsFile { get { return !IsDirectory; } }
+
+
+ /// When true the action was a Move, Copy otherwise.
+ /// true when the action was a Move. Otherwise a Copy action was performed.
+ public bool IsMove { get { return !IsCopy; } }
+
+
+ /// The total number of retry attempts.
+ public long Retries { get; internal set; }
+
+
+ /// Indicates the source file or directory.
+ public string Source { get; private set; }
+
+
+ /// Indicates that the source date and timestamps have been applied to the destination file system objects.
+ public bool TimestampsCopied { get; private set; }
+
+
+ /// The total number of bytes copied.
+ public long TotalBytes { get; internal set; }
+
+
+ /// The total number of bytes copied, formatted as a unit size.
+ public string TotalBytesUnitSize
+ {
+ get { return Utils.UnitSizeToText(TotalBytes); }
+ }
+
+
+ /// The total number of files copied.
+ public long TotalFiles { get; internal set; }
+
+
+ /// The total number of folders copied.
+ public long TotalFolders { get; internal set; }
+
+ #endregion // Properties
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.Compress.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.Compress.cs
new file mode 100644
index 0000000..926b6d5
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.Compress.cs
@@ -0,0 +1,167 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to compress.
+ [SecurityCritical]
+ public static void Compress(string path)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, null, null, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to compress.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Compress(string path, PathFormat pathFormat)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, null, null, true, pathFormat);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to compress.
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static void Compress(string path, DirectoryEnumerationOptions options)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, options, null, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to compress.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Compress(string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, options, null, true, pathFormat);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to compress.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static void Compress(string path, DirectoryEnumerationFilters filters)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, null, filters, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to compress.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Compress(string path, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, null, filters, true, pathFormat);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to compress.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static void Compress(string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, options, filters, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to compress.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Compress(string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, options, filters, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.CompressTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.CompressTransacted.cs
new file mode 100644
index 0000000..b852a71
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.CompressTransacted.cs
@@ -0,0 +1,175 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to compress.
+ [SecurityCritical]
+ public static void CompressTransacted(KernelTransaction transaction, string path)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, null, null, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to compress.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CompressTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, null, null, true, pathFormat);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to compress.
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static void CompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, options, null, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to compress.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, options, null, true, pathFormat);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to compress.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static void CompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationFilters filters)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, null, filters, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to compress.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, null, filters, true, pathFormat);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to compress.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static void CompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, options, filters, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Compresses a directory using NTFS compression.
+ /// This will only compress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to compress.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, options, filters, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.Decompress.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.Decompress.cs
new file mode 100644
index 0000000..dc2682a
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.Decompress.cs
@@ -0,0 +1,165 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ /// This will only decompress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decompress.
+ [SecurityCritical]
+ public static void Decompress(string path)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, null, null, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ /// This will only decompress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decompress.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Decompress(string path, PathFormat pathFormat)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, null, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decompress.
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static void Decompress(string path, DirectoryEnumerationOptions options)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, options, null, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decompress.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Decompress(string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, options, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ /// This will only decompress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decompress.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static void Decompress(string path, DirectoryEnumerationFilters filters)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, null, filters, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ /// This will only decompress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decompress.
+ /// Indicates the format of the path parameter(s).
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static void Decompress(string path, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, null, filters, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decompress.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static void Decompress(string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, options, filters, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decompress.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Decompress(string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ CompressDecompressCore(null, path, Path.WildcardStarMatchAll, options, filters, false, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.DecompressTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.DecompressTransacted.cs
new file mode 100644
index 0000000..55251d6
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.DecompressTransacted.cs
@@ -0,0 +1,173 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ /// This will only decompress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to decompress.
+ [SecurityCritical]
+ public static void DecompressTransacted(KernelTransaction transaction, string path)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, null, null, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ /// This will only decompress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to decompress.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DecompressTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, null, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to decompress.
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static void DecompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, options, null, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to decompress.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DecompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, options, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ /// This will only decompress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to decompress.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static void DecompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationFilters filters)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, null, filters, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ /// This will only decompress the root items (non recursive).
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to decompress.
+ /// Indicates the format of the path parameter(s).
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static void DecompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, null, filters, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to decompress.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static void DecompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, options, filters, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Decompresses an NTFS compressed directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to decompress.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DecompressTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ CompressDecompressCore(transaction, path, Path.WildcardStarMatchAll, options, filters, false, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.DisableCompression.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.DisableCompression.cs
new file mode 100644
index 0000000..182b80b
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.DisableCompression.cs
@@ -0,0 +1,62 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Disables NTFS compression of the specified directory and the files in it.
+ /// This method disables the directory-compression attribute. It will not decompress the current contents of the directory. However, newly created files and directories will be uncompressed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path to a directory to decompress.
+ [SecurityCritical]
+ public static void DisableCompression(string path)
+ {
+ Device.ToggleCompressionCore(null, true, path, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Disables NTFS compression of the specified directory and the files in it.
+ /// This method disables the directory-compression attribute. It will not decompress the current contents of the directory. However, newly created files and directories will be uncompressed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path to a directory to decompress.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DisableCompression(string path, PathFormat pathFormat)
+ {
+ Device.ToggleCompressionCore(null, true, path, false, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.DisableCompressionTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.DisableCompressionTransacted.cs
new file mode 100644
index 0000000..be85b84
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.DisableCompressionTransacted.cs
@@ -0,0 +1,64 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Disables NTFS compression of the specified directory and the files in it.
+ /// This method disables the directory-compression attribute. It will not decompress the current contents of the directory. However, newly created files and directories will be uncompressed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path to a directory to decompress.
+ [SecurityCritical]
+ public static void DisableCompressionTransacted(KernelTransaction transaction, string path)
+ {
+ Device.ToggleCompressionCore(transaction, true, path, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Disables NTFS compression of the specified directory and the files in it.
+ /// This method disables the directory-compression attribute. It will not decompress the current contents of the directory. However, newly created files and directories will be uncompressed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// Indicates the format of the path parameter(s).
+ /// A path to a directory to decompress.
+ [SecurityCritical]
+ public static void DisableCompressionTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ Device.ToggleCompressionCore(transaction, true, path, false, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.EnableCompression.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.EnableCompression.cs
new file mode 100644
index 0000000..6b65bbd
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.EnableCompression.cs
@@ -0,0 +1,62 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Enables NTFS compression of the specified directory and the files in it.
+ /// This method enables the directory-compression attribute. It will not compress the current contents of the directory. However, newly created files and directories will be compressed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path to a directory to compress.
+ [SecurityCritical]
+ public static void EnableCompression(string path)
+ {
+ Device.ToggleCompressionCore(null, true, path, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Enables NTFS compression of the specified directory and the files in it.
+ /// This method enables the directory-compression attribute. It will not compress the current contents of the directory. However, newly created files and directories will be compressed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path to a directory to compress.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void EnableCompression(string path, PathFormat pathFormat)
+ {
+ Device.ToggleCompressionCore(null, true, path, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.EnableCompressionTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.EnableCompressionTransacted.cs
new file mode 100644
index 0000000..21b0715
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Compression/Directory.EnableCompressionTransacted.cs
@@ -0,0 +1,64 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Enables NTFS compression of the specified directory and the files in it.
+ /// This method enables the directory-compression attribute. It will not compress the current contents of the directory. However, newly created files and directories will be compressed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path to a directory to compress.
+ [SecurityCritical]
+ public static void EnableCompressionTransacted(KernelTransaction transaction, string path)
+ {
+ Device.ToggleCompressionCore(transaction, true, path, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Enables NTFS compression of the specified directory and the files in it.
+ /// This method enables the directory-compression attribute. It will not compress the current contents of the directory. However, newly created files and directories will be compressed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path to a directory to compress.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void EnableCompressionTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ Device.ToggleCompressionCore(transaction, true, path, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.Copy.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.Copy.cs
new file mode 100644
index 0000000..d9ad595
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.Copy.cs
@@ -0,0 +1,1070 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ // .NET: Directory class does not contain the Copy() method, so mimic .NET File.Copy() methods.
+
+
+ #region Obsolete
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, bool overwrite)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, bool overwrite, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, bool overwrite, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, bool overwrite, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// The specification of custom filters to be used in the process.
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, bool overwrite, DirectoryEnumerationFilters filters)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, bool overwrite, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, bool overwrite, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, bool overwrite, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, DirectoryEnumerationFilters filters)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+
+ #endregion // Obsolete
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, DirectoryEnumerationFilters filters)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ DirectoryEnumerationFilters = filters,
+ CopyOptions = CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ DirectoryEnumerationFilters = filters,
+ CopyOptions = CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, DirectoryEnumerationFilters filters)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult Copy(string sourcePath, string destinationPath, CopyOptions copyOptions, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.CopyFolderTimestamps.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.CopyFolderTimestamps.cs
new file mode 100644
index 0000000..6160ae8
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.CopyFolderTimestamps.cs
@@ -0,0 +1,47 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ private static void CopyFolderTimestamps(CopyMoveArguments cma)
+ {
+ // TODO 2018-01-09: Not 100% yet with local + UNC paths.
+ var dstLp = cma.SourcePathLp.ReplaceIgnoreCase(cma.SourcePathLp, cma.DestinationPathLp);
+
+
+ // Traverse the source folder, processing only folders.
+
+ foreach (var fseiSource in EnumerateFileSystemEntryInfosCore(true, cma.Transaction, cma.SourcePathLp, Path.WildcardStarMatchAll, null, null, cma.DirectoryEnumerationFilters, PathFormat.LongFullPath))
+
+ File.CopyTimestampsCore(cma.Transaction, true, fseiSource.LongFullPath, Path.CombineCore(false, dstLp, fseiSource.FileName), false, PathFormat.LongFullPath);
+
+
+ // Process the root directory, the given path.
+
+ File.CopyTimestampsCore(cma.Transaction, true, cma.SourcePathLp, cma.DestinationPathLp, false, PathFormat.LongFullPath);
+
+
+ // TODO: When enabled on Computer, FindFirstFile will change the last accessed time.
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.CopyTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.CopyTransacted.cs
new file mode 100644
index 0000000..09c67ff
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.CopyTransacted.cs
@@ -0,0 +1,1131 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region Obsolete
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, bool overwrite)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, bool overwrite, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, bool overwrite, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, bool overwrite, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// The specification of custom filters to be used in the process.
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, bool overwrite, DirectoryEnumerationFilters filters)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, bool overwrite, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, bool overwrite, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// true if the destination directory should ignoring the read-only and hidden attributes and overwrite; otherwise, false.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("To disable/enable overwrite, use other overload and use CopyOptions.None enum flag or remove CopyOptions.FailIfExists enum flag.")]
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, bool overwrite, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = overwrite ? CopyOptions.None : CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, DirectoryEnumerationFilters filters)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// true if original Timestamps must be preserved, false otherwise.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Use other overload and add CopyOptions.CopyTimestamp enum flag.")]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, bool preserveDates, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = preserveDates ? copyOptions | CopyOptions.CopyTimestamp : copyOptions & ~CopyOptions.CopyTimestamp,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+
+ #endregion // Obsolete
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, DirectoryEnumerationFilters filters)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = CopyOptions.FailIfExists,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ DirectoryEnumerationFilters = filters,
+ CopyOptions = CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Copies an existing directory to a new directory. Overwriting a directory of the same name is not allowed.
+ /// A class with details of the Copy action.
+ ///
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ DirectoryEnumerationFilters = filters,
+ CopyOptions = CopyOptions.FailIfExists,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult Copy(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, DirectoryEnumerationFilters filters)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ DirectoryEnumerationFilters = filters
+ });
+ }
+
+
+ /// [AlphaFS] Copies a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ /// A class with details of the Copy action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be copied. This parameter can be null.
+ /// The specification of custom filters to be used in the process.
+ /// A callback function that is called each time another portion of the directory has been copied. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult CopyTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, CopyOptions copyOptions, DirectoryEnumerationFilters filters, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ CopyOptions = copyOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ DirectoryEnumerationFilters = filters,
+ PathFormat = pathFormat
+ });
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.Move.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.Move.cs
new file mode 100644
index 0000000..b6c9ecb
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.Move.cs
@@ -0,0 +1,216 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Moves a file or a directory and its contents to a new location.
+ ///
+ /// This method does not work across disk volumes.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ [SecurityCritical]
+ public static void Move(string sourcePath, string destinationPath)
+ {
+ CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ MoveOptions = MoveOptions.None
+ });
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Moves a file or a directory and its contents to a new location.
+ ///
+ /// This method does not work across disk volumes.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ /// A class with details of the Move action.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult Move(string sourcePath, string destinationPath, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ MoveOptions = MoveOptions.None,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Moves a file or a directory and its contents to a new location, can be specified.
+ ///
+ /// This method does not work across disk volumes unless contains .
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ /// A class with details of the Move action.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be moved. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult Move(string sourcePath, string destinationPath, MoveOptions moveOptions)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ MoveOptions = moveOptions
+ });
+ }
+
+
+ /// [AlphaFS] Moves a file or a directory and its contents to a new location, can be specified.
+ ///
+ /// This method does not work across disk volumes unless contains .
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ /// A class with details of the Move action.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be moved. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult Move(string sourcePath, string destinationPath, MoveOptions moveOptions, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ MoveOptions = moveOptions,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Moves a file or a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ ///
+ ///
+ /// This method does not work across disk volumes unless contains .
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ /// A class with details of the Move action.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be moved. This parameter can be null.
+ /// A callback function that is called each time another portion of the directory has been moved. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult Move(string sourcePath, string destinationPath, MoveOptions moveOptions, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ MoveOptions = moveOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Moves a file or a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ ///
+ ///
+ /// This method does not work across disk volumes unless contains .
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ /// A class with details of the Move action.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be moved. This parameter can be null.
+ /// A callback function that is called each time another portion of the directory has been moved. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult Move(string sourcePath, string destinationPath, MoveOptions moveOptions, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ MoveOptions = moveOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.MoveTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.MoveTransacted.cs
new file mode 100644
index 0000000..3ff3c76
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.MoveTransacted.cs
@@ -0,0 +1,223 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Moves a file or a directory and its contents to a new location.
+ ///
+ /// This method does not work across disk volumes.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ /// A class with details of the Move action.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ [SecurityCritical]
+ public static CopyMoveResult MoveTransacted(KernelTransaction transaction, string sourcePath, string destinationPath)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath
+ });
+ }
+
+
+ /// [AlphaFS] Moves a file or a directory and its contents to a new location.
+ ///
+ /// This method does not work across disk volumes.
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ /// A class with details of the Move action.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult MoveTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Moves a file or a directory and its contents to a new location, can be specified.
+ ///
+ /// This method does not work across disk volumes unless contains .
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ /// A class with details of the Move action.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be moved. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult MoveTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, MoveOptions moveOptions)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ MoveOptions = moveOptions
+ });
+ }
+
+ /// [AlphaFS] Moves a file or a directory and its contents to a new location, can be specified.
+ ///
+ /// This method does not work across disk volumes unless contains .
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ /// A class with details of the Move action.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be moved. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult MoveTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, MoveOptions moveOptions, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ MoveOptions = moveOptions,
+ PathFormat = pathFormat
+ });
+ }
+
+
+ /// [AlphaFS] Moves a file or a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ ///
+ ///
+ /// This method does not work across disk volumes unless contains .
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ /// A class with details of the Move action.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be moved. This parameter can be null.
+ /// A callback function that is called each time another portion of the directory has been moved. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ [SecurityCritical]
+ public static CopyMoveResult MoveTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, MoveOptions moveOptions, CopyMoveProgressRoutine progressHandler, object userProgressData)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ MoveOptions = moveOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData
+ });
+ }
+
+
+ /// [AlphaFS] Moves a file or a directory and its contents to a new location, can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ ///
+ /// A class with the status of the Move action.
+ ///
+ /// This method does not work across disk volumes unless contains .
+ /// Whenever possible, avoid using short file names (such as XXXXXX~1.XXX) with this method.
+ /// If two directories have equivalent short file names then this method may fail and raise an exception and/or result in undesirable behavior.
+ ///
+ /// A class with details of the Move action.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory path.
+ /// The destination directory path.
+ /// that specify how the directory is to be moved. This parameter can be null.
+ /// A callback function that is called each time another portion of the directory has been moved. This parameter can be null.
+ /// The argument to be passed to the callback function. This parameter can be null.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static CopyMoveResult MoveTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, MoveOptions moveOptions, CopyMoveProgressRoutine progressHandler, object userProgressData, PathFormat pathFormat)
+ {
+ return CopyMoveCore(new CopyMoveArguments
+ {
+ Transaction = transaction,
+ SourcePath = sourcePath,
+ DestinationPath = destinationPath,
+ MoveOptions = moveOptions,
+ ProgressHandler = progressHandler,
+ UserProgressData = userProgressData,
+ PathFormat = pathFormat
+ });
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.ValidateMoveAction.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.ValidateMoveAction.cs
new file mode 100644
index 0000000..91acc89
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory CopyMove/Directory.ValidateMoveAction.cs
@@ -0,0 +1,95 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ [SecurityCritical]
+ internal static CopyMoveArguments ValidateMoveAction(CopyMoveArguments cma)
+ {
+ // Determine if a Move action or Copy action-fallback is possible.
+
+ cma.IsCopy = false;
+ cma.EmulateMove = false;
+
+
+ // Compare the root part of both paths.
+
+ var equalRootPaths = Path.GetPathRoot(cma.SourcePathLp, false).Equals(Path.GetPathRoot(cma.DestinationPathLp, false), StringComparison.OrdinalIgnoreCase);
+
+
+ // Method Volume.IsSameVolume() returns true when both paths refer to the same volume, even if one of the paths is a UNC path.
+ // For example, src = C:\TempSrc and dst = \\localhost\C$\TempDst
+
+ var isSameVolume = equalRootPaths || Volume.IsSameVolume(cma.SourcePathLp, cma.DestinationPathLp);
+
+ var isMove = isSameVolume && equalRootPaths;
+
+ if (!isMove)
+ {
+ // A Move() can be emulated by using Copy() and Delete(), but only if the MoveOptions.CopyAllowed flag is set.
+
+ isMove = File.HasCopyAllowed(cma.MoveOptions);
+
+
+ // MSDN: .NET3.5+: IOException: An attempt was made to move a directory to a different volume.
+
+ if (!isMove)
+ NativeError.ThrowException(Win32Errors.ERROR_NOT_SAME_DEVICE, cma.SourcePathLp, cma.DestinationPathLp);
+ }
+
+
+ // The MoveFileXxx methods fail when:
+ // - A directory is being moved;
+ // - One of the paths is a UNC path, even though both paths refer to the same volume.
+ // For example, src = C:\TempSrc and dst = \\localhost\C$\TempDst
+
+ if (isMove)
+ {
+ var srcIsUncPath = Path.IsUncPathCore(cma.SourcePathLp, false, false);
+ var dstIsUncPath = Path.IsUncPathCore(cma.DestinationPathLp, false, false);
+
+ isMove = srcIsUncPath == dstIsUncPath;
+ }
+
+
+ isMove = isMove && isSameVolume && equalRootPaths;
+
+
+ // Emulate Move().
+ if (!isMove)
+ {
+ cma.MoveOptions = null;
+
+ cma.IsCopy = true;
+ cma.EmulateMove = true;
+ cma.CopyOptions = CopyOptions.None;
+ }
+
+
+ return cma;
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CompressDecompressCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CompressDecompressCore.cs
new file mode 100644
index 0000000..9f84da6
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CompressDecompressCore.cs
@@ -0,0 +1,69 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Compress/decompress Non-/Transacted files/directories.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A path that describes a directory to compress.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// true compress, when false decompress.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static void CompressDecompressCore(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions? options, DirectoryEnumerationFilters filters, bool compress, PathFormat pathFormat)
+ {
+ var pathLp = Path.GetExtendedLengthPathCore(transaction, path, pathFormat, GetFullPathOptions.RemoveTrailingDirectorySeparator | GetFullPathOptions.FullCheck);
+
+ if (null == options)
+ options = DirectoryEnumerationOptions.None;
+
+
+ // Traverse the source folder, processing files and folders.
+
+ foreach (var fsei in EnumerateFileSystemEntryInfosCore(null, transaction, pathLp, searchPattern, null, options | DirectoryEnumerationOptions.AsLongPath, filters, PathFormat.LongFullPath))
+
+ Device.ToggleCompressionCore(transaction, fsei.IsDirectory, fsei.FullPath, compress, PathFormat.LongFullPath);
+
+
+ // Process the root directory, the given path.
+
+ Device.ToggleCompressionCore(transaction, true, pathLp, compress, PathFormat.LongFullPath);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CopyMoveCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CopyMoveCore.cs
new file mode 100644
index 0000000..62cd068
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CopyMoveCore.cs
@@ -0,0 +1,145 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Copy/move a Non-/Transacted file or directory including its children to a new location, or can be specified,
+ /// and the possibility of notifying the application of its progress through a callback function.
+ ///
+ /// A class with the status of the Copy or Move action.
+ ///
+ /// Option is recommended for very large file transfers.
+ /// You cannot use the Move method to overwrite an existing file, unless contains .
+ /// Note that if you attempt to replace a file by moving a file of the same name into that directory, you get an IOException.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The operating system is older than Windows Vista.
+ [SecurityCritical]
+ internal static CopyMoveResult CopyMoveCore(CopyMoveArguments cma)
+ {
+ #region Setup
+
+ var fsei = File.GetFileSystemEntryInfoCore(cma.Transaction, false, cma.SourcePath, true, cma.PathFormat);
+
+ var isFolder = null == fsei || fsei.IsDirectory;
+
+ // Directory.Move is applicable to both files and folders.
+
+ cma = File.ValidateFileOrDirectoryMoveArguments(cma, false, isFolder);
+
+
+ var copyMoveResult = new CopyMoveResult(cma, isFolder);
+
+ var errorFilter = null != cma.DirectoryEnumerationFilters && null != cma.DirectoryEnumerationFilters.ErrorFilter ? cma.DirectoryEnumerationFilters.ErrorFilter : null;
+
+ var retry = null != errorFilter && (cma.DirectoryEnumerationFilters.ErrorRetry > 0 || cma.DirectoryEnumerationFilters.ErrorRetryTimeout > 0);
+
+ if (retry)
+ {
+ if (cma.DirectoryEnumerationFilters.ErrorRetry <= 0)
+ cma.DirectoryEnumerationFilters.ErrorRetry = 2;
+
+ if (cma.DirectoryEnumerationFilters.ErrorRetryTimeout <= 0)
+ cma.DirectoryEnumerationFilters.ErrorRetryTimeout = 10;
+ }
+
+
+ // Calling start on a running Stopwatch is a no-op.
+ copyMoveResult.Stopwatch.Start();
+
+ #endregion // Setup
+
+
+ if (cma.IsCopy)
+ {
+ // Copy folder SymbolicLinks.
+ // Cannot be done by CopyFileEx() so emulate this.
+
+ if (File.HasCopySymbolicLink(cma.CopyOptions))
+ {
+ var lvi = File.GetLinkTargetInfoCore(cma.Transaction, cma.SourcePathLp, true, PathFormat.LongFullPath);
+
+ if (null != lvi)
+ {
+ File.CreateSymbolicLinkCore(cma.Transaction, cma.DestinationPathLp, lvi.SubstituteName, SymbolicLinkTarget.Directory, PathFormat.LongFullPath);
+
+ copyMoveResult.TotalFolders = 1;
+ }
+ }
+
+ else
+ {
+ if (isFolder)
+ CopyMoveDirectoryCore(retry, cma, copyMoveResult);
+
+ else
+ File.CopyMoveCore(retry, cma, true, false, cma.SourcePathLp, cma.DestinationPathLp, copyMoveResult);
+ }
+ }
+
+
+ // Move
+
+ else
+ {
+ // AlphaFS feature to overcome a MoveFileXxx limitation.
+ // MoveOptions.ReplaceExisting: This value cannot be used if lpNewFileName or lpExistingFileName names a directory.
+
+ if (isFolder && !cma.DelayUntilReboot && File.HasReplaceExisting(cma.MoveOptions))
+
+ DeleteDirectoryCore(cma.Transaction, null, cma.DestinationPathLp, true, true, true, PathFormat.LongFullPath);
+
+
+ // 2017-06-07: A large target directory will probably create a progress-less delay in UI.
+ // One way to get around this is to perform the delete in the File.CopyMove method.
+
+
+ // Moves a file or directory, including its children.
+ // Copies an existing directory, including its children to a new directory.
+
+ File.CopyMoveCore(retry, cma, true, isFolder, cma.SourcePathLp, cma.DestinationPathLp, copyMoveResult);
+
+
+ // If the move happened on the same drive, we have no knowledge of the number of files/folders.
+ // However, we do know that the one folder was moved successfully.
+
+ if (copyMoveResult.ErrorCode == Win32Errors.NO_ERROR && isFolder)
+ copyMoveResult.TotalFolders = 1;
+ }
+
+
+ copyMoveResult.Stopwatch.Stop();
+
+ return copyMoveResult;
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CopyMoveDirectoryCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CopyMoveDirectoryCore.cs
new file mode 100644
index 0000000..f1d2e25
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CopyMoveDirectoryCore.cs
@@ -0,0 +1,102 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ [SecurityCritical]
+ internal static void CopyMoveDirectoryCore(bool retry, CopyMoveArguments cma, CopyMoveResult copyMoveResult)
+ {
+ var dirs = new Queue(NativeMethods.DefaultFileBufferSize);
+
+ dirs.Enqueue(cma.SourcePathLp);
+
+
+ while (dirs.Count > 0)
+ {
+ var srcLp = dirs.Dequeue();
+
+ // TODO 2018-01-09: Not 100% yet with local + UNC paths.
+ var dstLp = srcLp.ReplaceIgnoreCase(cma.SourcePathLp, cma.DestinationPathLp);
+
+
+ // Traverse the source folder, processing files and folders.
+ // No recursion is applied; a Queue is used instead.
+
+ foreach (var fseiSource in EnumerateFileSystemEntryInfosCore(null, cma.Transaction, srcLp, Path.WildcardStarMatchAll, null, null, cma.DirectoryEnumerationFilters, PathFormat.LongFullPath))
+ {
+ var fseiSourcePath = fseiSource.LongFullPath;
+
+ var fseiDestinationPath = Path.CombineCore(false, dstLp, fseiSource.FileName);
+
+ if (fseiSource.IsDirectory)
+ {
+ CreateDirectoryCore(true, cma.Transaction, fseiDestinationPath, null, null, false, PathFormat.LongFullPath);
+
+ copyMoveResult.TotalFolders++;
+
+ dirs.Enqueue(fseiSourcePath);
+ }
+
+ else
+ {
+ // File count is done in File.CopyMoveCore method.
+
+ File.CopyMoveCore(retry, cma, true, false, fseiSourcePath, fseiDestinationPath, copyMoveResult);
+
+ if (copyMoveResult.IsCanceled)
+ {
+ // Break while loop.
+ dirs.Clear();
+
+ // Break foreach loop.
+ break;
+ }
+
+
+ if (copyMoveResult.ErrorCode == Win32Errors.NO_ERROR)
+ {
+ copyMoveResult.TotalBytes += fseiSource.FileSize;
+
+ if (cma.EmulateMove)
+ File.DeleteFileCore(cma.Transaction, fseiSourcePath, true, fseiSource.Attributes, PathFormat.LongFullPath);
+ }
+ }
+ }
+ }
+
+
+ if (!copyMoveResult.IsCanceled && copyMoveResult.ErrorCode == Win32Errors.NO_ERROR)
+ {
+ if (cma.CopyTimestamps)
+ CopyFolderTimestamps(cma);
+
+ if (cma.EmulateMove)
+ DeleteDirectoryCore(cma.Transaction, null, cma.SourcePathLp, true, true, true, PathFormat.LongFullPath);
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CreateDirectoryCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CreateDirectoryCore.cs
new file mode 100644
index 0000000..9259e6b
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CreateDirectoryCore.cs
@@ -0,0 +1,206 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Security.AccessControl;
+using winPEAS._3rdParty.AlphaFS;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Creates a new directory with the attributes of a specified template directory (if one is specified).
+ /// If the underlying file system supports security on files and directories, the function applies the specified security descriptor to the new directory.
+ /// The new directory retains the other attributes of the specified template directory.
+ ///
+ ///
+ /// Returns an object that represents the directory at the specified path.
+ /// This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// When true returns null instead of a instance.
+ /// The transaction.
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory. May be null to indicate that no template should be used.
+ /// The access control to apply to the directory, may be null.
+ /// When true compresses the directory using NTFS compression.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static DirectoryInfo CreateDirectoryCore(bool returnNull, KernelTransaction transaction, string path, string templatePath, ObjectSecurity directorySecurity, bool compress, PathFormat pathFormat)
+ {
+ var longPath = path;
+
+ if (pathFormat != PathFormat.LongFullPath)
+ {
+ if (null == path)
+ throw new ArgumentNullException("path");
+
+
+ Path.CheckSupportedPathFormat(path, true, true);
+ Path.CheckSupportedPathFormat(templatePath, true, true);
+
+ longPath = Path.GetExtendedLengthPathCore(transaction, path, pathFormat, GetFullPathOptions.TrimEnd | GetFullPathOptions.RemoveTrailingDirectorySeparator);
+
+ pathFormat = PathFormat.LongFullPath;
+ }
+
+
+ if (!char.IsWhiteSpace(longPath[longPath.Length - 1]))
+ {
+ // Return DirectoryInfo instance if the directory specified by path already exists.
+
+ if (File.ExistsCore(transaction, true, longPath, PathFormat.LongFullPath))
+
+ // We are not always interested in a new DirectoryInfo instance.
+ return returnNull ? null : new DirectoryInfo(transaction, longPath, PathFormat.LongFullPath);
+ }
+
+
+ // MSDN: .NET 3.5+: IOException: The directory specified by path is a file or the network name was not found.
+ if (File.ExistsCore(transaction, false, longPath, PathFormat.LongFullPath))
+ NativeError.ThrowException(Win32Errors.ERROR_ALREADY_EXISTS, longPath);
+
+
+ var templatePathLp = Utils.IsNullOrWhiteSpace(templatePath)
+ ? null
+ : Path.GetExtendedLengthPathCore(transaction, templatePath, pathFormat, GetFullPathOptions.TrimEnd | GetFullPathOptions.RemoveTrailingDirectorySeparator);
+
+
+ var list = ConstructFullPath(transaction, longPath);
+
+ // Directory security.
+ using (var securityAttributes = new Security.NativeMethods.SecurityAttributes(directorySecurity))
+ {
+ // Create the directory paths.
+ while (list.Count > 0)
+ {
+ var folderLp = list.Pop();
+
+ // CreateDirectory() / CreateDirectoryEx()
+ // 2013-01-13: MSDN confirms LongPath usage.
+
+ if (!(transaction == null || !NativeMethods.IsAtLeastWindowsVista
+
+ ? (templatePathLp == null
+
+ ? NativeMethods.CreateDirectory(folderLp, securityAttributes)
+
+ : NativeMethods.CreateDirectoryEx(templatePathLp, folderLp, securityAttributes))
+
+ : NativeMethods.CreateDirectoryTransacted(templatePathLp, folderLp, securityAttributes, transaction.SafeHandle)))
+ {
+ var lastError = Marshal.GetLastWin32Error();
+
+ switch ((uint) lastError)
+ {
+ // MSDN: .NET 3.5+: If the directory already exists, this method does nothing.
+ // MSDN: .NET 3.5+: IOException: The directory specified by path is a file.
+ case Win32Errors.ERROR_ALREADY_EXISTS:
+ if (File.ExistsCore(transaction, false, longPath, PathFormat.LongFullPath))
+ NativeError.ThrowException(lastError, longPath);
+
+ if (File.ExistsCore(transaction, false, folderLp, PathFormat.LongFullPath))
+ NativeError.ThrowException(Win32Errors.ERROR_PATH_NOT_FOUND, null, folderLp);
+ break;
+
+
+ case Win32Errors.ERROR_BAD_NET_NAME:
+ NativeError.ThrowException(Win32Errors.ERROR_BAD_NET_NAME, longPath);
+ break;
+
+
+ case Win32Errors.ERROR_DIRECTORY:
+ // MSDN: .NET 3.5+: NotSupportedException: path contains a colon character (:) that is not part of a drive label ("C:\").
+ throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, Resources.Unsupported_Path_Format, longPath));
+
+
+ case Win32Errors.ERROR_ACCESS_DENIED:
+ // Report the parent folder, the inaccessible folder.
+ var parent = GetParent(folderLp);
+
+ NativeError.ThrowException(lastError, null != parent ? parent.FullName : folderLp);
+ break;
+
+
+ default:
+ NativeError.ThrowException(lastError, true, folderLp);
+ break;
+ }
+ }
+
+ else if (compress)
+ Device.ToggleCompressionCore(transaction, true, folderLp, true, PathFormat.LongFullPath);
+ }
+
+
+ // We are not always interested in a new DirectoryInfo instance.
+
+ return returnNull ? null : new DirectoryInfo(transaction, longPath, PathFormat.LongFullPath);
+ }
+ }
+
+
+ private static Stack ConstructFullPath(KernelTransaction transaction, string path)
+ {
+ var longPathPrefix = Path.IsUncPathCore(path, false, false) ? Path.LongPathUncPrefix : Path.LongPathPrefix;
+ path = Path.GetRegularPathCore(path, GetFullPathOptions.None, false);
+
+ var length = path.Length;
+ if (length >= 2 && Path.IsDVsc(path[length - 1], false))
+ --length;
+
+ var rootLength = Path.GetRootLength(path, false);
+ if (length == 2 && Path.IsDVsc(path[1], false))
+ throw new ArgumentException(Resources.Cannot_Create_Directory, "path");
+
+
+ // Check if directories are missing.
+ var list = new Stack(100);
+
+ if (length > rootLength)
+ {
+ for (var index = length - 1; index >= rootLength; --index)
+ {
+ var path1 = path.Substring(0, index + 1);
+ var path2 = longPathPrefix + path1.TrimStart('\\');
+
+ if (!File.ExistsCore(transaction, true, path2, PathFormat.LongFullPath))
+ list.Push(path2);
+
+ while (index > rootLength && !Path.IsDVsc(path[index], false))
+ --index;
+ }
+ }
+
+ return list;
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CreateJunctionCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CreateJunctionCore.cs
new file mode 100644
index 0000000..8208d86
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.CreateJunctionCore.cs
@@ -0,0 +1,131 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Globalization;
+using System.IO;
+using System.Security;
+using System.Security.AccessControl;
+using Microsoft.Win32.SafeHandles;
+using winPEAS._3rdParty.AlphaFS;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ /// Returns the long path to the directory junction.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ /// The directory date and time stamps from (the target) are copied to the directory junction.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ /// true to copy the target date and time stamps to the directory junction.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static string CreateJunctionCore(KernelTransaction transaction, string junctionPath, string directoryPath, bool overwrite, bool copyTargetTimestamps, PathFormat pathFormat)
+ {
+ if (pathFormat != PathFormat.LongFullPath)
+ {
+ Path.CheckSupportedPathFormat(directoryPath, true, true);
+ Path.CheckSupportedPathFormat(junctionPath, true, true);
+
+ directoryPath = Path.GetExtendedLengthPathCore(transaction, directoryPath, pathFormat, GetFullPathOptions.RemoveTrailingDirectorySeparator);
+ junctionPath = Path.GetExtendedLengthPathCore(transaction, junctionPath, pathFormat, GetFullPathOptions.RemoveTrailingDirectorySeparator);
+
+ pathFormat = PathFormat.LongFullPath;
+ }
+
+
+ // Directory Junction logic.
+
+
+ // Check if drive letter is a mapped network drive.
+ if (new DriveInfo(directoryPath).IsUnc)
+ throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Resources.Network_Path_Not_Allowed, directoryPath), "directoryPath");
+
+ if (new DriveInfo(junctionPath).IsUnc)
+ throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Resources.Network_Path_Not_Allowed, junctionPath), "junctionPath");
+
+
+ // Check for existing file.
+ File.ThrowIOExceptionIfFsoExist(transaction, false, directoryPath, pathFormat);
+ File.ThrowIOExceptionIfFsoExist(transaction, false, junctionPath, pathFormat);
+
+
+ // Check for existing directory junction folder.
+ if (File.ExistsCore(transaction, true, junctionPath, pathFormat))
+ {
+ if (overwrite)
+ {
+ DeleteDirectoryCore(transaction, null, junctionPath, true, true, true, pathFormat);
+
+ CreateDirectoryCore(true, transaction, junctionPath, null, null, false, pathFormat);
+ }
+
+ else
+ {
+ // Ensure the folder is empty.
+ if (!IsEmptyCore(transaction, junctionPath, pathFormat))
+ throw new DirectoryNotEmptyException(junctionPath, true);
+
+ throw new AlreadyExistsException(junctionPath, true);
+ }
+ }
+
+
+ // Create the folder and convert it to a directory junction.
+ CreateDirectoryCore(true, transaction, junctionPath, null, null, false, pathFormat);
+
+ using (var safeHandle = OpenDirectoryJunction(transaction, junctionPath, pathFormat))
+ Device.CreateDirectoryJunction(safeHandle, directoryPath);
+
+
+ // Copy the target date and time stamps to the directory junction.
+ if (copyTargetTimestamps)
+ File.CopyTimestampsCore(transaction, true, directoryPath, junctionPath, true, pathFormat);
+
+
+ return junctionPath;
+ }
+
+
+ private static SafeFileHandle OpenDirectoryJunction(KernelTransaction transaction, string junctionPath, PathFormat pathFormat)
+ {
+ return File.CreateFileCore(transaction, true, junctionPath, ExtendedFileAttributes.BackupSemantics | ExtendedFileAttributes.OpenReparsePoint, null, FileMode.Open, FileSystemRights.WriteData, FileShare.ReadWrite, false, false, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteDirectoryCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteDirectoryCore.cs
new file mode 100644
index 0000000..626f5d8
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteDirectoryCore.cs
@@ -0,0 +1,113 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Security;
+using System.Security.AccessControl;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Deletes the specified directory and, if indicated, any subdirectories in the directory.
+ /// The RemoveDirectory function marks a directory for deletion on close. Therefore, the directory is not removed until the last handle to the directory is closed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A FileSystemEntryInfo instance. Use either or , not both.
+ /// The name of the directory to remove. Use either or , not both.
+ /// true to remove all files and subdirectories recursively; false otherwise only the top level empty directory.
+ /// true overrides read only attribute of files and directories.
+ /// When true does not throw an when the directory does not exist.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static void DeleteDirectoryCore(KernelTransaction transaction, FileSystemEntryInfo fsEntryInfo, string path, bool recursive, bool ignoreReadOnly, bool continueOnNotFound, PathFormat pathFormat)
+ {
+ if (null == fsEntryInfo)
+ {
+ if (null == path)
+ throw new ArgumentNullException("path");
+
+ fsEntryInfo = File.GetFileSystemEntryInfoCore(transaction, true, Path.GetExtendedLengthPathCore(transaction, path, pathFormat, GetFullPathOptions.RemoveTrailingDirectorySeparator), continueOnNotFound, pathFormat);
+
+ if (null == fsEntryInfo)
+ return;
+ }
+
+
+ PrepareDirectoryForDelete(transaction, fsEntryInfo, ignoreReadOnly);
+
+
+ // Do not follow mount points nor symbolic links, but do delete the reparse point itself.
+ // If directory is reparse point, disable recursion.
+
+ if (recursive && !fsEntryInfo.IsReparsePoint)
+ {
+ // The stack will contain the entire folder structure to prevent any open directory handles because of enumeration.
+ // The root folder is at the bottom of the stack.
+
+ var dirs = new Stack(NativeMethods.DefaultFileBufferSize);
+
+ foreach (var fsei in EnumerateFileSystemEntryInfosCore(null, transaction, fsEntryInfo.LongFullPath, Path.WildcardStarMatchAll, null, DirectoryEnumerationOptions.Recursive, null, PathFormat.LongFullPath))
+ {
+ PrepareDirectoryForDelete(transaction, fsei, ignoreReadOnly);
+
+ if (fsei.IsDirectory)
+ dirs.Push(fsei.LongFullPath);
+
+ else
+ File.DeleteFileCore(transaction, fsei.LongFullPath, ignoreReadOnly, fsei.Attributes, PathFormat.LongFullPath);
+ }
+
+
+ while (dirs.Count > 0)
+ DeleteDirectoryNative(transaction, dirs.Pop(), ignoreReadOnly, continueOnNotFound, 0);
+ }
+
+
+ DeleteDirectoryNative(transaction, fsEntryInfo.LongFullPath, ignoreReadOnly, continueOnNotFound, fsEntryInfo.Attributes);
+ }
+
+
+ internal static void PrepareDirectoryForDelete(KernelTransaction transaction, FileSystemEntryInfo fsei, bool ignoreReadOnly)
+ {
+ // Check to see if the folder is a mount point and unmount it. Only then is it safe to delete the actual folder.
+
+ if (fsei.IsMountPoint)
+
+ DeleteJunctionCore(transaction, fsei, null, false, PathFormat.LongFullPath);
+
+
+ // Reset attributes to Normal if we already know the facts.
+
+ if (ignoreReadOnly && (fsei.IsReadOnly || fsei.IsHidden))
+
+ File.SetAttributesCore(transaction, fsei.IsDirectory, fsei.LongFullPath, FileAttributes.Normal, PathFormat.LongFullPath);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteDirectoryNative.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteDirectoryNative.cs
new file mode 100644
index 0000000..cf8901e
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteDirectoryNative.cs
@@ -0,0 +1,128 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Diagnostics.CodeAnalysis;
+using System.Globalization;
+using System.IO;
+using System.Runtime.InteropServices;
+using winPEAS._3rdParty.AlphaFS;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
+ private static void DeleteDirectoryNative(KernelTransaction transaction, string pathLp, bool ignoreReadOnly, bool continueOnNotFound, FileAttributes attributes)
+ {
+
+ startRemoveDirectory:
+
+ var success = null == transaction || !NativeMethods.IsAtLeastWindowsVista
+
+ // RemoveDirectory() / RemoveDirectoryTransacted()
+ // 2014-09-09: MSDN confirms LongPath usage.
+
+ // RemoveDirectory on a symbolic link will remove the link itself.
+
+ ? NativeMethods.RemoveDirectory(pathLp)
+
+ : NativeMethods.RemoveDirectoryTransacted(pathLp, transaction.SafeHandle);
+
+
+ var lastError = Marshal.GetLastWin32Error();
+
+ if (!success)
+ {
+ switch ((uint) lastError)
+ {
+ case Win32Errors.ERROR_DIR_NOT_EMPTY:
+ // MSDN: .NET 3.5+: IOException: The directory specified by path is not an empty directory.
+ throw new DirectoryNotEmptyException(pathLp, true);
+
+
+ case Win32Errors.ERROR_DIRECTORY:
+ // MSDN: .NET 3.5+: DirectoryNotFoundException: Path refers to a file instead of a directory.
+ if (File.ExistsCore(transaction, false, pathLp, PathFormat.LongFullPath))
+ throw new DirectoryNotFoundException(string.Format(CultureInfo.InvariantCulture, "({0}) {1}", lastError, string.Format(CultureInfo.InvariantCulture, Resources.Target_Directory_Is_A_File, pathLp)));
+ break;
+
+
+ case Win32Errors.ERROR_PATH_NOT_FOUND:
+ if (continueOnNotFound)
+ return;
+ break;
+
+
+ case Win32Errors.ERROR_SHARING_VIOLATION:
+ // MSDN: .NET 3.5+: IOException: The directory is being used by another process or there is an open handle on the directory.
+ NativeError.ThrowException(lastError, pathLp);
+ break;
+
+
+ case Win32Errors.ERROR_ACCESS_DENIED:
+
+ if (attributes == 0)
+ {
+ var attrs = new NativeMethods.WIN32_FILE_ATTRIBUTE_DATA();
+
+ if (File.FillAttributeInfoCore(transaction, pathLp, ref attrs, false, true) == Win32Errors.NO_ERROR)
+
+ attributes = attrs.dwFileAttributes;
+ }
+
+
+ if (File.IsReadOnlyOrHidden(attributes))
+ {
+ // MSDN: .NET 3.5+: IOException: The directory specified by path is read-only.
+
+ if (ignoreReadOnly)
+ {
+ // Reset attributes to Normal.
+ File.SetAttributesCore(transaction, true, pathLp, FileAttributes.Normal, PathFormat.LongFullPath);
+
+ goto startRemoveDirectory;
+ }
+
+
+ // MSDN: .NET 3.5+: IOException: The directory is read-only.
+ throw new DirectoryReadOnlyException(pathLp);
+ }
+
+
+ // MSDN: .NET 3.5+: UnauthorizedAccessException: The caller does not have the required permission.
+ if (attributes == 0)
+ NativeError.ThrowException(lastError, File.IsDirectory(attributes), pathLp);
+
+ break;
+ }
+
+ // MSDN: .NET 3.5+: IOException:
+ // A file with the same name and location specified by path exists.
+ // The directory specified by path is read-only, or recursive is false and path is not an empty directory.
+ // The directory is the application's current working directory.
+ // The directory contains a read-only file.
+ // The directory is being used by another process.
+
+ NativeError.ThrowException(lastError, pathLp);
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteEmptySubdirectoriesCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteEmptySubdirectoriesCore.cs
new file mode 100644
index 0000000..5ff8da6
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteEmptySubdirectoriesCore.cs
@@ -0,0 +1,91 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Security;
+using winPEAS._3rdParty.AlphaFS;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Delete empty subdirectories from the specified directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A FileSystemEntryInfo instance. Use either or , not both.
+ /// The transaction.
+ /// The name of the directory to remove empty subdirectories from. Use either or , not both.
+ /// true deletes empty subdirectories from this directory and its subdirectories.
+ /// true overrides read only of empty directories.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static void DeleteEmptySubdirectoriesCore(FileSystemEntryInfo fsEntryInfo, KernelTransaction transaction, string path, bool recursive, bool ignoreReadOnly, PathFormat pathFormat)
+ {
+ #region Setup
+
+ if (null == fsEntryInfo)
+ {
+ if (pathFormat == PathFormat.RelativePath)
+ Path.CheckSupportedPathFormat(path, true, true);
+
+ if (!File.ExistsCore(transaction, true, path, pathFormat))
+ NativeError.ThrowException(Win32Errors.ERROR_PATH_NOT_FOUND, path);
+
+ fsEntryInfo = File.GetFileSystemEntryInfoCore(transaction, true, Path.GetExtendedLengthPathCore(transaction, path, pathFormat, GetFullPathOptions.TrimEnd | GetFullPathOptions.RemoveTrailingDirectorySeparator | GetFullPathOptions.FullCheck), false, pathFormat);
+
+ if (null == fsEntryInfo)
+ return;
+ }
+
+ #endregion // Setup
+
+
+ // Ensure path is a directory.
+ if (!fsEntryInfo.IsDirectory)
+ throw new IOException(string.Format(CultureInfo.InvariantCulture, Resources.Target_Directory_Is_A_File, fsEntryInfo.LongFullPath));
+
+
+ var dirs = new Stack(1000);
+ dirs.Push(fsEntryInfo.LongFullPath);
+
+ while (dirs.Count > 0)
+ {
+ foreach (var fsei in EnumerateFileSystemEntryInfosCore(true, transaction, dirs.Pop(), Path.WildcardStarMatchAll, null, DirectoryEnumerationOptions.ContinueOnException, null, PathFormat.LongFullPath))
+ {
+ // Ensure the directory is empty.
+ if (IsEmptyCore(transaction, fsei.LongFullPath, pathFormat))
+ DeleteDirectoryCore(transaction, fsei, null, false, ignoreReadOnly, true, PathFormat.LongFullPath);
+
+ else if (recursive)
+ dirs.Push(fsei.LongFullPath);
+ }
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteJunctionCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteJunctionCore.cs
new file mode 100644
index 0000000..54636d6
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.DeleteJunctionCore.cs
@@ -0,0 +1,86 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Globalization;
+using System.IO;
+using System.Security;
+using winPEAS._3rdParty.AlphaFS;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Deletes an NTFS directory junction.
+ /// Only the directory junction is removed, not the target.
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A FileSystemEntryInfo instance. Use either or , not both.
+ /// The path of the junction point to remove.
+ /// When true, also removes the directory and all its contents.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static void DeleteJunctionCore(KernelTransaction transaction, FileSystemEntryInfo fsEntryInfo, string junctionPath, bool removeDirectory, PathFormat pathFormat)
+ {
+ if (null == fsEntryInfo)
+ {
+ if (pathFormat != PathFormat.LongFullPath)
+ {
+ Path.CheckSupportedPathFormat(junctionPath, true, true);
+
+ junctionPath = Path.GetExtendedLengthPathCore(transaction, junctionPath, pathFormat, GetFullPathOptions.CheckInvalidPathChars | GetFullPathOptions.RemoveTrailingDirectorySeparator);
+
+ pathFormat = PathFormat.LongFullPath;
+ }
+
+
+ fsEntryInfo = File.GetFileSystemEntryInfoCore(transaction, true, junctionPath, false, pathFormat);
+
+ if (!fsEntryInfo.IsMountPoint)
+ throw new NotAReparsePointException(string.Format(CultureInfo.InvariantCulture, Resources.Directory_Is_Not_A_MountPoint, fsEntryInfo.LongFullPath), (int) Win32Errors.ERROR_NOT_A_REPARSE_POINT);
+ }
+
+
+ pathFormat = PathFormat.LongFullPath;
+
+
+ // Remove the directory junction.
+
+ using (var safeHandle = OpenDirectoryJunction(transaction, fsEntryInfo.LongFullPath, pathFormat))
+
+ Device.DeleteDirectoryJunction(safeHandle);
+
+
+ // Optionally the folder itself, which should and must be empty.
+
+ if (removeDirectory)
+
+ DeleteDirectoryCore(transaction, fsEntryInfo, null, false, false, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EnableDisableEncryptionCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EnableDisableEncryptionCore.cs
new file mode 100644
index 0000000..ad4bfbe
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EnableDisableEncryptionCore.cs
@@ -0,0 +1,63 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Enables/disables encryption of the specified directory and the files in it.
+ /// This method only creates/modifies the file "Desktop.ini" in the root of and enables/disables encryption by writing: "Disable=0" or "Disable=1".
+ /// This method does not affect encryption of files and subdirectories below the indicated directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory for which to enable encryption.
+ /// true enabled encryption, false disables encryption.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static void EnableDisableEncryptionCore(string path, bool enable, PathFormat pathFormat)
+ {
+ if (Utils.IsNullOrWhiteSpace(path))
+ throw new ArgumentNullException("path");
+
+ var pathLp = Path.GetExtendedLengthPathCore(null, path, pathFormat, GetFullPathOptions.RemoveTrailingDirectorySeparator | GetFullPathOptions.FullCheck);
+
+ // EncryptionDisable()
+ // 2013-01-13: MSDN does not confirm LongPath usage and no Unicode version of this function exists.
+
+ var success = NativeMethods.EncryptionDisable(pathLp, !enable);
+
+ var lastError = Marshal.GetLastWin32Error();
+ if (!success)
+ NativeError.ThrowException(lastError, true, pathLp);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EncryptDecryptDirectoryCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EncryptDecryptDirectoryCore.cs
new file mode 100644
index 0000000..a097b78
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EncryptDecryptDirectoryCore.cs
@@ -0,0 +1,67 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Decrypts/encrypts a directory recursively so that only the account used to encrypt the directory can decrypt it.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to encrypt.
+ /// true encrypt, false decrypt.
+ /// true to decrypt the directory recursively. false only decrypt files and directories in the root of .
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static void EncryptDecryptDirectoryCore(string path, bool encrypt, bool recursive, PathFormat pathFormat)
+ {
+ if (pathFormat != PathFormat.LongFullPath)
+ {
+ path = Path.GetExtendedLengthPathCore(null, path, pathFormat, GetFullPathOptions.RemoveTrailingDirectorySeparator | GetFullPathOptions.FullCheck);
+
+ pathFormat = PathFormat.LongFullPath;
+ }
+
+
+ // Process folders and files when recursive.
+
+ if (recursive)
+ {
+ foreach (var fsei in EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, SearchOption.AllDirectories, DirectoryEnumerationOptions.AsLongPath, null, pathFormat))
+
+ File.EncryptDecryptFileCore(true, fsei, encrypt, pathFormat);
+ }
+
+ // Process the root folder, the given path.
+
+ File.EncryptDecryptFileCore(true, path, encrypt, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EnumerateFileIdBothDirectoryInfoCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EnumerateFileIdBothDirectoryInfoCore.cs
new file mode 100644
index 0000000..8da0710
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EnumerateFileIdBothDirectoryInfoCore.cs
@@ -0,0 +1,141 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using Microsoft.Win32.SafeHandles;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Security.AccessControl;
+using System.Text;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Returns an enumerable collection of information about files in the directory handle specified.
+ /// An IEnumerable of records for each file system entry in the specified diretory.
+ /// The operating system is older than Windows Vista.
+ ///
+ /// Either use or , not both.
+ ///
+ /// The number of files that are returned for each call to GetFileInformationByHandleEx depends on the size of the buffer that is passed to the function.
+ /// Any subsequent calls to GetFileInformationByHandleEx on the same handle will resume the enumeration operation after the last file is returned.
+ ///
+ ///
+ /// The operating system is older than Windows Vista.
+ /// The transaction.
+ /// An open handle to the directory from which to retrieve information.
+ /// A path to the directory.
+ /// The mode with which to open a handle to the directory.
+ /// true suppress any Exception that might be thrown as a result from a failure, such as ACLs protected directories or non-accessible reparse points.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static IEnumerable EnumerateFileIdBothDirectoryInfoCore(KernelTransaction transaction, SafeFileHandle safeFileHandle, string path, FileShare shareMode, bool continueOnException, PathFormat pathFormat)
+ {
+ if (!NativeMethods.IsAtLeastWindowsVista)
+ throw new PlatformNotSupportedException(new Win32Exception((int) Win32Errors.ERROR_OLD_WIN_VERSION).Message);
+
+
+ var pathLp = path;
+
+ var callerHandle = null != safeFileHandle;
+ if (!callerHandle)
+ {
+ if (Utils.IsNullOrWhiteSpace(path))
+ throw new ArgumentNullException("path");
+
+ pathLp = Path.GetExtendedLengthPathCore(transaction, path, pathFormat, GetFullPathOptions.RemoveTrailingDirectorySeparator | GetFullPathOptions.FullCheck);
+
+ safeFileHandle = File.CreateFileCore(transaction, true, pathLp, ExtendedFileAttributes.BackupSemantics, null, FileMode.Open, FileSystemRights.ReadData, shareMode, true, false, PathFormat.LongFullPath);
+ }
+
+
+ try
+ {
+ if (!NativeMethods.IsValidHandle(safeFileHandle, Marshal.GetLastWin32Error(), !continueOnException))
+ yield break;
+
+ var fileNameOffset = (int) Marshal.OffsetOf(typeof(NativeMethods.FILE_ID_BOTH_DIR_INFO), "FileName");
+
+ using (var safeBuffer = new SafeGlobalMemoryBufferHandle(NativeMethods.DefaultFileBufferSize))
+ {
+ while (true)
+ {
+ var success = NativeMethods.GetFileInformationByHandleEx(safeFileHandle, NativeMethods.FILE_INFO_BY_HANDLE_CLASS.FILE_ID_BOTH_DIR_INFO, safeBuffer, (uint) safeBuffer.Capacity);
+
+ var lastError = Marshal.GetLastWin32Error();
+ if (!success)
+ {
+ switch ((uint) lastError)
+ {
+ case Win32Errors.ERROR_SUCCESS:
+ case Win32Errors.ERROR_NO_MORE_FILES:
+ case Win32Errors.ERROR_HANDLE_EOF:
+ yield break;
+
+ case Win32Errors.ERROR_MORE_DATA:
+ continue;
+
+ default:
+ NativeError.ThrowException(lastError, pathLp);
+
+ // Keep the compiler happy as we never get here.
+ yield break;
+ }
+ }
+
+
+ var offset = 0;
+ NativeMethods.FILE_ID_BOTH_DIR_INFO fibdi;
+
+ do
+ {
+ fibdi = safeBuffer.PtrToStructure(offset);
+
+ var fileName = safeBuffer.PtrToStringUni(offset + fileNameOffset, (int) (fibdi.FileNameLength / UnicodeEncoding.CharSize));
+
+ offset += fibdi.NextEntryOffset;
+
+
+ if (File.IsDirectory(fibdi.FileAttributes) &&
+ (fileName.Equals(Path.CurrentDirectoryPrefix, StringComparison.Ordinal) ||
+ fileName.Equals(Path.ParentDirectoryPrefix, StringComparison.Ordinal)))
+ continue;
+
+
+ yield return new FileIdBothDirectoryInfo(fibdi, fileName);
+
+ } while (fibdi.NextEntryOffset != 0);
+ }
+ }
+ }
+ finally
+ {
+ // Handle is ours, dispose.
+ if (!callerHandle && null != safeFileHandle && !safeFileHandle.IsClosed)
+ safeFileHandle.Close();
+ }
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EnumerateFileSystemEntryInfosCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EnumerateFileSystemEntryInfosCore.cs
new file mode 100644
index 0000000..14fb183
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.EnumerateFileSystemEntryInfosCore.cs
@@ -0,0 +1,104 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path using and .
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static IEnumerable EnumerateFileSystemEntryInfosCore(bool? onlyFolders, KernelTransaction transaction, string path, string searchPattern, SearchOption? searchOption, DirectoryEnumerationOptions? options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ if (null == options)
+ options = DirectoryEnumerationOptions.None;
+
+
+ if (searchOption == SearchOption.AllDirectories)
+ options |= DirectoryEnumerationOptions.Recursive;
+
+
+ if (null != onlyFolders)
+ {
+ // Adhere to the method name by validating the DirectoryEnumerationOptions value.
+ // For example, method Directory.EnumerateDirectories() should only return folders
+ // and method Directory.EnumerateFiles() should only return files.
+
+
+ // Folders only.
+ if ((bool) onlyFolders)
+ {
+ options &= ~DirectoryEnumerationOptions.Files; // Remove enumeration of files.
+ options |= DirectoryEnumerationOptions.Folders; // Add enumeration of folders.
+ }
+
+ // Files only.
+ else
+ {
+ options &= ~DirectoryEnumerationOptions.Folders; // Remove enumeration of folders.
+ options |= DirectoryEnumerationOptions.Files; // Add enumeration of files.
+ }
+ }
+
+
+ return new FindFileSystemEntryInfo(transaction, true, path, searchPattern, options, filters, pathFormat, typeof(T)).Enumerate();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.ExistsJunctionCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.ExistsJunctionCore.cs
new file mode 100644
index 0000000..8b8af37
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.ExistsJunctionCore.cs
@@ -0,0 +1,72 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Determines whether the given path refers to an existing directory junction on disk.
+ ///
+ /// Returns true if refers to an existing directory junction.
+ /// Returns false if the directory junction does not exist or an error occurs when trying to determine if the specified file exists.
+ ///
+ ///
+ ///
+ /// The Exists method returns false if any error occurs while trying to determine if the specified file exists.
+ /// This can occur in situations that raise exceptions such as passing a file name with invalid characters or too many characters,
+ /// a failing or missing disk, or if the caller does not have permission to read the file.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// A FileSystemEntryInfo instance. Use either or , not both.
+ /// The path to test.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static bool ExistsJunctionCore(KernelTransaction transaction, FileSystemEntryInfo fsEntryInfo, string junctionPath, PathFormat pathFormat)
+ {
+ if (null == fsEntryInfo)
+ {
+ if (pathFormat != PathFormat.LongFullPath)
+ {
+ Path.CheckSupportedPathFormat(junctionPath, true, true);
+
+ junctionPath = Path.GetExtendedLengthPathCore(transaction, junctionPath, pathFormat, GetFullPathOptions.CheckInvalidPathChars | GetFullPathOptions.RemoveTrailingDirectorySeparator);
+
+ pathFormat = PathFormat.LongFullPath;
+ }
+
+
+ fsEntryInfo = File.GetFileSystemEntryInfoCore(transaction, true, junctionPath, true, pathFormat);
+ }
+
+
+ return null != fsEntryInfo && fsEntryInfo.IsMountPoint;
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetDirectoryRootCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetDirectoryRootCore.cs
new file mode 100644
index 0000000..6c1d3af
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetDirectoryRootCore.cs
@@ -0,0 +1,57 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Returns the volume information, root information, or both for the specified path.
+ /// The volume information, root information, or both for the specified path, or null if path does not contain root directory information.
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of a file or directory.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static string GetDirectoryRootCore(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ var pathLp = path;
+
+ if (pathFormat != PathFormat.LongFullPath)
+ {
+ Path.CheckInvalidUncPath(path);
+
+ pathLp = Path.GetExtendedLengthPathCore(transaction, path, pathFormat, GetFullPathOptions.CheckInvalidPathChars);
+
+ pathLp = Path.GetRegularPathCore(pathLp, GetFullPathOptions.None, false);
+ }
+
+
+ var rootPath = Path.GetPathRoot(pathLp, false);
+
+ return Utils.IsNullOrWhiteSpace(rootPath) ? null : rootPath;
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetParentCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetParentCore.cs
new file mode 100644
index 0000000..a509395
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetParentCore.cs
@@ -0,0 +1,45 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Retrieves the parent directory of the specified path, including both absolute and relative paths.
+ /// The parent directory, or null if is the root directory, including the root of a UNC server or share name.
+ /// The transaction.
+ /// The path for which to retrieve the parent directory.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static DirectoryInfo GetParentCore(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ var pathLp = pathFormat == PathFormat.LongFullPath ? path : Path.GetExtendedLengthPathCore(transaction, path, pathFormat, GetFullPathOptions.CheckInvalidPathChars);
+
+ pathLp = Path.GetRegularPathCore(pathLp, GetFullPathOptions.None, false);
+
+ var dirName = Path.GetDirectoryName(pathLp, false);
+
+ return !Utils.IsNullOrWhiteSpace(dirName) ? new DirectoryInfo(transaction, dirName, PathFormat.RelativePath) : null;
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetPropertiesCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetPropertiesCore.cs
new file mode 100644
index 0000000..dbcc89a
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetPropertiesCore.cs
@@ -0,0 +1,89 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Gets the properties of the particular directory without following any symbolic links or mount points.
+ /// Properties include aggregated info from of each encountered file system object, plus additional ones: Total, File, Size and Error.
+ /// Total: is the total number of enumerated objects.
+ /// File: is the total number of files. File is considered when object is neither nor .
+ /// Size: is the total size of enumerated objects.
+ /// Error: is the total number of errors encountered during enumeration.
+ ///
+ /// A dictionary mapping the keys mentioned above to their respective aggregated values.
+ /// Directory: is an object which has attribute without one.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The target directory.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static Dictionary GetPropertiesCore(KernelTransaction transaction, string path, DirectoryEnumerationOptions? options, PathFormat pathFormat)
+ {
+ long total = 0;
+ long size = 0;
+
+ const string propFile = "File";
+ const string propTotal = "Total";
+ const string propSize = "Size";
+
+ var typeOfAttrs = typeof(FileAttributes);
+ var attributes = Enum.GetValues(typeOfAttrs);
+ var props = Enum.GetNames(typeOfAttrs).OrderBy(attrs => attrs).ToDictionary(name => name, name => 0);
+ var pathLp = Path.GetExtendedLengthPathCore(transaction, path, pathFormat, GetFullPathOptions.RemoveTrailingDirectorySeparator | GetFullPathOptions.FullCheck);
+
+
+ foreach (var fsei in EnumerateFileSystemEntryInfosCore(null, transaction, pathLp, Path.WildcardStarMatchAll, null, options, null, PathFormat.LongFullPath))
+ {
+ total++;
+
+ if (!fsei.IsDirectory)
+ size += fsei.FileSize;
+
+ var fsei1 = fsei;
+
+ foreach (var attributeMarker in attributes.Cast().Where(attributeMarker => (fsei1.Attributes & attributeMarker) != 0))
+
+ props[((attributeMarker & FileAttributes.Directory) != 0 ? FileAttributes.Directory : attributeMarker).ToString()]++;
+ }
+
+ // Adjust regular files count.
+ props.Add(propFile, total - props[FileAttributes.Directory.ToString()] - props[FileAttributes.ReparsePoint.ToString()]);
+ props.Add(propTotal, total);
+ props.Add(propSize, size);
+
+ return props;
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetSizeCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetSizeCore.cs
new file mode 100644
index 0000000..642368b
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.GetSizeCore.cs
@@ -0,0 +1,73 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// Retrieves the size of all alternate data streams of the specified directory and it files.
+ /// The size of all alternate data streams of the specified directory and its files.
+ /// The transaction.
+ /// The path to the directory.
+ /// true to retrieve the size of all alternate data streams, false to get the size of the first stream.
+ /// true to include subdirectories.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static long GetSizeCore(KernelTransaction transaction, string path, bool sizeOfAllStreams, bool recursive, PathFormat pathFormat)
+ {
+ var streamSizes = new Collection();
+
+ var pathLp = Path.GetExtendedLengthPathCore(transaction, path, pathFormat, GetFullPathOptions.RemoveTrailingDirectorySeparator | GetFullPathOptions.FullCheck);
+
+
+ var enumOptions = (recursive ? DirectoryEnumerationOptions.Recursive : DirectoryEnumerationOptions.None) | DirectoryEnumerationOptions.SkipReparsePoints;
+
+ if (sizeOfAllStreams)
+ {
+ enumOptions |= DirectoryEnumerationOptions.FilesAndFolders;
+
+ streamSizes.Add(File.FindAllStreamsCore(transaction, pathLp));
+ }
+
+ else
+ enumOptions |= DirectoryEnumerationOptions.Files;
+
+
+ foreach (var fsei in EnumerateFileSystemEntryInfosCore(null, transaction, pathLp, Path.WildcardStarMatchAll, null, enumOptions, null, PathFormat.LongFullPath))
+ {
+ // Although tempting, AlphaFS does not use the fsei.FileSize property.
+ //
+ // https://blogs.msdn.microsoft.com/oldnewthing/20111226-00/?p=8813/
+ // "The directory-enumeration functions report the last-updated metadata, which may not correspond to the actual metadata if the directory entry is stale.
+
+
+ streamSizes.Add(sizeOfAllStreams ? File.FindAllStreamsCore(transaction, fsei.LongFullPath) : File.GetSizeCore(null, transaction, fsei.LongFullPath, false, PathFormat.LongFullPath));
+ }
+
+
+ return streamSizes.Sum();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.IsEmptyCore.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.IsEmptyCore.cs
new file mode 100644
index 0000000..fe0f09a
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Core Methods/Directory.IsEmptyCore.cs
@@ -0,0 +1,43 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Linq;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Determines whether the given directory is empty; i.e. it contains no files and no subdirectories.
+ ///
+ /// Returns true when the directory contains no file system objects.
+ /// Returns false when directory contains at least one file system object.
+ ///
+ /// The transaction.
+ /// The path to the directory.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ internal static bool IsEmptyCore(KernelTransaction transaction, string directoryPath, PathFormat pathFormat)
+ {
+ return !EnumerateFileSystemEntryInfosCore(null, transaction, directoryPath, Path.WildcardStarMatchAll, null, null, null, pathFormat).Any();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.Decrypt.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.Decrypt.cs
new file mode 100644
index 0000000..8577939
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.Decrypt.cs
@@ -0,0 +1,97 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Decrypts a directory that was encrypted by the current account using the Encrypt method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decrypt.
+ [SecurityCritical]
+ public static void Decrypt(string path)
+ {
+ EncryptDecryptDirectoryCore(path, false, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Decrypts a directory that was encrypted by the current account using the Encrypt method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decrypt.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Decrypt(string path, PathFormat pathFormat)
+ {
+ EncryptDecryptDirectoryCore(path, false, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Decrypts a directory that was encrypted by the current account using the Encrypt method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decrypt.
+ /// true to decrypt the directory recursively. false only decrypt the directory.
+ [SecurityCritical]
+ public static void Decrypt(string path, bool recursive)
+ {
+ EncryptDecryptDirectoryCore(path, false, recursive, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Decrypts a directory that was encrypted by the current account using the Encrypt method.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to decrypt.
+ /// true to decrypt the directory recursively. false only decrypt the directory.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Decrypt(string path, bool recursive, PathFormat pathFormat)
+ {
+ EncryptDecryptDirectoryCore(path, false, recursive, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.DisableEncryption.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.DisableEncryption.cs
new file mode 100644
index 0000000..33a8094
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.DisableEncryption.cs
@@ -0,0 +1,68 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Disables encryption of the specified directory and the files in it.
+ /// This method only creates/modifies the file "Desktop.ini" in the root of and disables encryption by writing: "Disable=1"
+ /// This method does not affect encryption of files and subdirectories below the indicated directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory for which to disable encryption.
+ [SecurityCritical]
+ public static void DisableEncryption(string path)
+ {
+ EnableDisableEncryptionCore(path, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Disables encryption of the specified directory and the files in it.
+ /// This method only creates/modifies the file "Desktop.ini" in the root of and disables encryption by writing: "Disable=1"
+ /// This method does not affect encryption of files and subdirectories below the indicated directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory for which to disable encryption.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DisableEncryption(string path, PathFormat pathFormat)
+ {
+ EnableDisableEncryptionCore(path, false, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.EnableEncryption.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.EnableEncryption.cs
new file mode 100644
index 0000000..b4ccc81
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.EnableEncryption.cs
@@ -0,0 +1,68 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Enables encryption of the specified directory and the files in it.
+ /// This method only creates/modifies the file "Desktop.ini" in the root of and enables encryption by writing: "Disable=0"
+ /// This method does not affect encryption of files and subdirectories below the indicated directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory for which to enable encryption.
+ [SecurityCritical]
+ public static void EnableEncryption(string path)
+ {
+ EnableDisableEncryptionCore(path, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Enables encryption of the specified directory and the files in it.
+ /// This method only creates/modifies the file "Desktop.ini" in the root of and enables encryption by writing: "Disable=0"
+ /// This method does not affect encryption of files and subdirectories below the indicated directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory for which to enable encryption.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void EnableEncryption(string path, PathFormat pathFormat)
+ {
+ EnableDisableEncryptionCore(path, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.Encrypt.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.Encrypt.cs
new file mode 100644
index 0000000..13457db
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.Encrypt.cs
@@ -0,0 +1,97 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Encrypts a directory so that only the account used to encrypt the directory can decrypt it.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to encrypt.
+ [SecurityCritical]
+ public static void Encrypt(string path)
+ {
+ EncryptDecryptDirectoryCore(path, true, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Encrypts a directory so that only the account used to encrypt the directory can decrypt it.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to encrypt.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Encrypt(string path, PathFormat pathFormat)
+ {
+ EncryptDecryptDirectoryCore(path, true, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Encrypts a directory so that only the account used to encrypt the directory can decrypt it.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to encrypt.
+ /// true to encrypt the directory recursively. false only encrypt the directory.
+ [SecurityCritical]
+ public static void Encrypt(string path, bool recursive)
+ {
+ EncryptDecryptDirectoryCore(path, true, recursive, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Encrypts a directory so that only the account used to encrypt the directory can decrypt it.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A path that describes a directory to encrypt.
+ /// true to encrypt the directory recursively. false only encrypt the directory.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Encrypt(string path, bool recursive, PathFormat pathFormat)
+ {
+ EncryptDecryptDirectoryCore(path, true, recursive, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.ExportEncryptedDirectoryRaw.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.ExportEncryptedDirectoryRaw.cs
new file mode 100644
index 0000000..c6b62fb
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.ExportEncryptedDirectoryRaw.cs
@@ -0,0 +1,70 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.IO;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Backs up (export) encrypted directories. This is one of a group of Encrypted File System (EFS) functions that is
+ /// intended to implement backup and restore functionality, while maintaining files in their encrypted state.
+ ///
+ ///
+ /// The directory being backed up is not decrypted; it is backed up in its encrypted state.
+ /// If the caller does not have access to the key for the file, the caller needs to export encrypted files. See .
+ /// To backup an encrypted directory call one of the overloads and specify the directory to backup along with the destination stream of the backup data.
+ /// This function is intended for the backup of only encrypted directories; see for backup of unencrypted directories.
+ /// Note that this method does not back up the files inside the directory, only the directory entry itself.
+ ///
+ ///
+ ///
+ ///
+ /// The name of the file to be backed up.
+ /// The destination stream to which the backup data will be written.
+ public static void ExportEncryptedDirectoryRaw(string fileName, Stream outputStream)
+ {
+ File.ImportExportEncryptedFileDirectoryRawCore(true, false, outputStream, fileName, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Backs up (export) encrypted directories. This is one of a group of Encrypted File System (EFS) functions that is
+ /// intended to implement backup and restore functionality, while maintaining files in their encrypted state.
+ ///
+ ///
+ /// The directory being backed up is not decrypted; it is backed up in its encrypted state.
+ /// If the caller does not have access to the key for the file, the caller needs to export encrypted files. See .
+ /// To backup an encrypted directory call one of the overloads and specify the directory to backup along with the destination stream of the backup data.
+ /// This function is intended for the backup of only encrypted directories; see for backup of unencrypted directories.
+ /// Note that this method does not back up the files inside the directory, only the directory entry itself.
+ ///
+ ///
+ ///
+ ///
+ /// The name of the file to be backed up.
+ /// The destination stream to which the backup data will be written.
+ /// The path format of the parameter.
+ public static void ExportEncryptedDirectoryRaw(string fileName, Stream outputStream, PathFormat pathFormat)
+ {
+ File.ImportExportEncryptedFileDirectoryRawCore(true, false, outputStream, fileName, false, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.ImportEncryptedDirectoryRaw.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.ImportEncryptedDirectoryRaw.cs
new file mode 100644
index 0000000..f4e7c87
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Encryption/Directory.ImportEncryptedDirectoryRaw.cs
@@ -0,0 +1,107 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.IO;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Restores (import) encrypted directories. This is one of a group of Encrypted File System (EFS) functions that is
+ /// intended to implement backup and restore functionality, while maintaining files in their encrypted state.
+ ///
+ ///
+ /// If the caller does not have access to the key for the directory, the caller needs to restore encrypted directories. See .
+ /// To restore an encrypted directory call one of the overloads and specify the file to restore along with the destination stream of the restored data.
+ /// This function is intended for the restoration of only encrypted directories; see for backup of unencrypted files.
+ ///
+ ///
+ ///
+ ///
+ /// The stream to read previously backed up data from.
+ /// The path of the destination directory to restore to.
+ public static void ImportEncryptedDirectoryRaw(Stream inputStream, string destinationPath)
+ {
+ File.ImportExportEncryptedFileDirectoryRawCore(false, true, inputStream, destinationPath, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Restores (import) encrypted directories. This is one of a group of Encrypted File System (EFS) functions that is
+ /// intended to implement backup and restore functionality, while maintaining files in their encrypted state.
+ ///
+ ///
+ /// If the caller does not have access to the key for the directory, the caller needs to restore encrypted directories. See .
+ /// To restore an encrypted directory call one of the overloads and specify the file to restore along with the destination stream of the restored data.
+ /// This function is intended for the restoration of only encrypted directories; see for backup of unencrypted files.
+ ///
+ ///
+ ///
+ ///
+ /// The stream to read previously backed up data from.
+ /// The path of the destination directory to restore to.
+ /// The path format of the parameter.
+ public static void ImportEncryptedDirectoryRaw(Stream inputStream, string destinationPath, PathFormat pathFormat)
+ {
+ File.ImportExportEncryptedFileDirectoryRawCore(false, true, inputStream, destinationPath, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Restores (import) encrypted directories. This is one of a group of Encrypted File System (EFS) functions that is
+ /// intended to implement backup and restore functionality, while maintaining files in their encrypted state.
+ ///
+ ///
+ /// If the caller does not have access to the key for the directory, the caller needs to restore encrypted directories. See .
+ /// To restore an encrypted directory call one of the overloads and specify the file to restore along with the destination stream of the restored data.
+ /// This function is intended for the restoration of only encrypted directories; see for backup of unencrypted files.
+ ///
+ ///
+ ///
+ ///
+ /// The stream to read previously backed up data from.
+ /// The path of the destination directory to restore to.
+ /// If set to true a hidden directory will be overwritten on import.
+ public static void ImportEncryptedDirectoryRaw(Stream inputStream, string destinationPath, bool overwriteHidden)
+ {
+ File.ImportExportEncryptedFileDirectoryRawCore(false, true, inputStream, destinationPath, overwriteHidden, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Restores (import) encrypted directories. This is one of a group of Encrypted File System (EFS) functions that is
+ /// intended to implement backup and restore functionality, while maintaining files in their encrypted state.
+ ///
+ ///
+ /// If the caller does not have access to the key for the directory, the caller needs to restore encrypted directories. See .
+ /// To restore an encrypted directory call one of the overloads and specify the file to restore along with the destination stream of the restored data.
+ /// This function is intended for the restoration of only encrypted directories; see for backup of unencrypted files.
+ ///
+ ///
+ ///
+ ///
+ /// The stream to read previously backed up data from.
+ /// The path of the destination directory to restore to.
+ /// If set to true a hidden directory will be overwritten on import.
+ /// The path format of the parameter.
+ public static void ImportEncryptedDirectoryRaw(Stream inputStream, string destinationPath, bool overwriteHidden, PathFormat pathFormat)
+ {
+ File.ImportExportEncryptedFileDirectoryRawCore(false, true, inputStream, destinationPath, overwriteHidden, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateJunction.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateJunction.cs
new file mode 100644
index 0000000..8e11ac9
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateJunction.cs
@@ -0,0 +1,188 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J")
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ [SecurityCritical]
+ public static void CreateJunction(string junctionPath, string directoryPath)
+ {
+ CreateJunctionCore(null, junctionPath, directoryPath, false, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J").
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CreateJunction(string junctionPath, string directoryPath, PathFormat pathFormat)
+ {
+ CreateJunctionCore(null, junctionPath, directoryPath, false, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ [SecurityCritical]
+ public static void CreateJunction(string junctionPath, string directoryPath, bool overwrite)
+ {
+ CreateJunctionCore(null, junctionPath, directoryPath, overwrite, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CreateJunction(string junctionPath, string directoryPath, bool overwrite, PathFormat pathFormat)
+ {
+ CreateJunctionCore(null, junctionPath, directoryPath, overwrite, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ /// true to copy the target date and time stamps to the directory junction.
+ [SecurityCritical]
+ public static void CreateJunction(string junctionPath, string directoryPath, bool overwrite, bool copyTargetTimestamps)
+ {
+ CreateJunctionCore(null, junctionPath, directoryPath, overwrite, copyTargetTimestamps, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ /// true to copy the target date and time stamps to the directory junction.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CreateJunction(string junctionPath, string directoryPath, bool overwrite, bool copyTargetTimestamps, PathFormat pathFormat)
+ {
+ CreateJunctionCore(null, junctionPath, directoryPath, overwrite, copyTargetTimestamps, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateJunctionTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateJunctionTransacted.cs
new file mode 100644
index 0000000..8e6350b
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateJunctionTransacted.cs
@@ -0,0 +1,367 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region Obsolete
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J").
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ [SecurityCritical]
+ public static void CreateJunction(KernelTransaction transaction, string junctionPath, string directoryPath)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, false, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J").
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CreateJunction(KernelTransaction transaction, string junctionPath, string directoryPath, PathFormat pathFormat)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, false, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ [SecurityCritical]
+ public static void CreateJunction(KernelTransaction transaction, string junctionPath, string directoryPath, bool overwrite)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, overwrite, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CreateJunction(KernelTransaction transaction, string junctionPath, string directoryPath, bool overwrite, PathFormat pathFormat)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, overwrite, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ /// The directory date and time stamps from (the target) are copied to the directory junction.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ /// true to copy the target date and time stamps to the directory junction.
+ [SecurityCritical]
+ public static void CreateJunction(KernelTransaction transaction, string junctionPath, string directoryPath, bool overwrite, bool copyTargetTimestamps)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, overwrite, copyTargetTimestamps, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ /// The directory date and time stamps from (the target) are copied to the directory junction.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ /// true to copy the target date and time stamps to the directory junction.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CreateJunction(KernelTransaction transaction, string junctionPath, string directoryPath, bool overwrite, bool copyTargetTimestamps, PathFormat pathFormat)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, overwrite, copyTargetTimestamps, pathFormat);
+ }
+
+ #endregion // Obsolete
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J").
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ [SecurityCritical]
+ public static void CreateJunctionTransacted(KernelTransaction transaction, string junctionPath, string directoryPath)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, false, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J").
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CreateJunctionTransacted(KernelTransaction transaction, string junctionPath, string directoryPath, PathFormat pathFormat)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, false, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ [SecurityCritical]
+ public static void CreateJunctionTransacted(KernelTransaction transaction, string junctionPath, string directoryPath, bool overwrite)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, overwrite, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CreateJunctionTransacted(KernelTransaction transaction, string junctionPath, string directoryPath, bool overwrite, PathFormat pathFormat)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, overwrite, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ /// The directory date and time stamps from (the target) are copied to the directory junction.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ /// true to copy the target date and time stamps to the directory junction.
+ [SecurityCritical]
+ public static void CreateJunctionTransacted(KernelTransaction transaction, string junctionPath, string directoryPath, bool overwrite, bool copyTargetTimestamps)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, overwrite, copyTargetTimestamps, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates an NTFS directory junction (similar to CMD command: "MKLINK /J"). Overwriting a junction point of the same name is allowed.
+ ///
+ /// The directory must be empty and reside on a local volume.
+ /// The directory date and time stamps from (the target) are copied to the directory junction.
+ ///
+ /// MSDN: A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories,
+ /// and a junction can link directories located on different local volumes on the same computer.
+ /// Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to create.
+ /// The path to the directory. If the directory does not exist it will be created.
+ /// true to overwrite an existing junction point. The directory is removed and recreated.
+ /// true to copy the target date and time stamps to the directory junction.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CreateJunctionTransacted(KernelTransaction transaction, string junctionPath, string directoryPath, bool overwrite, bool copyTargetTimestamps, PathFormat pathFormat)
+ {
+ CreateJunctionCore(transaction, junctionPath, directoryPath, overwrite, copyTargetTimestamps, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateSymbolicLink.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateSymbolicLink.cs
new file mode 100644
index 0000000..6ba9cac
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateSymbolicLink.cs
@@ -0,0 +1,77 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Creates a symbolic link to a directory (similar to CMD command: "MKLINK /D").
+ ///
+ ///
+ /// Symbolic links can point to a non-existent target.
+ /// When creating a symbolic link, the operating system does not check to see if the target exists.
+ /// Symbolic links are reparse points.
+ /// There is a maximum of 31 reparse points (and therefore symbolic links) allowed in a particular path.
+ /// See to run this method in an elevated state.
+ ///
+ ///
+ ///
+ ///
+ /// The operating system is older than Windows Vista.
+ /// The name of the target for the symbolic link to be created.
+ /// The symbolic link to be created.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "symlink")]
+ [SecurityCritical]
+ public static void CreateSymbolicLink(string symlinkDirectoryName, string targetDirectoryName)
+ {
+ File.CreateSymbolicLinkCore(null, symlinkDirectoryName, targetDirectoryName, SymbolicLinkTarget.Directory, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates a symbolic link to a directory (similar to CMD command: "MKLINK /D").
+ ///
+ ///
+ /// Symbolic links can point to a non-existent target.
+ /// When creating a symbolic link, the operating system does not check to see if the target exists.
+ /// Symbolic links are reparse points.
+ /// There is a maximum of 31 reparse points (and therefore symbolic links) allowed in a particular path.
+ /// See to run this method in an elevated state.
+ ///
+ ///
+ ///
+ ///
+ /// The operating system is older than Windows Vista.
+ /// The name of the target for the symbolic link to be created.
+ /// The symbolic link to be created.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "symlink")]
+ [SecurityCritical]
+ public static void CreateSymbolicLink(string symlinkDirectoryName, string targetDirectoryName, PathFormat pathFormat)
+ {
+ File.CreateSymbolicLinkCore(null, symlinkDirectoryName, targetDirectoryName, SymbolicLinkTarget.Directory, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateSymbolicLinkTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateSymbolicLinkTransacted.cs
new file mode 100644
index 0000000..2dfb10d
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.CreateSymbolicLinkTransacted.cs
@@ -0,0 +1,79 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Creates a symbolic link (similar to CMD command: "MKLINK /D") to a directory as a transacted operation.
+ ///
+ ///
+ /// Symbolic links can point to a non-existent target.
+ /// When creating a symbolic link, the operating system does not check to see if the target exists.
+ /// Symbolic links are reparse points.
+ /// There is a maximum of 31 reparse points (and therefore symbolic links) allowed in a particular path.
+ /// See to run this method in an elevated state.
+ ///
+ ///
+ ///
+ ///
+ /// The operating system is older than Windows Vista.
+ /// The transaction.
+ /// The name of the target for the symbolic link to be created.
+ /// The symbolic link to be created.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "symlink")]
+ [SecurityCritical]
+ public static void CreateSymbolicLinkTransacted(KernelTransaction transaction, string symlinkDirectoryName, string targetDirectoryName)
+ {
+ File.CreateSymbolicLinkCore(transaction, symlinkDirectoryName, targetDirectoryName, SymbolicLinkTarget.Directory, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates a symbolic link (similar to CMD command: "MKLINK /D") to a directory as a transacted operation.
+ ///
+ ///
+ /// Symbolic links can point to a non-existent target.
+ /// When creating a symbolic link, the operating system does not check to see if the target exists.
+ /// Symbolic links are reparse points.
+ /// There is a maximum of 31 reparse points (and therefore symbolic links) allowed in a particular path.
+ /// See to run this method in an elevated state.
+ ///
+ ///
+ ///
+ ///
+ /// The operating system is older than Windows Vista.
+ /// The transaction.
+ /// The name of the target for the symbolic link to be created.
+ /// The symbolic link to be created.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "symlink")]
+ [SecurityCritical]
+ public static void CreateSymbolicLinkTransacted(KernelTransaction transaction, string symlinkDirectoryName, string targetDirectoryName, PathFormat pathFormat)
+ {
+ File.CreateSymbolicLinkCore(transaction, symlinkDirectoryName, targetDirectoryName, SymbolicLinkTarget.Directory, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.DeleteJunction.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.DeleteJunction.cs
new file mode 100644
index 0000000..31e46a6
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.DeleteJunction.cs
@@ -0,0 +1,117 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path of the junction point to remove.
+ [SecurityCritical]
+ public static void DeleteJunction(string junctionPath)
+ {
+ DeleteJunctionCore(null, null, junctionPath, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path of the junction point to remove.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DeleteJunction(string junctionPath, PathFormat pathFormat)
+ {
+ DeleteJunctionCore(null, null, junctionPath, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path of the junction point to remove.
+ /// When true, also removes the directory and all its contents.
+ [SecurityCritical]
+ public static void DeleteJunction(string junctionPath, bool removeDirectory)
+ {
+ DeleteJunctionCore(null, null, junctionPath, removeDirectory, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path of the junction point to remove.
+ /// When true, also removes the directory and all its contents.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DeleteJunction(string junctionPath, bool removeDirectory, PathFormat pathFormat)
+ {
+ DeleteJunctionCore(null, null, junctionPath, removeDirectory, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.DeleteJunctionTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.DeleteJunctionTransacted.cs
new file mode 100644
index 0000000..b05faaf
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.DeleteJunctionTransacted.cs
@@ -0,0 +1,221 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region Obsolete
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to remove.
+ [Obsolete("Use method DeleteJunctionTransacted.")]
+ [SecurityCritical]
+ public static void DeleteJunction(KernelTransaction transaction, string junctionPath)
+ {
+ DeleteJunctionCore(transaction, null, junctionPath, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to remove.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("Use method DeleteJunctionTransacted.")]
+ [SecurityCritical]
+ public static void DeleteJunction(KernelTransaction transaction, string junctionPath, PathFormat pathFormat)
+ {
+ DeleteJunctionCore(transaction, null, junctionPath, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to remove.
+ /// When true, also removes the directory and all its contents.
+ [Obsolete("Use method DeleteJunctionTransacted.")]
+ [SecurityCritical]
+ public static void DeleteJunction(KernelTransaction transaction, string junctionPath, bool removeDirectory)
+ {
+ DeleteJunctionCore(transaction, null, junctionPath, removeDirectory, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to remove.
+ /// When true, also removes the directory and all its contents.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("Use method DeleteJunctionTransacted.")]
+ [SecurityCritical]
+ public static void DeleteJunction(KernelTransaction transaction, string junctionPath, bool removeDirectory, PathFormat pathFormat)
+ {
+ DeleteJunctionCore(transaction, null, junctionPath, removeDirectory, pathFormat);
+ }
+
+ #endregion // Obsolete
+
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to remove.
+ [SecurityCritical]
+ public static void DeleteJunctionTransacted(KernelTransaction transaction, string junctionPath)
+ {
+ DeleteJunctionCore(transaction, null, junctionPath, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to remove.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DeleteJunctionTransacted(KernelTransaction transaction, string junctionPath, PathFormat pathFormat)
+ {
+ DeleteJunctionCore(transaction, null, junctionPath, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to remove.
+ /// When true, also removes the directory and all its contents.
+ [SecurityCritical]
+ public static void DeleteJunctionTransacted(KernelTransaction transaction, string junctionPath, bool removeDirectory)
+ {
+ DeleteJunctionCore(transaction, null, junctionPath, removeDirectory, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes an NTFS directory junction.
+ ///
+ ///
+ /// Only the directory junction is removed, not the target.
+ ///
+ /// A instance referencing the junction point.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path of the junction point to remove.
+ /// When true, also removes the directory and all its contents.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DeleteJunctionTransacted(KernelTransaction transaction, string junctionPath, bool removeDirectory, PathFormat pathFormat)
+ {
+ DeleteJunctionCore(transaction, null, junctionPath, removeDirectory, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.ExistsJunction.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.ExistsJunction.cs
new file mode 100644
index 0000000..a1cdf5c
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.ExistsJunction.cs
@@ -0,0 +1,78 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Determines whether the given path refers to an existing directory junction on disk.
+ ///
+ /// Returns true if refers to an existing directory junction.
+ /// Returns false if the directory junction does not exist or an error occurs when trying to determine if the specified file exists.
+ ///
+ ///
+ ///
+ /// The Exists method returns false if any error occurs while trying to determine if the specified file exists.
+ /// This can occur in situations that raise exceptions such as passing a file name with invalid characters or too many characters,
+ /// a failing or missing disk, or if the caller does not have permission to read the file.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path to test.
+ [SecurityCritical]
+ public static bool ExistsJunction(string junctionPath)
+ {
+ return ExistsJunctionCore(null, null, junctionPath, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Determines whether the given path refers to an existing directory junction on disk.
+ ///
+ /// Returns true if refers to an existing directory junction.
+ /// Returns false if the directory junction does not exist or an error occurs when trying to determine if the specified file exists.
+ ///
+ ///
+ ///
+ /// The Exists method returns false if any error occurs while trying to determine if the specified file exists.
+ /// This can occur in situations that raise exceptions such as passing a file name with invalid characters or too many characters,
+ /// a failing or missing disk, or if the caller does not have permission to read the file.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The path to test.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static bool ExistsJunction(string junctionPath, PathFormat pathFormat)
+ {
+ return ExistsJunctionCore(null, null, junctionPath, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.ExistsJunctionTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.ExistsJunctionTransacted.cs
new file mode 100644
index 0000000..df89937
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Junctions, Links/Directory.ExistsJunctionTransacted.cs
@@ -0,0 +1,137 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region Obsolete
+
+ /// [AlphaFS] Determines whether the given path refers to an existing directory junction on disk.
+ ///
+ /// Returns true if refers to an existing directory junction.
+ /// Returns false if the directory junction does not exist or an error occurs when trying to determine if the specified file exists.
+ ///
+ ///
+ ///
+ /// The Exists method returns false if any error occurs while trying to determine if the specified file exists.
+ /// This can occur in situations that raise exceptions such as passing a file name with invalid characters or too many characters,
+ /// a failing or missing disk, or if the caller does not have permission to read the file.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path to test.
+ [Obsolete("Use ExistsJunctionTransacted method.")]
+ [SecurityCritical]
+ public static bool ExistsJunction(KernelTransaction transaction, string junctionPath)
+ {
+ return ExistsJunctionCore(transaction, null, junctionPath, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Determines whether the given path refers to an existing directory junction on disk.
+ ///
+ /// Returns true if refers to an existing directory junction.
+ /// Returns false if the directory junction does not exist or an error occurs when trying to determine if the specified file exists.
+ ///
+ ///
+ ///
+ /// The Exists method returns false if any error occurs while trying to determine if the specified file exists.
+ /// This can occur in situations that raise exceptions such as passing a file name with invalid characters or too many characters,
+ /// a failing or missing disk, or if the caller does not have permission to read the file.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path to test.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("Use ExistsJunctionTransacted method.")]
+ [SecurityCritical]
+ public static bool ExistsJunction(KernelTransaction transaction, string junctionPath, PathFormat pathFormat)
+ {
+ return ExistsJunctionCore(transaction, null, junctionPath, pathFormat);
+ }
+
+ #endregion // Obsolete
+
+
+ /// [AlphaFS] Determines whether the given path refers to an existing directory junction on disk.
+ ///
+ /// Returns true if refers to an existing directory junction.
+ /// Returns false if the directory junction does not exist or an error occurs when trying to determine if the specified file exists.
+ ///
+ ///
+ ///
+ /// The Exists method returns false if any error occurs while trying to determine if the specified file exists.
+ /// This can occur in situations that raise exceptions such as passing a file name with invalid characters or too many characters,
+ /// a failing or missing disk, or if the caller does not have permission to read the file.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path to test.
+ [SecurityCritical]
+ public static bool ExistsJunctionTransacted(KernelTransaction transaction, string junctionPath)
+ {
+ return ExistsJunctionCore(transaction, null, junctionPath, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Determines whether the given path refers to an existing directory junction on disk.
+ ///
+ /// Returns true if refers to an existing directory junction.
+ /// Returns false if the directory junction does not exist or an error occurs when trying to determine if the specified file exists.
+ ///
+ ///
+ ///
+ /// The Exists method returns false if any error occurs while trying to determine if the specified file exists.
+ /// This can occur in situations that raise exceptions such as passing a file name with invalid characters or too many characters,
+ /// a failing or missing disk, or if the caller does not have permission to read the file.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The path to test.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static bool ExistsJunctionTransacted(KernelTransaction transaction, string junctionPath, PathFormat pathFormat)
+ {
+ return ExistsJunctionCore(transaction, null, junctionPath, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.CopyTimestamps.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.CopyTimestamps.cs
new file mode 100644
index 0000000..0f9b39d
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.CopyTimestamps.cs
@@ -0,0 +1,145 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region Obsolete
+
+ /// [AlphaFS] Copies the date and timestamps for the specified directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ [Obsolete("Use new method name: CopyTimestamp")]
+ [SecurityCritical]
+ public static void TransferTimestamps(string sourcePath, string destinationPath)
+ {
+ CopyTimestamps(sourcePath, destinationPath);
+ }
+
+ /// [AlphaFS] Copies the date and timestamps for the specified directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("Use new method name: CopyTimestamp")]
+ [SecurityCritical]
+ public static void TransferTimestamps(string sourcePath, string destinationPath, PathFormat pathFormat)
+ {
+ CopyTimestamps(sourcePath, destinationPath, pathFormat);
+ }
+
+
+ /// [AlphaFS] Copies the date and timestamps for the specified directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ /// The transaction.
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ [Obsolete("Use new method name: CopyTimestampsTransacted")]
+ [SecurityCritical]
+ public static void TransferTimestampsTransacted(KernelTransaction transaction, string sourcePath, string destinationPath)
+ {
+ CopyTimestampsTransacted(transaction, sourcePath, destinationPath, PathFormat.RelativePath);
+ }
+
+ /// [AlphaFS] Copies the date and timestamps for the specified directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ /// The transaction.
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ /// Indicates the format of the path parameter(s).
+ [Obsolete("Use new method name: CopyTimestampsTransacted")]
+ [SecurityCritical]
+ public static void TransferTimestampsTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, PathFormat pathFormat)
+ {
+ CopyTimestampsTransacted(transaction, sourcePath, destinationPath, pathFormat);
+ }
+
+ #endregion // Obsolete
+
+
+
+
+ /// [AlphaFS] Copies the date and timestamps for the specified existing directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ ///
+ ///
+ ///
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ [SecurityCritical]
+ public static void CopyTimestamps(string sourcePath, string destinationPath)
+ {
+ File.CopyTimestampsCore(null, true, sourcePath, destinationPath, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Copies the date and timestamps for the specified existing directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ ///
+ ///
+ ///
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CopyTimestamps(string sourcePath, string destinationPath, PathFormat pathFormat)
+ {
+ File.CopyTimestampsCore(null, true, sourcePath, destinationPath, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Copies the date and timestamps for the specified existing directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ ///
+ ///
+ ///
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void CopyTimestamps(string sourcePath, string destinationPath, bool modifyReparsePoint)
+ {
+ File.CopyTimestampsCore(null, true, sourcePath, destinationPath, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Copies the date and timestamps for the specified existing directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ ///
+ ///
+ ///
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CopyTimestamps(string sourcePath, string destinationPath, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.CopyTimestampsCore(null, true, sourcePath, destinationPath, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.CopyTimestampsTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.CopyTimestampsTransacted.cs
new file mode 100644
index 0000000..02f7581
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.CopyTimestampsTransacted.cs
@@ -0,0 +1,93 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Copies the date and timestamps for the specified existing directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ [SecurityCritical]
+ public static void CopyTimestampsTransacted(KernelTransaction transaction, string sourcePath, string destinationPath)
+ {
+ File.CopyTimestampsCore(transaction, true, sourcePath, destinationPath, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Copies the date and timestamps for the specified existing directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CopyTimestampsTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, PathFormat pathFormat)
+ {
+ File.CopyTimestampsCore(transaction, true, sourcePath, destinationPath, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Copies the date and timestamps for the specified existing directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void CopyTimestampsTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, bool modifyReparsePoint)
+ {
+ File.CopyTimestampsCore(transaction, true, sourcePath, destinationPath, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Copies the date and timestamps for the specified existing directories.
+ /// This method uses BackupSemantics flag to get Timestamp changed for directories.
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The source directory to get the date and time stamps from.
+ /// The destination directory to set the date and time stamps.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void CopyTimestampsTransacted(KernelTransaction transaction, string sourcePath, string destinationPath, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.CopyTimestampsCore(transaction, true, sourcePath, destinationPath, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTime.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTime.cs
new file mode 100644
index 0000000..239d170
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTime.cs
@@ -0,0 +1,59 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using Microsoft.Win32.SafeHandles;
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Gets the change date and time of the specified directory.
+ /// A structure set to the change date and time for the specified directory. This value is expressed in local time.
+ /// The directory for which to obtain creation date and time information.
+ [SecurityCritical]
+ public static DateTime GetChangeTime(string path)
+ {
+ return File.GetChangeTimeCore(null, null, true, path, false, PathFormat.RelativePath);
+ }
+
+ /// [AlphaFS] Gets the change date and time of the specified directory.
+ /// A structure set to the change date and time for the specified directory. This value is expressed in local time.
+ /// The directory for which to obtain creation date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetChangeTime(string path, PathFormat pathFormat)
+ {
+ return File.GetChangeTimeCore(null, null, true, path, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Gets the change date and time of the specified directory.
+ /// A structure set to the change date and time for the specified directory. This value is expressed in local time.
+ /// An open handle to the directory from which to retrieve information.
+ [SecurityCritical]
+ public static DateTime GetChangeTime(SafeFileHandle safeFileHandle)
+ {
+ return File.GetChangeTimeCore(null, safeFileHandle, true, null, true, PathFormat.RelativePath);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTimeTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTimeTransacted.cs
new file mode 100644
index 0000000..781d1d8
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTimeTransacted.cs
@@ -0,0 +1,51 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Gets the change date and time of the specified directory.
+ /// A structure set to the change date and time for the specified directory. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain creation date and time information.
+ [SecurityCritical]
+ public static DateTime GetChangeTimeTransacted(KernelTransaction transaction, string path)
+ {
+ return File.GetChangeTimeCore(transaction, null, true, path, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Gets the change date and time of the specified directory.
+ /// A structure set to the change date and time for the specified directory. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain creation date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetChangeTimeTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return File.GetChangeTimeCore(transaction, null, true, path, false, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTimeUtc.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTimeUtc.cs
new file mode 100644
index 0000000..c7baa7e
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTimeUtc.cs
@@ -0,0 +1,49 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Gets the change date and time, in Coordinated Universal Time (UTC) format, of the specified directory.
+ /// A structure set to the change date and time for the specified directory. This value is expressed in UTC time.
+ /// The file for which to obtain change date and time information, in Coordinated Universal Time (UTC) format.
+ [SecurityCritical]
+ public static DateTime GetChangeTimeUtc(string path)
+ {
+ return File.GetChangeTimeCore(null, null, true, path, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Gets the change date and time, in Coordinated Universal Time (UTC) format, of the specified directory.
+ /// A structure set to the change date and time for the specified directory. This value is expressed in UTC time.
+ /// The file for which to obtain change date and time information, in Coordinated Universal Time (UTC) format.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetChangeTimeUtc(string path, PathFormat pathFormat)
+ {
+ return File.GetChangeTimeCore(null, null, true, path, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTimeUtcTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTimeUtcTransacted.cs
new file mode 100644
index 0000000..f10650a
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetChangeTimeUtcTransacted.cs
@@ -0,0 +1,51 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Gets the change date and time, in Coordinated Universal Time (UTC) format, of the specified directory.
+ /// A structure set to the change date and time for the specified directory. This value is expressed in UTC time.
+ /// The transaction.
+ /// The file for which to obtain change date and time information, in Coordinated Universal Time (UTC) format.
+ [SecurityCritical]
+ public static DateTime GetChangeTimeUtcTransacted(KernelTransaction transaction, string path)
+ {
+ return File.GetChangeTimeCore(transaction, null, true, path, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Gets the change date and time, in Coordinated Universal Time (UTC) format, of the specified directory.
+ /// A structure set to the change date and time for the specified directory. This value is expressed in UTC time.
+ /// The transaction.
+ /// The file for which to obtain change date and time information, in Coordinated Universal Time (UTC) format.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetChangeTimeUtcTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return File.GetChangeTimeCore(transaction, null, true, path, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTime.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTime.cs
new file mode 100644
index 0000000..02fbe5b
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTime.cs
@@ -0,0 +1,53 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Gets the creation date and time of the specified directory.
+ /// A structure set to the creation date and time for the specified directory. This value is expressed in local time.
+ /// The directory for which to obtain creation date and time information.
+ [SecurityCritical]
+ public static DateTime GetCreationTime(string path)
+ {
+ return File.GetCreationTimeCore(null, path, false, PathFormat.RelativePath).ToLocalTime();
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Gets the creation date and time of the specified directory.
+ /// A structure set to the creation date and time for the specified directory. This value is expressed in local time.
+ /// The directory for which to obtain creation date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetCreationTime(string path, PathFormat pathFormat)
+ {
+ return File.GetCreationTimeCore(null, path, false, pathFormat).ToLocalTime();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTimeTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTimeTransacted.cs
new file mode 100644
index 0000000..99ade72
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTimeTransacted.cs
@@ -0,0 +1,51 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Gets the creation date and time of the specified directory.
+ /// A structure set to the creation date and time for the specified directory. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain creation date and time information.
+ [SecurityCritical]
+ public static DateTime GetCreationTimeTransacted(KernelTransaction transaction, string path)
+ {
+ return File.GetCreationTimeCore(transaction, path, false, PathFormat.RelativePath).ToLocalTime();
+ }
+
+
+ /// [AlphaFS] Gets the creation date and time of the specified directory.
+ /// A structure set to the creation date and time for the specified directory. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain creation date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetCreationTimeTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return File.GetCreationTimeCore(transaction, path, false, pathFormat).ToLocalTime();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTimeUtc.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTimeUtc.cs
new file mode 100644
index 0000000..31ead9e
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTimeUtc.cs
@@ -0,0 +1,53 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Gets the creation date and time, in Coordinated Universal Time (UTC) format, of the specified directory.
+ /// A structure set to the creation date and time for the specified directory. This value is expressed in UTC time.
+ /// The directory for which to obtain creation date and time information, in Coordinated Universal Time (UTC) format.
+ [SecurityCritical]
+ public static DateTime GetCreationTimeUtc(string path)
+ {
+ return File.GetCreationTimeCore(null, path, true, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Gets the creation date and time, in Coordinated Universal Time (UTC) format, of the specified directory.
+ /// A structure set to the creation date and time for the specified directory. This value is expressed in UTC time.
+ /// The directory for which to obtain creation date and time information, in Coordinated Universal Time (UTC) format.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetCreationTimeUtc(string path, PathFormat pathFormat)
+ {
+ return File.GetCreationTimeCore(null, path, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTimeUtcTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTimeUtcTransacted.cs
new file mode 100644
index 0000000..7afee7a
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetCreationTimeUtcTransacted.cs
@@ -0,0 +1,51 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Gets the creation date and time, in Coordinated Universal Time (UTC) format, of the specified directory.
+ /// A structure set to the creation date and time for the specified directory. This value is expressed in UTC time.
+ /// The transaction.
+ /// The directory for which to obtain creation date and time information, in Coordinated Universal Time (UTC) format.
+ [SecurityCritical]
+ public static DateTime GetCreationTimeUtcTransacted(KernelTransaction transaction, string path)
+ {
+ return File.GetCreationTimeCore(transaction, path, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Gets the creation date and time, in Coordinated Universal Time (UTC) format, of the specified directory.
+ /// A structure set to the creation date and time for the specified directory. This value is expressed in UTC time.
+ /// The transaction.
+ /// The directory for which to obtain creation date and time information, in Coordinated Universal Time (UTC) format.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetCreationTimeUtcTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return File.GetCreationTimeCore(transaction, path, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTime.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTime.cs
new file mode 100644
index 0000000..ca044ef
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTime.cs
@@ -0,0 +1,53 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Gets the date and time that the specified directory was last accessed.
+ /// A structure set to the date and time that the specified directory was last accessed. This value is expressed in local time.
+ /// The directory for which to obtain access date and time information.
+ [SecurityCritical]
+ public static DateTime GetLastAccessTime(string path)
+ {
+ return File.GetLastAccessTimeCore(null, path, false, PathFormat.RelativePath).ToLocalTime();
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Gets the date and time that the specified directory was last accessed.
+ /// A structure set to the date and time that the specified directory was last accessed. This value is expressed in local time.
+ /// The directory for which to obtain access date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetLastAccessTime(string path, PathFormat pathFormat)
+ {
+ return File.GetLastAccessTimeCore(null, path, false, pathFormat).ToLocalTime();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTimeTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTimeTransacted.cs
new file mode 100644
index 0000000..123b2dc
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTimeTransacted.cs
@@ -0,0 +1,51 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Gets the date and time that the specified directory was last accessed.
+ /// A structure set to the date and time that the specified directory was last accessed. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain access date and time information.
+ [SecurityCritical]
+ public static DateTime GetLastAccessTimeTransacted(KernelTransaction transaction, string path)
+ {
+ return File.GetLastAccessTimeCore(transaction, path, false, PathFormat.RelativePath).ToLocalTime();
+ }
+
+
+ /// [AlphaFS] Gets the date and time that the specified directory was last accessed.
+ /// A structure set to the date and time that the specified directory was last accessed. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain access date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetLastAccessTimeTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return File.GetLastAccessTimeCore(transaction, path, false, pathFormat).ToLocalTime();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTimeUtc.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTimeUtc.cs
new file mode 100644
index 0000000..56b54de
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTimeUtc.cs
@@ -0,0 +1,53 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Gets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// A structure set to the date and time that the specified directory was last accessed. This value is expressed in local time.
+ /// The directory for which to obtain access date and time information.
+ [SecurityCritical]
+ public static DateTime GetLastAccessTimeUtc(string path)
+ {
+ return File.GetLastAccessTimeCore(null, path, true, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Gets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// A structure set to the date and time that the specified directory was last accessed. This value is expressed in local time.
+ /// The directory for which to obtain access date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetLastAccessTimeUtc(string path, PathFormat pathFormat)
+ {
+ return File.GetLastAccessTimeCore(null, path, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTimeUtcTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTimeUtcTransacted.cs
new file mode 100644
index 0000000..de77ebb
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastAccessTimeUtcTransacted.cs
@@ -0,0 +1,51 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Gets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// A structure set to the date and time that the specified directory was last accessed. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain access date and time information.
+ [SecurityCritical]
+ public static DateTime GetLastAccessTimeUtcTransacted(KernelTransaction transaction, string path)
+ {
+ return File.GetLastAccessTimeCore(transaction, path, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Gets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// A structure set to the date and time that the specified directory was last accessed. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain access date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetLastAccessTimeUtcTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return File.GetLastAccessTimeCore(transaction, path, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTime.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTime.cs
new file mode 100644
index 0000000..5f17746
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTime.cs
@@ -0,0 +1,53 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Gets the date and time that the specified directory was last written to.
+ /// A structure set to the date and time that the specified directory was last written to. This value is expressed in local time.
+ /// The directory for which to obtain write date and time information.
+ [SecurityCritical]
+ public static DateTime GetLastWriteTime(string path)
+ {
+ return File.GetLastWriteTimeCore(null, path, false, PathFormat.RelativePath).ToLocalTime();
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Gets the date and time that the specified directory was last written to.
+ /// A structure set to the date and time that the specified directory was last written to. This value is expressed in local time.
+ /// The directory for which to obtain write date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetLastWriteTime(string path, PathFormat pathFormat)
+ {
+ return File.GetLastWriteTimeCore(null, path, false, pathFormat).ToLocalTime();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTimeTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTimeTransacted.cs
new file mode 100644
index 0000000..fc199ec
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTimeTransacted.cs
@@ -0,0 +1,51 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Gets the date and time that the specified directory was last written to.
+ /// A structure set to the date and time that the specified directory was last written to. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain write date and time information.
+ [SecurityCritical]
+ public static DateTime GetLastWriteTimeTransacted(KernelTransaction transaction, string path)
+ {
+ return File.GetLastWriteTimeCore(transaction, path, false, PathFormat.RelativePath).ToLocalTime();
+ }
+
+
+ /// [AlphaFS] Gets the date and time that the specified directory was last written to.
+ /// A structure set to the date and time that the specified directory was last written to. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain write date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetLastWriteTimeTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return File.GetLastWriteTimeCore(transaction, path, false, pathFormat).ToLocalTime();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTimeUtc.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTimeUtc.cs
new file mode 100644
index 0000000..77f1366
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTimeUtc.cs
@@ -0,0 +1,53 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Gets the date and time, in coordinated universal time (UTC) time, that the specified directory was last written to.
+ /// A structure set to the date and time that the specified directory was last written to. This value is expressed in local time.
+ /// The directory for which to obtain write date and time information.
+ [SecurityCritical]
+ public static DateTime GetLastWriteTimeUtc(string path)
+ {
+ return File.GetLastWriteTimeCore(null, path, true, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Gets the date and time, in coordinated universal time (UTC) time, that the specified directory was last written to.
+ /// A structure set to the date and time that the specified directory was last written to. This value is expressed in local time.
+ /// The directory for which to obtain write date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetLastWriteTimeUtc(string path, PathFormat pathFormat)
+ {
+ return File.GetLastWriteTimeCore(null, path, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTimeUtcTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTimeUtcTransacted.cs
new file mode 100644
index 0000000..6dcecb3
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.GetLastWriteTimeUtcTransacted.cs
@@ -0,0 +1,51 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Gets the date and time, in coordinated universal time (UTC) time, that the specified directory was last written to.
+ /// A structure set to the date and time that the specified directory was last written to. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain write date and time information.
+ [SecurityCritical]
+ public static DateTime GetLastWriteTimeUtcTransacted(KernelTransaction transaction, string path)
+ {
+ return File.GetLastWriteTimeCore(transaction, path, true, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Gets the date and time, in coordinated universal time (UTC) time, that the specified directory was last written to.
+ /// A structure set to the date and time that the specified directory was last written to. This value is expressed in local time.
+ /// The transaction.
+ /// The directory for which to obtain write date and time information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static DateTime GetLastWriteTimeUtcTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return File.GetLastWriteTimeCore(transaction, path, true, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTime.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTime.cs
new file mode 100644
index 0000000..fe009e5
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTime.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Sets the date and time the directory was created.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ [SecurityCritical]
+ public static void SetCreationTime(string path, DateTime creationTime)
+ {
+ File.SetFsoDateTimeCore(null, false, path, creationTime.ToUniversalTime(), null, null, false, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Sets the date and time the directory was created.
+ /// The directory for which to set the creation date and time information.
+ /// Indicates the format of the path parameter(s).
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ [SecurityCritical]
+ public static void SetCreationTime(string path, DateTime creationTime, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, creationTime.ToUniversalTime(), null, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time the directory was created.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetCreationTime(string path, DateTime creationTime, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(null, false, path, creationTime.ToUniversalTime(), null, null, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time the directory was created.
+ /// The directory for which to set the creation date and time information.
+ /// Indicates the format of the path parameter(s).
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetCreationTime(string path, DateTime creationTime, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, creationTime.ToUniversalTime(), null, null, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTimeTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTimeTransacted.cs
new file mode 100644
index 0000000..5b4059b
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTimeTransacted.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Sets the date and time the directory was created.
+ /// The transaction.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ [SecurityCritical]
+ public static void SetCreationTimeTransacted(KernelTransaction transaction, string path, DateTime creationTime)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, creationTime.ToUniversalTime(), null, null, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time the directory was created.
+ /// The transaction.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetCreationTimeTransacted(KernelTransaction transaction, string path, DateTime creationTime, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, creationTime.ToUniversalTime(), null, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time the directory was created.
+ /// The transaction.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetCreationTimeTransacted(KernelTransaction transaction, string path, DateTime creationTime, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, creationTime.ToUniversalTime(), null, null, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time the directory was created.
+ /// The transaction.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetCreationTimeTransacted(KernelTransaction transaction, string path, DateTime creationTime, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, creationTime.ToUniversalTime(), null, null, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTimeUtc.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTimeUtc.cs
new file mode 100644
index 0000000..34a11b5
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTimeUtc.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Sets the date and time, in coordinated universal time (UTC), that the directory was created.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ [SecurityCritical]
+ public static void SetCreationTimeUtc(string path, DateTime creationTimeUtc)
+ {
+ File.SetFsoDateTimeCore(null, false, path, creationTimeUtc, null, null, false, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the directory was created.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetCreationTimeUtc(string path, DateTime creationTimeUtc, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, creationTimeUtc, null, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the directory was created.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetCreationTimeUtc(string path, DateTime creationTimeUtc, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(null, false, path, creationTimeUtc, null, null, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the directory was created.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetCreationTimeUtc(string path, DateTime creationTimeUtc, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, creationTimeUtc, null, null, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTimeUtcTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTimeUtcTransacted.cs
new file mode 100644
index 0000000..f97e949
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetCreationTimeUtcTransacted.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the directory was created.
+ /// The transaction.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ [SecurityCritical]
+ public static void SetCreationTimeUtcTransacted(KernelTransaction transaction, string path, DateTime creationTimeUtc)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, creationTimeUtc, null, null, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the directory was created.
+ /// The transaction.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetCreationTimeUtcTransacted(KernelTransaction transaction, string path, DateTime creationTimeUtc, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, creationTimeUtc, null, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the directory was created.
+ /// The transaction.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetCreationTimeUtcTransacted(KernelTransaction transaction, string path, DateTime creationTimeUtc, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, creationTimeUtc, null, null, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the directory was created.
+ /// The transaction.
+ /// The directory for which to set the creation date and time information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetCreationTimeUtcTransacted(KernelTransaction transaction, string path, DateTime creationTimeUtc, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, creationTimeUtc, null, null, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTime.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTime.cs
new file mode 100644
index 0000000..5ed7d3d
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTime.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Sets the date and time that the specified directory was last accessed.
+ /// The file for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ [SecurityCritical]
+ public static void SetLastAccessTime(string path, DateTime lastAccessTime)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, lastAccessTime.ToUniversalTime(), null, false, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last accessed.
+ /// The file for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastAccessTime(string path, DateTime lastAccessTime, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, lastAccessTime.ToUniversalTime(), null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last accessed.
+ /// The file for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetLastAccessTime(string path, DateTime lastAccessTime, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, lastAccessTime.ToUniversalTime(), null, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last accessed.
+ /// The file for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastAccessTime(string path, DateTime lastAccessTime, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, lastAccessTime.ToUniversalTime(), null, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTimeTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTimeTransacted.cs
new file mode 100644
index 0000000..7aef9e3
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTimeTransacted.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Sets the date and time that the specified directory was last accessed.
+ /// The transaction.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ [SecurityCritical]
+ public static void SetLastAccessTimeTransacted(KernelTransaction transaction, string path, DateTime lastAccessTime)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, lastAccessTime.ToUniversalTime(), null, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last accessed.
+ /// The transaction.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastAccessTimeTransacted(KernelTransaction transaction, string path, DateTime lastAccessTime, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, lastAccessTime.ToUniversalTime(), null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last accessed.
+ /// The transaction.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetLastAccessTimeTransacted(KernelTransaction transaction, string path, DateTime lastAccessTime, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, lastAccessTime.ToUniversalTime(), null, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last accessed.
+ /// The transaction.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastAccessTimeTransacted(KernelTransaction transaction, string path, DateTime lastAccessTime, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, lastAccessTime.ToUniversalTime(), null, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTimeUtc.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTimeUtc.cs
new file mode 100644
index 0000000..6d2c727
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTimeUtc.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Sets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ [SecurityCritical]
+ public static void SetLastAccessTimeUtc(string path, DateTime lastAccessTimeUtc)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, lastAccessTimeUtc, null, false, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastAccessTimeUtc(string path, DateTime lastAccessTimeUtc, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, lastAccessTimeUtc, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetLastAccessTimeUtc(string path, DateTime lastAccessTimeUtc, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, lastAccessTimeUtc, null, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastAccessTimeUtc(string path, DateTime lastAccessTimeUtc, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, lastAccessTimeUtc, null, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTimeUtcTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTimeUtcTransacted.cs
new file mode 100644
index 0000000..8ebbe34
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastAccessTimeUtcTransacted.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// The transaction.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ [SecurityCritical]
+ public static void SetLastAccessTimeUtcTransacted(KernelTransaction transaction, string path, DateTime lastAccessTimeUtc)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, lastAccessTimeUtc, null, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// The transaction.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastAccessTimeUtcTransacted(KernelTransaction transaction, string path, DateTime lastAccessTimeUtc, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, lastAccessTimeUtc, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// The transaction.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetLastAccessTimeUtcTransacted(KernelTransaction transaction, string path, DateTime lastAccessTimeUtc, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, lastAccessTimeUtc, null, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last accessed.
+ /// The transaction.
+ /// The directory for which to set the access date and time information.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastAccessTimeUtcTransacted(KernelTransaction transaction, string path, DateTime lastAccessTimeUtc, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, lastAccessTimeUtc, null, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTime.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTime.cs
new file mode 100644
index 0000000..f54de4d
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTime.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Sets the date and time that the specified directory was last written to.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ [SecurityCritical]
+ public static void SetLastWriteTime(string path, DateTime lastWriteTime)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, null, lastWriteTime.ToUniversalTime(), false, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last written to.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastWriteTime(string path, DateTime lastWriteTime, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, null, lastWriteTime.ToUniversalTime(), false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last written to.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetLastWriteTime(string path, DateTime lastWriteTime, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, null, lastWriteTime.ToUniversalTime(), modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last written to.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastWriteTime(string path, DateTime lastWriteTime, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, null, lastWriteTime.ToUniversalTime(), modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTimeTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTimeTransacted.cs
new file mode 100644
index 0000000..32ffcbd
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTimeTransacted.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Sets the date and time that the specified directory was last written to.
+ /// The transaction.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ [SecurityCritical]
+ public static void SetLastWriteTimeTransacted(KernelTransaction transaction, string path, DateTime lastWriteTime)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, null, lastWriteTime.ToUniversalTime(), false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last written to.
+ /// The transaction.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastWriteTimeTransacted(KernelTransaction transaction, string path, DateTime lastWriteTime, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, null, lastWriteTime.ToUniversalTime(), false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last written to.
+ /// The transaction.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetLastWriteTimeTransacted(KernelTransaction transaction, string path, DateTime lastWriteTime, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, null, lastWriteTime.ToUniversalTime(), modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time that the specified directory was last written to.
+ /// The transaction.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastWriteTimeTransacted(KernelTransaction transaction, string path, DateTime lastWriteTime, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, null, lastWriteTime.ToUniversalTime(), modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTimeUtc.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTimeUtc.cs
new file mode 100644
index 0000000..c9338fa
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTimeUtc.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Sets the date and time, in coordinated universal time (UTC), that the specified directory was last written to.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ [SecurityCritical]
+ public static void SetLastWriteTimeUtc(string path, DateTime lastWriteTimeUtc)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, null, lastWriteTimeUtc, false, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last written to.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastWriteTimeUtc(string path, DateTime lastWriteTimeUtc, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, null, lastWriteTimeUtc, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last written to.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetLastWriteTimeUtc(string path, DateTime lastWriteTimeUtc, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, null, lastWriteTimeUtc, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last written to.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastWriteTimeUtc(string path, DateTime lastWriteTimeUtc, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, false, path, null, null, lastWriteTimeUtc, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTimeUtcTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTimeUtcTransacted.cs
new file mode 100644
index 0000000..7017c35
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetLastWriteTimeUtcTransacted.cs
@@ -0,0 +1,76 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last written to.
+ /// The transaction.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ [SecurityCritical]
+ public static void SetLastWriteTimeUtcTransacted(KernelTransaction transaction, string path, DateTime lastWriteTimeUtc)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, null, lastWriteTimeUtc, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last written to.
+ /// The transaction.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastWriteTimeUtcTransacted(KernelTransaction transaction, string path, DateTime lastWriteTimeUtc, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, null, lastWriteTimeUtc, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last written to.
+ /// The transaction.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetLastWriteTimeUtcTransacted(KernelTransaction transaction, string path, DateTime lastWriteTimeUtc, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, null, lastWriteTimeUtc, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets the date and time, in coordinated universal time (UTC), that the specified directory was last written to.
+ /// The transaction.
+ /// The directory for which to set the date and time information.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetLastWriteTimeUtcTransacted(KernelTransaction transaction, string path, DateTime lastWriteTimeUtc, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, false, path, null, null, lastWriteTimeUtc, modifyReparsePoint, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetTimestamps.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetTimestamps.cs
new file mode 100644
index 0000000..124f2a3
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory Time/Directory.SetTimestamps.cs
@@ -0,0 +1,252 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Sets all the date and time stamps for the specified directory, at once.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ [SecurityCritical]
+ public static void SetTimestamps(string path, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime)
+ {
+ File.SetFsoDateTimeCore(null, true, path, creationTime.ToUniversalTime(), lastAccessTime.ToUniversalTime(), lastWriteTime.ToUniversalTime(), false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps for the specified directory, at once.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetTimestamps(string path, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, true, path, creationTime.ToUniversalTime(), lastAccessTime.ToUniversalTime(), lastWriteTime.ToUniversalTime(), false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps for the specified directory, at once.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetTimestamps(string path, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(null, true, path, creationTime.ToUniversalTime(), lastAccessTime.ToUniversalTime(), lastWriteTime.ToUniversalTime(), modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps for the specified directory, at once.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetTimestamps(string path, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, true, path, creationTime.ToUniversalTime(), lastAccessTime.ToUniversalTime(), lastWriteTime.ToUniversalTime(), modifyReparsePoint, pathFormat);
+ }
+
+
+
+
+ /// [AlphaFS] Sets all the date and time stamps, in coordinated universal time (UTC), for the specified directory, at once.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ [SecurityCritical]
+ public static void SetTimestampsUtc(string path, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc)
+ {
+ File.SetFsoDateTimeCore(null, true, path, creationTimeUtc, lastAccessTimeUtc, lastWriteTimeUtc, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps, in coordinated universal time (UTC), for the specified directory, at once.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetTimestampsUtc(string path, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, true, path, creationTimeUtc, lastAccessTimeUtc, lastWriteTimeUtc, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps, in coordinated universal time (UTC), for the specified directory, at once.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetTimestampsUtc(string path, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(null, true, path, creationTimeUtc, lastAccessTimeUtc, lastWriteTimeUtc, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps, in coordinated universal time (UTC), for the specified directory, at once.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetTimestampsUtc(string path, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(null, true, path, creationTimeUtc, lastAccessTimeUtc, lastWriteTimeUtc, modifyReparsePoint, pathFormat);
+ }
+
+
+ #region Transactional
+
+ /// [AlphaFS] Sets all the date and time stamps for the specified directory, at once.
+ /// The transaction.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ [SecurityCritical]
+ public static void SetTimestampsTransacted(KernelTransaction transaction, string path, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime)
+ {
+ File.SetFsoDateTimeCore(transaction, true, path, creationTime.ToUniversalTime(), lastAccessTime.ToUniversalTime(), lastWriteTime.ToUniversalTime(), false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps for the specified directory, at once.
+ /// The transaction.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetTimestampsTransacted(KernelTransaction transaction, string path, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, true, path, creationTime.ToUniversalTime(), lastAccessTime.ToUniversalTime(), lastWriteTime.ToUniversalTime(), false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps for the specified directory, at once.
+ /// The transaction.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetTimestampsTransacted(KernelTransaction transaction, string path, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(transaction, true, path, creationTime.ToUniversalTime(), lastAccessTime.ToUniversalTime(), lastWriteTime.ToUniversalTime(), modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps for the specified directory, at once.
+ /// The transaction.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in local time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in local time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetTimestampsTransacted(KernelTransaction transaction, string path, DateTime creationTime, DateTime lastAccessTime, DateTime lastWriteTime, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, true, path, creationTime.ToUniversalTime(), lastAccessTime.ToUniversalTime(), lastWriteTime.ToUniversalTime(), modifyReparsePoint, pathFormat);
+ }
+
+
+
+
+ /// [AlphaFS] Sets all the date and time stamps, in coordinated universal time (UTC), for the specified directory, at once.
+ /// The transaction.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ [SecurityCritical]
+ public static void SetTimestampsUtcTransacted(KernelTransaction transaction, string path, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc)
+ {
+ File.SetFsoDateTimeCore(transaction, true, path, creationTimeUtc, lastAccessTimeUtc, lastWriteTimeUtc, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps, in coordinated universal time (UTC), for the specified directory, at once.
+ /// The transaction.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetTimestampsUtcTransacted(KernelTransaction transaction, string path, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, true, path, creationTimeUtc, lastAccessTimeUtc, lastWriteTimeUtc, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps, in coordinated universal time (UTC), for the specified directory, at once.
+ /// The transaction.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ [SecurityCritical]
+ public static void SetTimestampsUtcTransacted(KernelTransaction transaction, string path, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc, bool modifyReparsePoint)
+ {
+ File.SetFsoDateTimeCore(transaction, true, path, creationTimeUtc, lastAccessTimeUtc, lastWriteTimeUtc, modifyReparsePoint, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Sets all the date and time stamps, in coordinated universal time (UTC), for the specified directory, at once.
+ /// The transaction.
+ /// The directory for which to set the dates and times information.
+ /// A containing the value to set for the creation date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last access date and time of . This value is expressed in UTC time.
+ /// A containing the value to set for the last write date and time of . This value is expressed in UTC time.
+ /// If true, the date and time information will apply to the reparse point (symlink or junction) and not the file or directory linked to. No effect if does not refer to a reparse point.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void SetTimestampsUtcTransacted(KernelTransaction transaction, string path, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc, bool modifyReparsePoint, PathFormat pathFormat)
+ {
+ File.SetFsoDateTimeCore(transaction, true, path, creationTimeUtc, lastAccessTimeUtc, lastWriteTimeUtc, modifyReparsePoint, pathFormat);
+ }
+
+ #endregion // Transactional
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CountFileSystemObjects.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CountFileSystemObjects.cs
new file mode 100644
index 0000000..10dc44b
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CountFileSystemObjects.cs
@@ -0,0 +1,110 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Linq;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Counts file system objects: files, folders or both) in a given directory.
+ /// The counted number of file system objects.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory path.
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static long CountFileSystemObjects(string path, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, options, null, PathFormat.RelativePath).Count();
+ }
+
+
+ /// [AlphaFS] Counts file system objects: files, folders or both) in a given directory.
+ /// The counted number of file system objects.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory path.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static long CountFileSystemObjects(string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, options, null, pathFormat).Count();
+ }
+
+
+ /// [AlphaFS] Counts file system objects: files, folders or both) in a given directory.
+ /// The counted number of file system objects.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory path.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static long CountFileSystemObjects(string path, string searchPattern, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, options, null, PathFormat.RelativePath).Count();
+ }
+
+
+ /// [AlphaFS] Counts file system objects: files, folders or both) in a given directory.
+ /// The counted number of file system objects.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory path.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static long CountFileSystemObjects(string path, string searchPattern, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, options, null, pathFormat).Count();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CountFileSystemObjectsTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CountFileSystemObjectsTransacted.cs
new file mode 100644
index 0000000..5a8e37c
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CountFileSystemObjectsTransacted.cs
@@ -0,0 +1,114 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Linq;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Counts file system objects: files, folders or both) in a given directory.
+ /// The counted number of file system objects.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory path.
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static long CountFileSystemObjectsTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, options, null, PathFormat.RelativePath).Count();
+ }
+
+
+ /// [AlphaFS] Counts file system objects: files, folders or both) in a given directory.
+ /// The counted number of file system objects.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory path.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static long CountFileSystemObjectsTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, options, null, pathFormat).Count();
+ }
+
+
+ /// [AlphaFS] Counts file system objects: files, folders or both) in a given directory.
+ /// The counted number of file system objects.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory path.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static long CountFileSystemObjectsTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, searchPattern, null, options, null, PathFormat.RelativePath).Count();
+ }
+
+
+ /// [AlphaFS] Counts file system objects: files, folders or both) in a given directory.
+ /// The counted number of file system objects.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory path.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static long CountFileSystemObjectsTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, searchPattern, null, options, null, pathFormat).Count();
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CreateDirectory.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CreateDirectory.cs
new file mode 100644
index 0000000..d411620
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CreateDirectory.cs
@@ -0,0 +1,337 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Security;
+using System.Security.AccessControl;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Creates all directories and subdirectories in the specified path unless they already exist.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path)
+ {
+ return CreateDirectoryCore(false, null, path, null, null, false, PathFormat.RelativePath);
+ }
+
+
+ /// Creates all the directories in the specified path, unless the already exist, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The access control to apply to the directory.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, DirectorySecurity directorySecurity)
+ {
+ return CreateDirectoryCore(false, null, path, null, directorySecurity, false, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, null, path, null, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// When true compresses the directory using NTFS compression.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, bool compress)
+ {
+ return CreateDirectoryCore(false, null, path, null, null, compress, PathFormat.RelativePath);
+ }
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// When true compresses the directory using NTFS compression.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, bool compress, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, null, path, null, null, compress, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The access control to apply to the directory.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, DirectorySecurity directorySecurity, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, null, path, null, directorySecurity, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The access control to apply to the directory.
+ /// When true compresses the directory using NTFS compression.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, DirectorySecurity directorySecurity, bool compress)
+ {
+ return CreateDirectoryCore(false, null, path, null, directorySecurity, compress, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The access control to apply to the directory.
+ /// When true compresses the directory using NTFS compression.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, DirectorySecurity directorySecurity, bool compress, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, null, path, null, directorySecurity, compress, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates a new directory, with the attributes of a specified template directory.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, string templatePath)
+ {
+ return CreateDirectoryCore(false, null, path, templatePath, null, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates a new directory, with the attributes of a specified template directory.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, string templatePath, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, null, path, templatePath, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates a new directory, with the attributes of a specified template directory.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// When true compresses the directory using NTFS compression.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, string templatePath, bool compress)
+ {
+ return CreateDirectoryCore(false, null, path, templatePath, null, compress, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates a new directory, with the attributes of a specified template directory.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// When true compresses the directory using NTFS compression.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, string templatePath, bool compress, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, null, path, templatePath, null, compress, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path of a specified template directory and applies the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// The access control to apply to the directory.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, string templatePath, DirectorySecurity directorySecurity)
+ {
+ return CreateDirectoryCore(false, null, path, templatePath, directorySecurity, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path of a specified template directory and applies the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// The access control to apply to the directory.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, string templatePath, DirectorySecurity directorySecurity, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, null, path, templatePath, directorySecurity, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path of a specified template directory and applies the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// The access control to apply to the directory.
+ /// When true compresses the directory using NTFS compression.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, string templatePath, DirectorySecurity directorySecurity, bool compress)
+ {
+ return CreateDirectoryCore(false, null, path, templatePath, directorySecurity, compress, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path of a specified template directory and applies the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// The access control to apply to the directory.
+ /// When true compresses the directory using NTFS compression.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectory(string path, string templatePath, DirectorySecurity directorySecurity, bool compress, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, null, path, templatePath, directorySecurity, compress, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CreateDirectoryTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CreateDirectoryTransacted.cs
new file mode 100644
index 0000000..f2b4b2d
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.CreateDirectoryTransacted.cs
@@ -0,0 +1,349 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Security;
+using System.Security.AccessControl;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Creates all directories and subdirectories in the specified path unless they already exist.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path)
+ {
+ return CreateDirectoryCore(false, transaction, path, null, null, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, transaction, path, null, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// When true compresses the directory using NTFS compression.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, bool compress)
+ {
+ return CreateDirectoryCore(false, transaction, path, null, null, compress, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// When true compresses the directory using NTFS compression.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, bool compress, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, transaction, path, null, null, compress, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, unless the already exist, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The access control to apply to the directory.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, DirectorySecurity directorySecurity)
+ {
+ return CreateDirectoryCore(false, transaction, path, null, directorySecurity, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The access control to apply to the directory.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, DirectorySecurity directorySecurity, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, transaction, path, null, directorySecurity, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The access control to apply to the directory.
+ /// When true compresses the directory using NTFS compression.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, DirectorySecurity directorySecurity, bool compress)
+ {
+ return CreateDirectoryCore(false, transaction, path, null, directorySecurity, compress, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path, applying the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The access control to apply to the directory.
+ /// When true compresses the directory using NTFS compression.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, DirectorySecurity directorySecurity, bool compress, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, transaction, path, null, directorySecurity, compress, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates a new directory, with the attributes of a specified template directory.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, string templatePath)
+ {
+ return CreateDirectoryCore(false, transaction, path, templatePath, null, false, PathFormat.RelativePath);
+ }
+
+ /// [AlphaFS] Creates a new directory, with the attributes of a specified template directory.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, string templatePath, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, transaction, path, templatePath, null, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates a new directory, with the attributes of a specified template directory.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// When true compresses the directory using NTFS compression.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, string templatePath, bool compress)
+ {
+ return CreateDirectoryCore(false, transaction, path, templatePath, null, compress, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates a new directory, with the attributes of a specified template directory.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// When true compresses the directory using NTFS compression.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, string templatePath, bool compress, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, transaction, path, templatePath, null, compress, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path of a specified template directory and applies the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// The access control to apply to the directory.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, string templatePath, DirectorySecurity directorySecurity)
+ {
+ return CreateDirectoryCore(false, transaction, path, templatePath, directorySecurity, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path of a specified template directory and applies the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// The access control to apply to the directory.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, string templatePath, DirectorySecurity directorySecurity, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, transaction, path, templatePath, directorySecurity, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path of a specified template directory and applies the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// The access control to apply to the directory.
+ /// When true compresses the directory using NTFS compression.
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, string templatePath, DirectorySecurity directorySecurity, bool compress)
+ {
+ return CreateDirectoryCore(false, transaction, path, templatePath, directorySecurity, compress, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Creates all the directories in the specified path of a specified template directory and applies the specified Windows security.
+ /// An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to create.
+ /// The path of the directory to use as a template when creating the new directory.
+ /// The access control to apply to the directory.
+ /// When true compresses the directory using NTFS compression.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
+ [SecurityCritical]
+ public static DirectoryInfo CreateDirectoryTransacted(KernelTransaction transaction, string path, string templatePath, DirectorySecurity directorySecurity, bool compress, PathFormat pathFormat)
+ {
+ return CreateDirectoryCore(false, transaction, path, templatePath, directorySecurity, compress, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.Delete.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.Delete.cs
new file mode 100644
index 0000000..b52fbec
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.Delete.cs
@@ -0,0 +1,138 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Deletes an empty directory from a specified path.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the empty directory to remove. This directory must be writable and empty.
+ [SecurityCritical]
+ public static void Delete(string path)
+ {
+ DeleteDirectoryCore(null, null, path, false, false, false, PathFormat.RelativePath);
+ }
+
+
+ /// Deletes the specified directory and, if indicated, any subdirectories in the directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory to remove.
+ /// true to remove directories, subdirectories, and files in . false otherwise.
+ [SecurityCritical]
+ public static void Delete(string path, bool recursive)
+ {
+ DeleteDirectoryCore(null, null, path, recursive, false, false, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Deletes an empty directory from a specified path.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the empty directory to remove. This directory must be writable and empty.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Delete(string path, PathFormat pathFormat)
+ {
+ DeleteDirectoryCore(null, null, path, false, false, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Deletes the specified directory and, if indicated, any subdirectories in the directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory to remove.
+ /// true to remove directories, subdirectories, and files in . false otherwise.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Delete(string path, bool recursive, PathFormat pathFormat)
+ {
+ DeleteDirectoryCore(null, null, path, recursive, false, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Deletes the specified directory and, if indicated, any subdirectories in the directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory to remove.
+ /// true to remove directories, subdirectories, and files in . false otherwise.
+ /// true overrides read only of files and directories.
+ [SecurityCritical]
+ public static void Delete(string path, bool recursive, bool ignoreReadOnly)
+ {
+ DeleteDirectoryCore(null, null, path, recursive, ignoreReadOnly, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes the specified directory and, if indicated, any subdirectories in the directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory to remove.
+ /// true to remove directories, subdirectories, and files in . false otherwise.
+ /// true overrides read only of files and directories.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void Delete(string path, bool recursive, bool ignoreReadOnly, PathFormat pathFormat)
+ {
+ DeleteDirectoryCore(null, null, path, recursive, ignoreReadOnly, false, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.DeleteEmptySubdirectories.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.DeleteEmptySubdirectories.cs
new file mode 100644
index 0000000..9e63b92
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.DeleteEmptySubdirectories.cs
@@ -0,0 +1,117 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Deletes empty subdirectories from the specified directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory to remove empty subdirectories from.
+ [SecurityCritical]
+ public static void DeleteEmptySubdirectories(string path)
+ {
+ DeleteEmptySubdirectoriesCore(null, null, path, false, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes empty subdirectories from the specified directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory to remove empty subdirectories from.
+ /// true deletes empty subdirectories from this directory and its subdirectories.
+ [SecurityCritical]
+ public static void DeleteEmptySubdirectories(string path, bool recursive)
+ {
+ DeleteEmptySubdirectoriesCore(null, null, path, recursive, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes empty subdirectories from the specified directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory to remove empty subdirectories from.
+ /// true deletes empty subdirectories from this directory and its subdirectories.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DeleteEmptySubdirectories(string path, bool recursive, PathFormat pathFormat)
+ {
+ DeleteEmptySubdirectoriesCore(null, null, path, recursive, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Deletes empty subdirectories from the specified directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory to remove empty subdirectories from.
+ /// true deletes empty subdirectories from this directory and its subdirectories.
+ /// true overrides read only of empty directories.
+ [SecurityCritical]
+ public static void DeleteEmptySubdirectories(string path, bool recursive, bool ignoreReadOnly)
+ {
+ DeleteEmptySubdirectoriesCore(null, null, path, recursive, ignoreReadOnly, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes empty subdirectories from the specified directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The name of the directory to remove empty subdirectories from.
+ /// true deletes empty subdirectories from this directory and its subdirectories.
+ /// true overrides read only of empty directories.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DeleteEmptySubdirectories(string path, bool recursive, bool ignoreReadOnly, PathFormat pathFormat)
+ {
+ DeleteEmptySubdirectoriesCore(null, null, path, recursive, ignoreReadOnly, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.DeleteEmptySubdirectoriesTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.DeleteEmptySubdirectoriesTransacted.cs
new file mode 100644
index 0000000..2fc0d47
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.DeleteEmptySubdirectoriesTransacted.cs
@@ -0,0 +1,122 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Deletes empty subdirectories from the specified directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The name of the directory to remove empty subdirectories from.
+ [SecurityCritical]
+ public static void DeleteEmptySubdirectoriesTransacted(KernelTransaction transaction, string path)
+ {
+ DeleteEmptySubdirectoriesCore(null, transaction, path, false, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes empty subdirectories from the specified directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The name of the directory to remove empty subdirectories from.
+ /// true deletes empty subdirectories from this directory and its subdirectories.
+ [SecurityCritical]
+ public static void DeleteEmptySubdirectoriesTransacted(KernelTransaction transaction, string path, bool recursive)
+ {
+ DeleteEmptySubdirectoriesCore(null, transaction, path, recursive, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes empty subdirectories from the specified directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The name of the directory to remove empty subdirectories from.
+ /// true deletes empty subdirectories from this directory and its subdirectories.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DeleteEmptySubdirectoriesTransacted(KernelTransaction transaction, string path, bool recursive, PathFormat pathFormat)
+ {
+ DeleteEmptySubdirectoriesCore(null, transaction, path, recursive, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Deletes empty subdirectories from the specified directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The name of the directory to remove empty subdirectories from.
+ /// true deletes empty subdirectories from this directory and its subdirectories.
+ /// true overrides read only of empty directories.
+ [SecurityCritical]
+ public static void DeleteEmptySubdirectoriesTransacted(KernelTransaction transaction, string path, bool recursive, bool ignoreReadOnly)
+ {
+ DeleteEmptySubdirectoriesCore(null, transaction, path, recursive, ignoreReadOnly, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes empty subdirectories from the specified directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The name of the directory to remove empty subdirectories from.
+ /// true deletes empty subdirectories from this directory and its subdirectories.
+ /// true overrides read only of empty directories.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DeleteEmptySubdirectoriesTransacted(KernelTransaction transaction, string path, bool recursive, bool ignoreReadOnly, PathFormat pathFormat)
+ {
+ DeleteEmptySubdirectoriesCore(null, transaction, path, recursive, ignoreReadOnly, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.DeleteTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.DeleteTransacted.cs
new file mode 100644
index 0000000..22b0190
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.DeleteTransacted.cs
@@ -0,0 +1,140 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Deletes an empty directory from a specified path.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The name of the empty directory to remove. This directory must be writable and empty.
+ [SecurityCritical]
+ public static void DeleteTransacted(KernelTransaction transaction, string path)
+ {
+ DeleteDirectoryCore(transaction, null, path, false, false, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes an empty directory from a specified path.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The name of the empty directory to remove. This directory must be writable and empty.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DeleteTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ DeleteDirectoryCore(transaction, null, path, false, false, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Deletes the specified directory and, if indicated, any subdirectories in the directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The name of the directory to remove.
+ /// true to remove directories, subdirectories, and files in . false otherwise.
+ [SecurityCritical]
+ public static void DeleteTransacted(KernelTransaction transaction, string path, bool recursive)
+ {
+ DeleteDirectoryCore(transaction, null, path, recursive, false, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes the specified directory and, if indicated, any subdirectories in the directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The name of the directory to remove.
+ /// true to remove directories, subdirectories, and files in . false otherwise.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DeleteTransacted(KernelTransaction transaction, string path, bool recursive, PathFormat pathFormat)
+ {
+ DeleteDirectoryCore(transaction, null, path, recursive, false, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Deletes the specified directory and, if indicated, any subdirectories in the directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The name of the directory to remove.
+ /// true to remove directories, subdirectories, and files in . false otherwise.
+ /// true overrides read only of files and directories.
+ [SecurityCritical]
+ public static void DeleteTransacted(KernelTransaction transaction, string path, bool recursive, bool ignoreReadOnly)
+ {
+ DeleteDirectoryCore(transaction, null, path, recursive, ignoreReadOnly, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Deletes the specified directory and, if indicated, any subdirectories in the directory.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The name of the directory to remove.
+ /// true to remove directories, subdirectories, and files in . false otherwise.
+ /// true overrides read only of files and directories.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static void DeleteTransacted(KernelTransaction transaction, string path, bool recursive, bool ignoreReadOnly, PathFormat pathFormat)
+ {
+ DeleteDirectoryCore(transaction, null, path, recursive, ignoreReadOnly, false, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateAlternateDataStreams.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateAlternateDataStreams.cs
new file mode 100644
index 0000000..a8cdd04
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateAlternateDataStreams.cs
@@ -0,0 +1,49 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Enumerates the streams of type :$DATA from the specified directory.
+ /// The path to the directory to enumerate streams of.
+ /// The streams of type :$DATA in the specified directory.
+ [SecurityCritical]
+ public static IEnumerable EnumerateAlternateDataStreams(string path)
+ {
+ return File.EnumerateAlternateDataStreamsCore(null, true, path, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Enumerates the streams of type :$DATA from the specified directory.
+ /// The path to the directory to enumerate streams of.
+ /// Indicates the format of the path parameter(s).
+ /// The streams of type :$DATA in the specified directory.
+ [SecurityCritical]
+ public static IEnumerable EnumerateAlternateDataStreams(string path, PathFormat pathFormat)
+ {
+ return File.EnumerateAlternateDataStreamsCore(null, true, path, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateAlternateDataStreamsTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateAlternateDataStreamsTransacted.cs
new file mode 100644
index 0000000..c195047
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateAlternateDataStreamsTransacted.cs
@@ -0,0 +1,51 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System.Collections.Generic;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Enumerates the streams of type :$DATA from the specified directory.
+ /// The transaction.
+ /// The path to the directory to enumerate streams of.
+ /// The streams of type :$DATA in the specified directory.
+ [SecurityCritical]
+ public static IEnumerable EnumerateAlternateDataStreamsTransacted(KernelTransaction transaction, string path)
+ {
+ return File.EnumerateAlternateDataStreamsCore(transaction, true, path, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Enumerates the streams of type :$DATA from the specified directory.
+ /// The transaction.
+ /// The path to the directory to enumerate streams of.
+ /// Indicates the format of the path parameter(s).
+ /// The streams of type :$DATA in the specified directory.
+ [SecurityCritical]
+ public static IEnumerable EnumerateAlternateDataStreamsTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return File.EnumerateAlternateDataStreamsCore(transaction, true, path, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateDirectories.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateDirectories.cs
new file mode 100644
index 0000000..d0a9c9f
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateDirectories.cs
@@ -0,0 +1,414 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Security;
+using SearchOption = System.IO.SearchOption;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectories(string path)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, Path.WildcardStarMatchAll, null, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// Returns an enumerable collection of directory names that match a in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectories(string path, string searchPattern)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, searchPattern, null, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// Returns an enumerable collection of directory names that match a in a specified , and optionally searches subdirectories.
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified and .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ ///
+ /// One of the enumeration values that specifies whether the
+ /// should include only the current directory or should include all subdirectories.
+ ///
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectories(string path, string searchPattern, SearchOption searchOption)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, searchPattern, searchOption, null, null, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectories(string path, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, Path.WildcardStarMatchAll, null, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names that match a in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectories(string path, string searchPattern, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, searchPattern, null, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names that match a in a specified , and optionally searches subdirectories.
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified and .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ ///
+ /// One of the enumeration values that specifies whether the
+ /// should include only the current directory or should include all subdirectories.
+ ///
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectories(string path, string searchPattern, SearchOption searchOption, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, searchPattern, searchOption, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectories(string path, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, Path.WildcardStarMatchAll, null, options, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectories(string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, Path.WildcardStarMatchAll, null, options, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectories(string path, string searchPattern, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, searchPattern, null, options, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectories(string path, string searchPattern, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, searchPattern, null, options, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectories(string path, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, Path.WildcardStarMatchAll, null, null, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectories(string path, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, Path.WildcardStarMatchAll, null, null, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectories(string path, string searchPattern, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, searchPattern, null, null, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectories(string path, string searchPattern, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, searchPattern, null, null, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectories(string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, Path.WildcardStarMatchAll, null, options, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectories(string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, Path.WildcardStarMatchAll, null, options, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectories(string path, string searchPattern, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, searchPattern, null, options, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// The specification of custom filters to be used in the process.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectories(string path, string searchPattern, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, null, path, searchPattern, null, options, filters, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateDirectoriesTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateDirectoriesTransacted.cs
new file mode 100644
index 0000000..747a775
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateDirectoriesTransacted.cs
@@ -0,0 +1,430 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Security;
+using SearchOption = System.IO.SearchOption;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Returns an enumerable collection of directory instances in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, Path.WildcardStarMatchAll, null, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory instances that match a in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, string searchPattern)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, searchPattern, null, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names that match a in a specified , and optionally searches subdirectories.
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified and .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ ///
+ /// One of the enumeration values that specifies whether the
+ /// should include only the current directory or should include all subdirectories.
+ ///
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, string searchPattern, SearchOption searchOption)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, searchPattern, searchOption, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory instances in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, Path.WildcardStarMatchAll, null, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory instances that match a in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, string searchPattern, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, searchPattern, null, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names that match a in a specified , and optionally searches subdirectories.
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified and .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ ///
+ /// One of the enumeration values that specifies whether the
+ /// should include only the current directory or should include all subdirectories.
+ ///
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, string searchPattern, SearchOption searchOption, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, searchPattern, searchOption, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory instances in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, Path.WildcardStarMatchAll, null, options, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory instances in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, Path.WildcardStarMatchAll, null, options, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory instances that match a in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, searchPattern, null, options, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory instances that match a in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, searchPattern, null, options, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, Path.WildcardStarMatchAll, null, null, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, Path.WildcardStarMatchAll, null, null, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, searchPattern, null, null, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, searchPattern, null, null, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, Path.WildcardStarMatchAll, null, options, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, Path.WildcardStarMatchAll, null, options, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, searchPattern, null, options, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of directory names in a specified .
+ /// An enumerable collection of the full names (including paths) for the directories in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// The specification of custom filters to be used in the process.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateDirectoriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(true, transaction, path, searchPattern, null, options, filters, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileIdBothDirectoryInfo.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileIdBothDirectoryInfo.cs
new file mode 100644
index 0000000..1a12e89
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileIdBothDirectoryInfo.cs
@@ -0,0 +1,91 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using Microsoft.Win32.SafeHandles;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Retrieves information about files in the directory specified by in mode.
+ /// An enumeration of records for each file system entry in the specified diretory.
+ /// The operating system is older than Windows Vista.
+ /// A path to a directory from which to retrieve information.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileIdBothDirectoryInfo(string path)
+ {
+ return EnumerateFileIdBothDirectoryInfoCore(null, null, path, FileShare.ReadWrite, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Retrieves information about files in the directory specified by in mode.
+ /// An enumeration of records for each file system entry in the specified diretory.
+ /// The operating system is older than Windows Vista.
+ /// A path to a directory from which to retrieve information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileIdBothDirectoryInfo(string path, PathFormat pathFormat)
+ {
+ return EnumerateFileIdBothDirectoryInfoCore(null, null, path, FileShare.ReadWrite, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Retrieves information about files in the directory specified by in specified mode.
+ /// An enumeration of records for each file system entry in the specified diretory.
+ /// The operating system is older than Windows Vista.
+ /// A path to a directory from which to retrieve information.
+ /// The mode with which to open a handle to the directory.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileIdBothDirectoryInfo(string path, FileShare shareMode)
+ {
+ return EnumerateFileIdBothDirectoryInfoCore(null, null, path, shareMode, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Retrieves information about files in the directory specified by in specified mode.
+ /// An enumeration of records for each file system entry in the specified diretory.
+ /// The operating system is older than Windows Vista.
+ /// A path to a directory from which to retrieve information.
+ /// The mode with which to open a handle to the directory.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileIdBothDirectoryInfo(string path, FileShare shareMode, PathFormat pathFormat)
+ {
+ return EnumerateFileIdBothDirectoryInfoCore(null, null, path, shareMode, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Retrieves information about files in the directory handle specified.
+ /// An IEnumerable of records for each file system entry in the specified diretory.
+ /// The operating system is older than Windows Vista.
+ /// An open handle to the directory from which to retrieve information.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileIdBothDirectoryInfo(SafeFileHandle handle)
+ {
+ // FileShare has no effect since a handle is already opened.
+ return EnumerateFileIdBothDirectoryInfoCore(null, handle, null, FileShare.ReadWrite, false, PathFormat.RelativePath);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileIdBothDirectoryInfoTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileIdBothDirectoryInfoTransacted.cs
new file mode 100644
index 0000000..0a45f01
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileIdBothDirectoryInfoTransacted.cs
@@ -0,0 +1,82 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Retrieves information about files in the directory specified by in mode.
+ /// An enumeration of records for each file system entry in the specified diretory.
+ /// The operating system is older than Windows Vista.
+ /// The transaction.
+ /// A path to a directory from which to retrieve information.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileIdBothDirectoryInfoTransacted(KernelTransaction transaction, string path)
+ {
+ return EnumerateFileIdBothDirectoryInfoCore(transaction, null, path, FileShare.ReadWrite, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Retrieves information about files in the directory specified by in mode.
+ /// An enumeration of records for each file system entry in the specified diretory.
+ /// The operating system is older than Windows Vista.
+ /// The transaction.
+ /// A path to a directory from which to retrieve information.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileIdBothDirectoryInfoTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return EnumerateFileIdBothDirectoryInfoCore(transaction, null, path, FileShare.ReadWrite, false, pathFormat);
+ }
+
+
+ /// [AlphaFS] Retrieves information about files in the directory specified by in specified mode.
+ /// An enumeration of records for each file system entry in the specified diretory.
+ /// The operating system is older than Windows Vista.
+ /// The transaction.
+ /// A path to a directory from which to retrieve information.
+ /// The mode with which to open a handle to the directory.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileIdBothDirectoryInfoTransacted(KernelTransaction transaction, string path, FileShare shareMode)
+ {
+ return EnumerateFileIdBothDirectoryInfoCore(transaction, null, path, shareMode, false, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Retrieves information about files in the directory specified by in specified mode.
+ /// An enumeration of records for each file system entry in the specified diretory.
+ /// The operating system is older than Windows Vista.
+ /// The transaction.
+ /// A path to a directory from which to retrieve information.
+ /// The mode with which to open a handle to the directory.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileIdBothDirectoryInfoTransacted(KernelTransaction transaction, string path, FileShare shareMode, PathFormat pathFormat)
+ {
+ return EnumerateFileIdBothDirectoryInfoCore(transaction, null, path, shareMode, false, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntries.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntries.cs
new file mode 100644
index 0000000..4f2468b
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntries.cs
@@ -0,0 +1,367 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Security;
+using SearchOption = System.IO.SearchOption;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ #region .NET
+
+ /// Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntries(string path)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntries(string path, string searchPattern)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// Returns an enumerable collection of file names and directory names that match a in a specified , and optionally searches subdirectories.
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified and .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ ///
+ /// One of the enumeration values that specifies whether the
+ /// should include only the current directory or should include all subdirectories.
+ ///
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntries(string path, string searchPattern, SearchOption searchOption)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, searchOption, null, null, PathFormat.RelativePath);
+ }
+
+ #endregion // .NET
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntries(string path, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntries(string path, string searchPattern, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified , and optionally searches subdirectories.
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified and .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ ///
+ /// One of the enumeration values that specifies whether the
+ /// should include only the current directory or should include all subdirectories.
+ ///
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntries(string path, string searchPattern, SearchOption searchOption, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, searchOption, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntries(string path, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, options, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntries(string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, options, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntries(string path, string searchPattern, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, options, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// Indicates the format of the path parameter(s).
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntries(string path, string searchPattern, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, options, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntries(string path, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, null, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntries(string path, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, null, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntries(string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, options, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntries(string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, options, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntries(string path, string searchPattern, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, options, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntries(string path, string searchPattern, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, options, filters, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntriesTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntriesTransacted.cs
new file mode 100644
index 0000000..9736774
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntriesTransacted.cs
@@ -0,0 +1,381 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Security;
+using SearchOption = System.IO.SearchOption;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, searchPattern, null, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified , and optionally searches subdirectories.
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified and .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ ///
+ /// One of the enumeration values that specifies whether the
+ /// should include only the current directory or should include all subdirectories.
+ ///
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, SearchOption searchOption)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, searchPattern, searchOption, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, searchPattern, null, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified , and optionally searches subdirectories.
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified and .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ ///
+ /// One of the enumeration values that specifies whether the
+ /// should include only the current directory or should include all subdirectories.
+ ///
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, SearchOption searchOption, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, searchPattern, searchOption, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, options, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, options, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, searchPattern, null, options, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, searchPattern, null, options, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, null, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, null, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, options, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names in a specified .
+ /// An enumerable collection of file system entries in the directory specified by .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, options, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, searchPattern, null, options, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file names and directory names that match a in a specified .
+ /// An enumerable collection of file system entries in the directory specified by and that match the specified .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntriesTransacted(KernelTransaction transaction, string path, string searchPattern, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, searchPattern, null, options, filters, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntryInfos.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntryInfos.cs
new file mode 100644
index 0000000..d15b15b
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntryInfos.cs
@@ -0,0 +1,627 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, options, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, options, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries that match a in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, string searchPattern)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries that match a in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, string searchPattern, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries that match a in a specified path using .
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, string searchPattern, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, options, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries that match a in a specified path using .
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, string searchPattern, DirectoryEnumerationOptions options, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, options, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// The specification of custom filters to be used in the process.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, null, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, null, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, options, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, Path.WildcardStarMatchAll, null, options, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries that match a in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// The specification of custom filters to be used in the process.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, string searchPattern, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, null, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries that match a in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, string searchPattern, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, null, filters, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries that match a in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, string searchPattern, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, options, filters, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries that match a in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The directory to search.
+ ///
+ /// The search string to match against the names of directories in .
+ /// This parameter can contain a combination of valid literal path and wildcard
+ /// ( and ) characters, but does not support regular expressions.
+ ///
+ /// flags that specify how the directory is to be enumerated.
+ /// The specification of custom filters to be used in the process.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ [Obsolete("Argument searchPattern is obsolete. The DirectoryEnumerationFilters argument provides better filter criteria.")]
+ public static IEnumerable EnumerateFileSystemEntryInfos(string path, string searchPattern, DirectoryEnumerationOptions options, DirectoryEnumerationFilters filters, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, null, path, searchPattern, null, options, filters, pathFormat);
+ }
+ }
+}
diff --git a/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntryInfosTransacted.cs b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntryInfosTransacted.cs
new file mode 100644
index 0000000..3dd1483
--- /dev/null
+++ b/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/Directory Class/Directory.EnumerateFileSystemEntryInfosTransacted.cs
@@ -0,0 +1,647 @@
+/* Copyright (C) 2008-2018 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Security;
+
+namespace Alphaleonis.Win32.Filesystem
+{
+ public static partial class Directory
+ {
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfosTransacted(KernelTransaction transaction, string path)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, null, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// Indicates the format of the path parameter(s).
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfosTransacted(KernelTransaction transaction, string path, PathFormat pathFormat)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, null, null, pathFormat);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ /// -
+ ///
+ /// This method will return instances of instances.
+ ///
+ /// -
+ ///
+ /// This method will return instances of and instances.
+ ///
+ /// -
+ ///
+ /// This method will return the full path of each item.
+ ///
+ ///
+ ///
+ /// The transaction.
+ /// The directory to search.
+ /// flags that specify how the directory is to be enumerated.
+ [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Infos")]
+ [SecurityCritical]
+ public static IEnumerable EnumerateFileSystemEntryInfosTransacted(KernelTransaction transaction, string path, DirectoryEnumerationOptions options)
+ {
+ return EnumerateFileSystemEntryInfosCore(null, transaction, path, Path.WildcardStarMatchAll, null, options, null, PathFormat.RelativePath);
+ }
+
+
+ /// [AlphaFS] Returns an enumerable collection of file system entries in a specified path.
+ /// The matching file system entries. The type of the items is determined by the type .
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The type to return. This may be one of the following types:
+ ///
+ ///