This project is a C# application capable of scanning and recovering deleted files from a disk. The application detects deleted files in the NTFS file system and recovers their data blocks to reconstruct them. The project consists of three main classes: DiskReader, MFTParser, and FileRecovery.
- Detects deleted files from the NTFS file system.
- Reads and recovers the data blocks of deleted files.
- Writes the recovered files to a specified location.
- .NET Core SDK
- Windows operating system (compatible with NTFS file system)
-
Clone the repository:
git clone https://github.com/FurkanYazbahar/RecoveryDeletedFiles cd RecoveryDeletedFiles -
Install the necessary dependencies:
Ensure that the .NET Core SDK is installed. Visit the official site to download and install it.
-
Build the project:
dotnet build
-
Run the application:
dotnet run
-
Read the raw data from the disk:
The
DiskReaderclass opens the specified drive and reads the raw data. -
Parse MFT records:
The
MFTParserclass analyzes MFT records and identifies deleted files. -
Recover data blocks:
The
FileRecoveryclass reads and recovers the data blocks of deleted files.
In the Main function of the program, you can run it as follows:
class Program
{
static void Main(string[] args)
{
try
{
DiskReader diskReader = new DiskReader();
diskReader.OpenDisk("C"); // Change to the appropriate drive letter
byte[] mftData = diskReader.ReadData(0, 1024 * 1024); // Read 1MB of MFT data
MFTParser mftParser = new MFTParser();
var deletedFiles = mftParser.IdentifyDeletedFiles(mftData);
FileRecovery fileRecovery = new FileRecovery(diskReader);
foreach (var deletedFile in deletedFiles)
{
Console.WriteLine($"Deleted File Found: {deletedFile.FileName}");
fileRecovery.RecoverFileDataBlocks(deletedFile.MFTRecord, deletedFile.FileName);
}
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}This project is licensed under the Apache License 2.0. See the LICENSE file for more information.