
The investigation into ReFS highlighted that metadata is stored in 16KB blocks. Official Microsoft documentation states that the ReFS storage engine uses B+ trees and this is the single on-disk structure which is used to represent all the disk information.
Throughout the investigation it can be seen that folders, files and even drive labels are stored in the same format using the same structure. They are stored in 16KB blocks and where the file has content a file pointer, it will point to the 16KB metadata block address. This is the logical address rather than physical, meaning the block start from offset 0x0100000 which in ReFS is the beginning of the FSRS (or on NTFS the VBR).
For example, in the metadata block below the pointer is B8 01 (stored in little endian, coloured in purple).
- This becomes 01 B8 when converted to big endian
- Then becomes 440 when converted into decimal
- When multiplied by 16,384 (16KB) this is now 7208960
- In hexadecimal this is 6E0000
- When the offset of 100000 is added to this it becomes 7E0000
- 7E0000 is the location where the content of the file is stored
Other information (shown below) found within the metadata block includes MACE times (green), the file/folder/item name (red) and file size (blue). The bytes highlighted in orange are used for file permissions.
0007D45A0 61 00 79 00 70 00 72 00 65 00 73 00 65 00 6E 00 74 00 2E
00 74 00 78 00 74 00 00 00
00 00 00 00 a.y.p.r.e.s.e.n.t...t.x.t.......
0007D45C0 50 04 00 00 10 00 2A 00 08 00 40 00 10 04 00 00 30 00 01
00 62 00 69 00 72 00 74 00 68 00 64 00 P.....*...@.....0...b.i.r.t.h.d.
0007D45E0 61 00 79 00 70 00 72 00 65 00 73 00 65 00 6E 00 74 00 2E
00 74 00 78 00 74 00 00 00
00 00 00 00 a.y.p.r.e.s.e.n.t...t.x.t.......
0007D4600 A8 00 00 00 28 00 01 00 00 00 00 00 10 01 00 00 10 01 00
00 02 00 00 00 00 00 00 00 00 00 00 00 ¨...(...........................
0007D4620 00 00 00 00 00 00 00 00 E7 38 59 ED 70 41 D0
01 28 65 C6 E6 70 41 D0 01 8F 8C D4 E6 70 41 D0 01 ........ç8YpAƉ.(eææpAƉ..ÔæpAƉ.
0007D4640 E7 38 59 ED 70 41 D0 01 20 00 00 00 00 00 00 00 05 07 00 00 00 00
00 00 01 00 00 00 00 00 00 00 ç8YpAƉ. .......................
0007D4660 2B 4F FA FB 01 00 00 00 2D 00 00 00 00 00 00 00 00 00 01 00
00 00 00 00 00 00 00 00 00 00 00 00 +Oúû....-.......................
0007D4680 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 01 00 00 00 00 00 00 00 ................................
0007D46A0 00 00 00 00 00 00 00 00 20 00 00 00 A0 01 00 00 D4 00 00
00 00 02 00 00 74 02 00 00 01 00 00 00 ........ ... ...Ô.......t.......
0007D46C0 78 02 00 00 00 00 00 00 80 01 00 00 10 00 0E 00 08 00 20
00 60 01 00 00 60 01 00 00 00 00 00 00 x................ .`...`.......
0007D46E0 80 00 00 00 00 00 00 00 88 00 00 00 28 00 01 00 01 00 00
00 20 01 00 00 20 01 00 00 02 00 00 00 ..........(....... ... .......
0007D4700 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00
00 00 00 00 00 00 00 00 00 00 00 01 00 ................................
0007D4720 00 00 00 00 2D 00 00 00 00 00 00 00 2D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ....-.......-...................
0007D4740 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0007D4760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00
00 50 00 00 00 84 00 00 00 00 02 00 00 ................ ...P..........
0007D4780 D4 00 00 00 01 00 00 00 D8 00 00 00 00 00 00 00 30 00 00
00 10 00 10 00 00 00 10 00 20 00 00 00 Ô.......ø.......0........... ...
0007D47A0 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 B8 01 00 00 00 00 00 00 00 00 00 08 00 00 00
00 ................¸...............
0007D47C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
The first two bytes of each metadata block begins with the address of that particular block. See the table below for examples of this.
|
Metadata Block |
First Two Bytes |
Big Endian |
Decimal |
Multiplied by 16KB |
Convert back to Hex |
Add 100000 |
|
0x0700000 |
80 01 |
01 80 |
384 |
6291456 |
600000 |
700000 |
|
0x0710000 |
84 01 |
01 84 |
388 |
6356992 |
610000 |
710000 |
|
0x0714000 |
85 01 |
01 85 |
|
|
614000 |
714000 |
|
0x0718000 |
86 01 |
01 86 |
390 |
|
|
|
|
0x071C000 |
87 01 |
01 87 |
|
|
|
|
|
0x0754000 |
95 01 |
|
|
|
|
|
|
0x0760000 |
98 01 |
|
|
|
|
|
|
0x0764000 |
99 01 |
|
|
|
|
|