I'm currently trying to programmatically parse the MFT of my hard drive from it's raw data in order to enumerate all files with a specific extension (in a really short time).
I'm following that tutorial to guide myself: A Programmers View of Raw Filesystem Data Extraction .
I've successfully opened \\.\PhysicalDrive0 using CreateFileA, and I did locate the first sector of my Windows partition where I found the BPB.
My problem is that I'm unable to properly locate the MFT.
As you can see above (raw data of the first sector of my Windows partition), the logical cluster number of the MFT is equal to 0x56a6.
I then calculated the number of sectors per clusters which is 0x20 (0x20 * 512 = 0x4000 bytes).
So logically the MFT is at offset 0x4000 * 0x56a6 which is equal to 0x15a98000.
And when I seek to that offset and retrieve the first 512 bytes I don't see the expected data which is supposed to start by FILE (I just see some random bytes).
I also tried to seek not from the first sector of the partition but the one of the hard drive and it doesn't work too (I guess that's normal).
I guess that I'm missing something, but I don't know what.
I hope I've been clear enough, if you need more details and informations I'll provide them.
Thanks.

According to the definition of
NTFS_BOOT_SECTORstruct in the document, the offset ofuchSecPerClustis 3 + 4 + 4 +sizeof(WORD)= 0x0D.(Ignore byte alignment)Or you can uses
DeviceIoControlwith theIOCTL_DISK_GET_DRIVE_GEOMETRYcontrol code to fill aDISK_GEOMETRYstructure with information about the drive:https://learn.microsoft.com/en-us/windows/win32/devio/calling-deviceiocontrol
Another useful control code:
FSCTL_ENUM_USN_DATA