All Projects → DiscUtils → Discutils

DiscUtils / Discutils

Licence: mit
Utility libraries to interact with discs, filesystem formats and more

Projects that are alternatives of or similar to Discutils

Testdisk
TestDisk & PhotoRec
Stars: ✭ 511 (+22.54%)
Mutual labels:  filesystem, disk
Fatcat
FAT filesystems explore, extract, repair, and forensic tool
Stars: ✭ 201 (-51.8%)
Mutual labels:  filesystem, disk
Node Ntfs
Windows NT File System (NTFS) file system driver
Stars: ✭ 18 (-95.68%)
Mutual labels:  filesystem, disk
Advanced-xv6
Modern improvements for MIT's xv6 OS
Stars: ✭ 26 (-93.76%)
Mutual labels:  disk, filesystem
Filesystem
FileSystem is an application that allows you to browse the content of your iPhone disk, displaying file and folders, files contents, and detailed informations about file and folder permissions.
Stars: ✭ 148 (-64.51%)
Mutual labels:  filesystem, disk
Imm2Virtual
This is a GUI (for Windows 64 bit) for a procedure to virtualize your EWF(E01), DD (raw), AFF disk image file without converting it, directly with VirtualBox, forensically proof.
Stars: ✭ 40 (-90.41%)
Mutual labels:  disk, filesystem
Infinit
The Infinit policy-based software-defined storage platform.
Stars: ✭ 363 (-12.95%)
Mutual labels:  filesystem
Fwanalyzer
a tool to analyze filesystem images for security
Stars: ✭ 382 (-8.39%)
Mutual labels:  filesystem
Nixos Generators
Collection of image builders [[email protected]]
Stars: ✭ 355 (-14.87%)
Mutual labels:  iso
Goofys
a high-performance, POSIX-ish Amazon S3 file system written in Go
Stars: ✭ 3,932 (+842.93%)
Mutual labels:  filesystem
Rm Protection
A safe alternative for "rm".
Stars: ✭ 416 (-0.24%)
Mutual labels:  filesystem
Catfs
Cache AnyThing filesystem written in Rust
Stars: ✭ 404 (-3.12%)
Mutual labels:  filesystem
Dokany
User mode file system library for windows with FUSE Wrapper
Stars: ✭ 4,055 (+872.42%)
Mutual labels:  filesystem
Php Iban
Generate, parse, validate, error-correct and present IBAN (and IIBAN) bank account information in PHP.
Stars: ✭ 368 (-11.75%)
Mutual labels:  iso
Webdavmailrucloud
WebDAV cloud.mail.ru ...& Yandex.Disk | WebDAV Облако Mail.Ru Сетевой Диск
Stars: ✭ 386 (-7.43%)
Mutual labels:  disk
Disk Burnin And Testing
Shell script for burn-in and testing of new or re-purposed drives
Stars: ✭ 353 (-15.35%)
Mutual labels:  disk
Electron Filesystem
FileSystem for windows
Stars: ✭ 409 (-1.92%)
Mutual labels:  filesystem
Mango
mango fun framework
Stars: ✭ 343 (-17.75%)
Mutual labels:  filesystem
Svfs
The Swift Virtual File System
Stars: ✭ 375 (-10.07%)
Mutual labels:  filesystem
Filesystem
The Filesystem component provides basic utilities for the filesystem.
Stars: ✭ 4,111 (+885.85%)
Mutual labels:  filesystem

Project Description

Build status

DiscUtils is a .NET library to read and write ISO files and Virtual Machine disk files (VHD, VDI, XVA, VMDK, etc). DiscUtils is developed in C# with no native code (or P/Invoke).

Implementation of the ISO, UDF, FAT and NTFS file systems is now fairly stable. VHD, XVA, VMDK and VDI disk formats are implemented, as well as read/write Registry support. The library also includes a simple iSCSI initiator, for accessing disks via iSCSI and an NFS client implementation.

Note: this is a fork of https://github.com/quamotion/DiscUtils, which itself is a fork of https://discutils.codeplex.com/.

Wiki

See more up to date documentation at the Wiki

Implementation in this repository

This repository has performed a few changes to the core DiscUtils library. For starters, all projects have been converted to .NET Core, and are targeting .NET 2.0 through 4.5, in addition to NETStandard 1.5 (thanks Quamotion).

The DiscUtils library has been split into 25 independent projects, which can function without the others present. This reduces the "cost" of having DiscUtils immensely, as we're down from the 1 MB binary it used to be.

To work with this, four Meta packages have been created:

  • DiscUtils.Complete: Everything, like before
  • DiscUtils.Containers: such as VMDK, VHD, VHDX
  • DiscUtils.FileSystems: such as NTFS, FAT, EXT
  • DiscUtils.Transports: such as NFS

Note on detections

DiscUtils has a number of detection helpers. These provide services like "which filesystem is this stream?". For this to work, you must register your filesystem providers with the DiscUtils core. To do this, call:

DiscUtils.Setup.RegisterAssembly(assembly);

Where assembly is the assembly you wish to register. Note that the metapackages have helpers:

SetupHelper.SetupComplete(); // From DiscUtils.Complete
SetupHelper.SetupContainers(); // From DiscUtils.Containers
SetupHelper.SetupFileSystems(); // From DiscUtils.FileSystems
SetupHelper.SetupTransports(); // From DiscUtils.Transports

How to use the Library

Here's a few really simple examples.

How to create a new ISO:

CDBuilder builder = new CDBuilder();
builder.UseJoliet = true;
builder.VolumeIdentifier = "A_SAMPLE_DISK";
builder.AddFile(@"Folder\Hello.txt", Encoding.ASCII.GetBytes("Hello World!"));
builder.Build(@"C:\temp\sample.iso");

You can add files as byte arrays (shown above), as files from the Windows filesystem, or as a Stream. By using a different form of Build, you can get a Stream to the ISO file, rather than writing it to the Windows filesystem.

How to extract a file from an ISO:

using (FileStream isoStream = File.Open(@"C:\temp\sample.iso"))
{
  CDReader cd = new CDReader(isoStream, true);
  Stream fileStream = cd.OpenFile(@"Folder\Hello.txt", FileMode.Open);
  // Use fileStream...
}

You can also browse through the directory hierarchy, starting at cd.Root.

How to create a virtual hard disk:

long diskSize = 30 * 1024 * 1024; //30MB
using (Stream vhdStream = File.Create(@"C:\TEMP\mydisk.vhd"))
{
    Disk disk = Disk.InitializeDynamic(vhdStream, diskSize);
    BiosPartitionTable.Initialize(disk, WellKnownPartitionType.WindowsFat);
    using (FatFileSystem fs = FatFileSystem.FormatPartition(disk, 0, null))
    {
        fs.CreateDirectory(@"TestDir\CHILD");
        // do other things with the file system...
    }
}

As with ISOs, you can browse the file system, starting at fs.Root.

How to create a virtual floppy disk:

using (FileStream fs = File.Create(@"myfloppy.vfd"))
{
    using (FatFileSystem floppy = FatFileSystem.FormatFloppy(fs, FloppyDiskType.HighDensity, "MY FLOPPY  "))
    {
        using (Stream s = floppy.OpenFile("foo.txt", FileMode.Create))
        {
            // Use stream...
        }
    }
}

Again, start browsing the file system at floppy.Root.

Development releases

Automated CI builds are available on Myget. Add this source to your nuget configuration:

https://www.myget.org/F/discutils/api/v3/index.json

.. or add this to a NuGet.Config file (Casing important on linux), in your repository:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="DiscUtils" value="https://www.myget.org/F/discutils/api/v3/index.json" />
  </packageSources>
</configuration>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].