![]() |
VOOZH | about |
dotnet add package ReadLiveNTFS.csproj --version 1.0.2
NuGet\Install-Package ReadLiveNTFS.csproj -Version 1.0.2
<PackageReference Include="ReadLiveNTFS.csproj" Version="1.0.2" />
<PackageVersion Include="ReadLiveNTFS.csproj" Version="1.0.2" />Directory.Packages.props
<PackageReference Include="ReadLiveNTFS.csproj" />Project file
paket add ReadLiveNTFS.csproj --version 1.0.2
#r "nuget: ReadLiveNTFS.csproj, 1.0.2"
#:package ReadLiveNTFS.csproj@1.0.2
#addin nuget:?package=ReadLiveNTFS.csproj&version=1.0.2Install as a Cake Addin
#tool nuget:?package=ReadLiveNTFS.csproj&version=1.0.2Install as a Cake Tool
A .NET library for accessing locked files and restricted directories in Windows NTFS file systems through raw disk access.
This entire project (~95% at least) was generated by Claude, an LLM offered by Anthropic at https://claude.ai/. I spent some time massaging areas it was having trouble with for various reasons.
While I understand how the project works at a high-level and have reviewed/tested the code in some static use-cases, please be sure to test for your use-case to ensure functionality.
I have done the following to test (examples shown in Program.cs):
I'm both impressed and horrified by how rapidly LLM coding is progressing.
I did modify some items in Program.cs to perform more readable testing - but Claude could have done that too if I asked I'm sure.
I spent some time fixing code in areas focusing on reading Alternate Data Streams, parsing Sparse files and handling links as the LLM kept trying to use code that it thought 'worked' but clearly didn't.
Other fun things it did:
Here is a link to the original Claude chat showing my prompt/conversation with the model: https://claude.ai/share/6198248b-5d0c-4cea-ab1a-bb7bb316fb64
Feel free to submit PRs/Issues and I can attempt to triage, but no promises.
The rest of this README was generated by Claude.
Install the package via NuGet:
Install-Package RawNtfsAccess
// Configure options
var options = new RawNtfsOptions
{
BufferSize = 4 * 1024 * 1024, // 4MB buffer
MaxLinkDepth = 10,
FollowRelativeLinks = true,
FollowAbsoluteLinks = false
};
// Create an accessor for drive C:
using (var ntfsAccessor = new RawNtfsAccessor('C', options))
{
// Use the accessor here
}
// Copy a file that's locked by Windows
string sourceFile = @"C:\Windows\System32\config\SOFTWARE";
string destinationFile = @"C:\Temp\SOFTWARE";
using (var ntfsAccessor = new RawNtfsAccessor('C'))
{
ntfsAccessor.CopyFile(sourceFile, destinationFile, true);
}
// List files in a directory you don't have permissions for
string restrictedDir = @"C:\Windows\System32\config";
using (var ntfsAccessor = new RawNtfsAccessor('C'))
{
// Get all files
foreach (var file in ntfsAccessor.GetFiles(restrictedDir))
{
Console.WriteLine($"{file.FullPath} ({file.Size} bytes)");
}
// Get all subdirectories
foreach (var dir in ntfsAccessor.GetDirectories(restrictedDir))
{
Console.WriteLine($"{dir.FullPath}");
}
}
// Access alternate data streams
string filePath = @"C:\path\to\file.txt";
using (var ntfsAccessor = new RawNtfsAccessor('C'))
{
// Get all alternate data stream names
var adsNames = ntfsAccessor.GetAlternateDataStreamNames(filePath);
foreach (var adsName in adsNames)
{
// Read from a specific alternate data stream
using (var stream = ntfsAccessor.OpenFile($"{filePath}:{adsName}"))
using (var reader = new StreamReader(stream))
{
string content = reader.ReadToEnd();
Console.WriteLine($"ADS {adsName}: {content}");
}
}
}
// Resolve and follow symbolic links
string linkPath = @"C:\Documents and Settings";
using (var ntfsAccessor = new RawNtfsAccessor('C'))
{
// Get info about the link
var dirInfo = ntfsAccessor.GetDirectoryInfo(linkPath);
if (dirInfo.IsReparsePoint)
{
Console.WriteLine($"Link target: {dirInfo.LinkTarget}");
// Resolve the link to its final destination
string resolvedPath = ntfsAccessor.ResolveLinkTarget(linkPath);
Console.WriteLine($"Resolved target: {resolvedPath}");
}
}
The RawNtfsOptions class provides several configuration options:
var options = new RawNtfsOptions
{
// Size of the buffer used for reading data (in bytes)
BufferSize = 4 * 1024 * 1024, // 4MB default
// Maximum depth for resolving symbolic links and junction points
MaxLinkDepth = 10,
// Whether to follow relative symbolic links
FollowRelativeLinks = true,
// Whether to follow absolute symbolic links
FollowAbsoluteLinks = false
};
This project is licensed under the MIT License - see the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net481 net481 is compatible. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2 | 307 | 3/11/2025 |