MFT
This is a parser for the MFT (master file table) format.
MSRV is latest stable rust.
Python bindings are available as well at https://github.com/omerbenamram/pymft-rs (and at PyPi https://pypi.org/project/mft/)
Features
- Implemented using 100% safe rust - and works on all platforms supported by rust (that have stdlib).
- Supports JSON and CSV outputs.
- Supports extracting resident data streams.
Installation (associated binary utility):
- Download latest executable release from https://github.com/omerbenamram/mft/releases
- Releases are automatically built for for Windows, macOS, and Linux. (64-bit executables only)
- Build from sources using
cargo install mft
mft_dump (Binary utility):
The main binary utility provided with this crate is mft_dump, and it provides a quick way to convert mft snapshots to different output formats.
Some examples
mft_dump <input_file>will dump contents of mft entries as JSON.mft_dump -o csv <input_file>will dump contents of mft entries as CSV.mft_dump -o csv --hard-link-rows --stream-rows <input_file>will also write a row for each hard link and each alternate data stream of a file.mft_dump --extract-resident-streams <output_directory> -o json <input_file>will extract all resident streams in MFT to files in <output_directory>.
Library usage:
use MftParser;
use MftAttributeContent;
use PathBuf;
Performance profiling (samply)
The repo ships with a small sample MFT (samples/MFT, ~13MB) which makes a good fixed workload.
Baseline timings (hyperfine)
# End-to-end CLI throughput (write output to /dev/null to avoid terminal overhead).
CPU profiling (samply)
# End-to-end (parsing + serialization) profile.
# Parser-only profile (no serialization/output), long single-process run.
# View in the Firefox Profiler UI.
In the Firefox Profiler UI:
- Use the Call Tree tab with Invert call stack to identify top leaf frames.
- Keep Invert call stack off to see inclusive hot functions (top-down).
- Use Filter stack to focus on crate frames (for example,
mft::ormft_dump::).
Thanks/Resources:
- https://docs.microsoft.com/en-us/windows/desktop/DevNotes/master-file-table
- https://github.com/libyal/libfsntfs/blob/master/documentation/New%20Technologies%20File%20System%20(NTFS).asciidoc
- https://github.com/forensicmatt/RustyMft
Test data
Some test data under testdata/ comes from third parties and has its own licence, listed next to it: testdata/ntfs/README.md for the NTFS images, and testdata/win11/NOTICE.md
for the Windows 11 records (CC-BY-4.0). testdata/ isn't part of the published crate.