Quote:
[Originally Posted by blabberer;95380]i am still not sure what exactly you are aiming at ....read the post again which you linked get a hang of the structures and look at offset a192b0 you will see 0x60ed this is the parent of devtext.xxxxx |
I have done a lot more reading and I am getting a better understanding of the MFT structure.
In your reference above, you mention the parent directory 0x60ed. That is actually the record number of the file record.
Here's how I understand it. The MFT begins with record $MFT which is file record 0, or inode 0. The $MFT record is followed by 16 system file records and user file records begin at about the 24th record. So, all file records begin with the signature 'FILE'. In your case file record 0x60ed is the decimal 24813 record from the beginning of the MFT table, where $MFT is file 0.
At inode 5, the 0x5 file record, is the 'dot' or '.' file record, which represents the root directory of the directory/sub-directory system. The b-tree lives in this record which is regarded as another file in NTFS terminology. Or, at least, node 0 of the b-tree is here and most of the rest is non-resident and pointed to in this record.
To summarize that, file record # 5, which is inode 5, begins with signature 'FILE', and is regarded as just another file in the MFT structure. However, the function of that file is to layout the directory/sub-directory index, which may contain other files, and whose files use the signature INDX.
Here is a copy from my system:
Code:
Offset | 0 1 2 3 4 5 6 7 - 8 9 A B C D E F | ASCII
-----------------------------------------------------------------------------------
00C0001400 | 46 49 4C 45 30 00 03 00 CF 0A 00 0C 00 00 00 00 | FILE0...........
00C0001410 | 05 00 01 00 38 00 03 00 38 02 00 00 00 04 00 00 | ....8...8.......
00C0001420 | 00 00 00 00 00 00 00 00 19 00 00 00 05 00 00 00 | ................
00C0001430 | 12 00 05 00 00 00 00 00 10 00 00 00 60 00 00 00 | ............`...
00C0001440 | 00 00 18 00 00 00 00 00 48 00 00 00 18 00 00 00 | ........H.......
00C0001450 | CF CB C8 CC F3 3B CE 01 04 52 87 46 4D AC CE 01 | .....;...R.FM...
00C0001460 | 04 52 87 46 4D AC CE 01 04 52 87 46 4D AC CE 01 | .R.FM....R.FM...
00C0001470 | 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001480 | 00 00 00 00 0D 01 00 00 00 00 00 00 00 00 00 00 | ................
00C0001490 | 00 00 00 00 00 00 00 00 30 00 00 00 60 00 00 00 | ........0...`...
00C00014A0 | 00 00 18 00 00 00 01 00 44 00 00 00 18 00 01 00 | ........D.......
00C00014B0 | 05 00 00 00 00 00 05 00 CF CB C8 CC F3 3B CE 01 | .............;..
00C00014C0 | 57 BA 96 5C CB 3C CE 01 57 BA 96 5C CB 3C CE 01 | W..\.<..W..\.<..
00C00014D0 | 57 BA 96 5C CB 3C CE 01 00 00 00 00 00 00 00 00 | W..\.<..........
00C00014E0 | 00 00 00 00 00 00 00 00 06 00 00 10 00 00 00 00 | ................
00C00014F0 | 01 03 2E 00 00 00 00 00 90 00 00 00 58 00 00 00 | ............X...
00C0001500 | 00 04 18 00 00 00 16 00 38 00 00 00 20 00 00 00 | ........8... ...
00C0001510 | 24 00 49 00 33 00 30 00 30 00 00 00 01 00 00 00 | $.I.3.0.0.......
00C0001520 | 00 10 00 00 01 00 00 00 10 00 00 00 28 00 00 00 | ............(...
00C0001530 | 28 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 | (...............
00C0001540 | 18 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001550 | A0 00 00 00 50 00 00 00 01 04 40 00 00 00 18 00 | ....P.....@.....
00C0001560 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001570 | 48 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 | H...............
00C0001580 | 00 10 00 00 00 00 00 00 00 10 00 00 00 00 00 00 | ................
00C0001590 | 24 00 49 00 33 00 30 00 11 01 2C 00 00 00 00 00 | $.I.3.0...,.....
00C00015A0 | B0 00 00 00 28 00 00 00 00 04 18 00 00 00 17 00 | ....(...........
00C00015B0 | 08 00 00 00 20 00 00 00 24 00 49 00 33 00 30 00 | .... ...$.I.3.0.
00C00015C0 | 01 00 00 00 00 00 00 00 00 01 00 00 68 00 00 00 | ............h...
00C00015D0 | 00 09 18 00 00 00 09 00 38 00 00 00 30 00 00 00 | ........8...0...
00C00015E0 | 24 00 54 00 58 00 46 00 5F 00 44 00 41 00 54 00 | $.T.X.F._.D.A.T.
00C00015F0 | 41 00 00 00 00 00 00 00 05 00 00 00 00 00 12 00 | A...............
00C0001600 | 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001610 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001620 | 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 | ................
00C0001630 | FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001640 | 18 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001650 | A0 00 00 00 50 00 00 00 01 04 40 00 00 00 18 00 | ....P.....@.....
00C0001660 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001670 | 48 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 | H...............
00C0001680 | 00 10 00 00 00 00 00 00 00 10 00 00 00 00 00 00 | ................
00C0001690 | 24 00 49 00 33 00 30 00 11 01 2C 00 00 00 00 00 | $.I.3.0...,.....
00C00016A0 | B0 00 00 00 28 00 00 00 00 04 18 00 00 00 17 00 | ....(...........
00C00016B0 | 08 00 00 00 20 00 00 00 24 00 49 00 33 00 30 00 | .... ...$.I.3.0.
00C00016C0 | 01 00 00 00 00 00 00 00 00 01 00 00 68 00 00 00 | ............h...
00C00016D0 | 00 09 18 00 00 00 09 00 38 00 00 00 30 00 00 00 | ........8...0...
00C00016E0 | 24 00 54 00 58 00 46 00 5F 00 44 00 41 00 54 00 | $.T.X.F._.D.A.T.
00C00016F0 | 41 00 00 00 00 00 00 00 05 00 00 00 00 00 05 00 | A...............
00C0001700 | 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001710 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001720 | 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 | ................
00C0001730 | FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001740 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001750 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001760 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001770 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001780 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C0001790 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C00017A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C00017B0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C00017C0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C00017D0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C00017E0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
00C00017F0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00 | ................
Offset 000 = file signature = FILE
Offset 004 = offset to update sequence = 0x30
Offset 006 = update sequence size in words = 3
Offset 008 = $Logfile sequence number (LSN) = C000ACF = 201,329,359
Offset 010 = Sequence number = 5
Offset 012 = Hard Link count = 1
Offset 014 = offset to the first attribute = 0x38 **********************
Offset 016 = Flags = 3 00 (in use and a directory)
Offset 018 = Real size of the file record = 0X238 = 568 bytes
Offset 01C = Allocated size of the file record = 0x0400 = 1024 bytes
Offset 020 = Base File record = 0 ($MFT)
Offset 028 = Next attribute ID = 0x19 = 25
Offset 02C = ID of this record = 5 ********************************
Offset 030 = Update Sequence Number = 12 00
Offset 032 = Update Sequence Array = 05 00 00 00
Offset 014 told us the first attribute was located at offset 0x38
Offset 038 = Attribute $10 = $STANDARD_INFORMATION (contains file time/date etc.)
Inside attribute $10 it tells us the offset to the next attribute is 0x18
Also, it tells us the length of the $10 attribute is 0x60, including header.
Adding 0x60 to Offset 038 gives us Offset 098
Offset 098 = Attribute $30 = $FILE_NAME, which tells us the file name of record 5 is 0x2e, or . (ie. dot)
That attributes size is also 0x60, so adding that to Offset 096 gives us Offset 0F8
Offset 0F8 = attribute $90 = $INDEX_ROOT
Bingo!! Here is the root directory attribute. If the directory index is really small, it can all be described here. If not, pointers are required to a non-resident index described by the $0A attribute = $INDEX_ALLOCATION.
The word 'allocation' gives us a hint. On a volume, space is either allocated (in use) or not. Another attribute $B0 - $BITMAP, keeps tract of allocated and unallocated space by marking a cluster in a table as allocated or not allocated. So, $INDEX_ROOT, $INDEX_ALLOCATION and $BITMAP work together to keep tract of directory/sub-directory indexing.
In the dot directory (file record 5), if the directory structure is small, there is no need for the $ALLOCATION_INDEX attribute because everything is resident within the 1024 bytes allocated to file record 5.
Getting back to:
Offset 098 = $90 attribute ($INDEX_ROOT), it tells us that the name of the directory is at 0X18 = $I30. All directories are called $I30. It also tells us that the directory data is at 0x20. There you will find 4 x 64 bit time/date structures, file created, file modified, record changed and last access time.
Here's where it gets tricky for me. The next attribute at Offset 150 is the $INDEX_ALLOCATION attribute, which describes non-resident directory info:
Offset 150 = $A0
Offset 154 = Length including header = 0x80
Offset 158 = Non-resident flag = 1 (means data that follows is not in the MFT).
Offset 159 = Name length = 4 (name is $I30...another directory)
Offset 15A = Name offset = 0x40 ($I30 @ offset 190)
Offset 15C = Flags = 00 00 = (not compressed, not encrypted, not sparse)
Offset 15D = Attribute ID = 24 (???)
Now for the good stuff:
Offset 160 = First VCN = 0
Offset 168 = Last VCN = 0 (not sure what this means yet)
Offset 170 = Data Runs Offset = 0
This could be referring to $INDEX_ROOT which has no data runs offset or VCN offset. (ie. it's right here)
Fast forward to:
Offset 198 = $INDEX_ALLOCATION = Data run
At 198, you see the sequence 11 01 2C, meaning size = 0x11, cluster count = 01 and first cluster is at 0x2C. I am still not sure what size refers to but the cluster count is the number of times a standard sized cluster can be divided into the file length I have verified that with another situation.
So, my C: directory should be at cluster offset 2C from the beginning of the partition. Let's check:
Sure enough, at offset 2C000, there is an INDX signature.
I wont print out the whole thing, just the header:
Code:
Offset | 0 1 2 3 4 5 6 7 - 8 9 A B C D E F | ASCII
-----------------------------------------------------------------------------------
000002C000 | 49 4E 44 58 28 00 09 00 91 0A 00 0C 00 00 00 00 | INDX(...........
000002C010 | 00 00 00 00 00 00 00 00 40 00 00 00 A8 06 00 00 | ........@.......
000002C020 | E8 0F 00 00 00 00 00 00 45 00 05 00 CE 01 00 00 | ........E.......
000002C030 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
000002C040 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
000002C050 | 00 00 00 00 00 00 00 00 04 00 00 00 00 00 04 00 | ................
000002C060 | 68 00 52 00 00 00 00 00 05 00 00 00 00 00 05 00 | h.R.............
000002C070 | CF CB C8 CC F3 3B CE 01 CF CB C8 CC F3 3B CE 01 | .....;.......;..
000002C080 | CF CB C8 CC F3 3B CE 01 CF CB C8 CC F3 3B CE 01 | .....;.......;..
000002C090 | 00 10 00 00 00 00 00 00 00 0A 00 00 00 00 00 00 | ................
000002C0A0 | 06 00 00 00 00 00 00 00 08 03 24 00 41 00 74 00 | ..........$.A.t.
000002C0B0 | 74 00 72 00 44 00 65 00 66 00 00 00 00 00 00 00 | t.r.D.e.f.......
You can see the $AttrDef file which is an MFT file listed in the C:\ directory but hidden. Also, later in the record, you can see all the other MFT system files like $Mft, $MftMirr, etc., plus the Recycle bin.
At this time, I don't have a structure for the INDX files and I am working on that. Your reference to parent and child interactions applies to the nodes in the b-tree which is made up of $I30 directories and INDX files.